Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write: connection reset by peer #62

Closed
ioogle opened this issue Oct 26, 2021 · 9 comments · Fixed by #64
Closed

write: connection reset by peer #62

ioogle opened this issue Oct 26, 2021 · 9 comments · Fixed by #64

Comments

@ioogle
Copy link

ioogle commented Oct 26, 2021

Hi youcao, thanks for your great work.

I came across a random error:

Post "https://uploads.github.com/repos/ioogle/xxx/releases/52036860/assets?name=xxx-api-v0.0.4-darwin-amd64.tar.gz": write tcp 172.17.0.2:39572->140.82.114.13:443: write: connection reset by peer

But sometimes it works fine.

This is the action:

name: Release Go Binaries

on:
  release:
    types: [created]
  workflow_dispatch:

jobs:
  release:
    runs-on: ubuntu-18.04
    env:
      GOPRIVATE: github.com/ioogle
    strategy:
      matrix:
        goos: [linux, darwin]
        goarch: [amd64]
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Set BUILD_TIME env
        run: echo BUILD_TIME=$(date) >> ${GITHUB_ENV}

      - name: Environment Printer
        uses: managedkaos/print-env@v1.0

      - name: Build Go Binary
        uses: wangyoucao577/go-release-action@v1.20
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          goos: ${{ matrix.goos }}
          goarch: ${{ matrix.goarch }}
          project_path: "./cmd/api"
          binary_name: "xxx-api"
          pre_command: "cd ./xxx; git config --global url.\"https://ioogle:${{ secrets.ACCESS_TOKEN }}@github.com\".insteadOf \"https://github.com\"; go mod download"
          ldflags: -X "main.appVersion=${{ github.event.release.tag_name }}" -X "main.buildTime=${{ env.BUILD_TIME }}" -X main.gitCommit=${{ github.sha }} -X main.gitRef=${{ github.ref }}
          asset_name: xxx-api-${{ github.event.release.tag_name }}-${{ matrix.goos }}-${{ matrix.goarch }}
@wangyoucao577
Copy link
Owner

How frequent? Could you please also show me a little more context, i.e., more logs?

@rsubr
Copy link

rsubr commented Nov 3, 2021

I'm getting a different error from the github-assets-uploader while running my release.yml and all the builds fail.

+ github-assets-uploader -f onerror-master-linux-amd64.tar.gz -mediatype application/gzip -repo rsubr/onerror -token *** -tag master
Post "https://uploads.github.com/repos/rsubr/onerror/releases/52562171/assets?name=onerror-master-linux-amd64.tar.gz": http2: Transport: cannot retry err [stream error: stream ID 1; REFUSED_STREAM] after Request.Body was written; define Request.GetBody to avoid this error

Do you need more logs?

@wangyoucao577
Copy link
Owner

I'm getting a different error from the github-assets-uploader while running my release.yml and all the builds fail.

+ github-assets-uploader -f onerror-master-linux-amd64.tar.gz -mediatype application/gzip -repo rsubr/onerror -token *** -tag master
Post "https://uploads.github.com/repos/rsubr/onerror/releases/52562171/assets?name=onerror-master-linux-amd64.tar.gz": http2: Transport: cannot retry err [stream error: stream ID 1; REFUSED_STREAM] after Request.Body was written; define Request.GetBody to avoid this error

Do you need more logs?

You're manually run the action, right? Please remove workflow_dispatch and only trigger it by create_release. If you really want to run it manully, you have to set up some more parameters, e.g., where to upload the asset.

@rsubr
Copy link

rsubr commented Nov 3, 2021

You're manually run the action, right?

You're correct! The release trigger built the binaries and uploaded them successfully. The manual run failed.

It would be great if you could please improve the documentation so it's easy for new users like myself.

Thanks for the great work :-)

@ioogle
Copy link
Author

ioogle commented Nov 4, 2021

How frequent? Could you please also show me a little more context, i.e., more logs?

Hi youcao, sorry for the late reply, its almost 3/4. The yml file is:

name: Release Go Binaries

on:
  release:
    types: [created]
  workflow_dispatch:

jobs:
  release:
    runs-on: ubuntu-18.04
    env:
      GOPRIVATE: github.com/ioogle
    strategy:
      matrix:
        goos: [linux, darwin]
        goarch: [amd64]
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Set BUILD_TIME env
        run: echo BUILD_TIME=$(date) >> ${GITHUB_ENV}

      - name: Environment Printer
        uses: managedkaos/print-env@v1.0

      - name: Build Go Binary (warehouse-api)
        uses: wangyoucao577/go-release-action@v1.20
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          goos: ${{ matrix.goos }}
          goarch: ${{ matrix.goarch }}
          project_path: "./cmd/api"
          binary_name: "warehouse-api"
          pre_command: "cd ./warehouse; git config --global url.\"https://ioogle:${{ secrets.ACCESS_TOKEN }}@github.com\".insteadOf \"https://github.com\"; go mod download"
          ldflags: -X "main.appVersion=${{ github.event.release.tag_name }}" -X "main.buildTime=${{ env.BUILD_TIME }}" -X main.gitCommit=${{ github.sha }} -X main.gitRef=${{ github.ref }}
          asset_name: warehouse-api-${{ github.event.release.tag_name }}-${{ matrix.goos }}-${{ matrix.goarch }}

@wangyoucao577
Copy link
Owner

The error you encounterred seems very similar with cli/cli#3252 and google/go-github#2113.

The github-assets-uploader simply use the https://github.com/google/go-github package to upload the assets, see https://github.com/wangyoucao577/assets-uploader/blob/48033b96b1cc24addb1dd0dad857897c88451e60/cmd/github-assets-uploader/main.go#L83.
Maybe I can retry several times if nothing else can be improved.

How big is your asset? Are you run it on your self-hosted runner? Or uses Github hosted runner? I saw you're using ubuntu-18.04, maybe you can switch to ubuntu-latest . Also, please remove the workflow_dispatch either.

@wangyoucao577
Copy link
Owner

I made a branch that upgrades underlying github package. If it caused by Github's issue, it maybe helpful. Could you please help to have a try? wangyoucao577/go-release-action@bugfix/upload-fail. Thanks!

@peschmae
Copy link

I made a branch that upgrades underlying github package. If it caused by Github's issue, it maybe helpful. Could you please help to have a try? wangyoucao577/go-release-action@bugfix/upload-fail. Thanks!

This branch, solved the issue for me

@wangyoucao577
Copy link
Owner

@ioogle @peschmae The branch will be removed soon, please switch to the new release wangyoucao577/go-release-action@v1.21 which has solved the problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants