http2 failure in `UploadAsset`
We are using ghr to upload binary assets from Github to CI.
Currently I am seeing an increased failure rate:
Failed to upload one of assets: one of the goroutines failed: failed to upload asset: /tmp/jl_A641Uc/Clang_assert.v12.0.1.x86_64-linux-gnu-cxx11.tar.gz: failed to upload release asset: /tmp/jl_A641Uc/Clang_assert.v12.0.1.x86_64-linux-gnu-cxx11.tar.gz: Post https://uploads.github.com/repos/JuliaBinaryWrappers/Clang_assert_jll.jl/releases/49230189/assets?name=Clang_assert.v12.0.1.x86_64-linux-gnu-cxx11.tar.gz: http2: Transport: cannot retry err [stream error: stream ID 117; REFUSED_STREAM] after Request.Body was written; define Request.GetBody to avoid this error
AFAIK ghr uses UploadAsset: https://github.com/tcnksm/ghr/blob/93494744e6930d13e5c052eac9ca64a6027779a4/github.go#L184 from https://github.com/tcnksm/ghr/blob/93494744e6930d13e5c052eac9ca64a6027779a4/github.go#L209
and the error looks like https://github.com/golang/go/issues/25009
Investigating... possibly related? https://github.com/olivere/elastic/issues/1443 https://sourcegraph.com/github.com/golang/net/-/commit/cffdcf672aee934982473246bc7e9a8ba446aa9b?visible=2
I remember we recently (<1year ago) made a couple changes with respect to the request:
- https://github.com/google/go-github/pull/1645
- https://github.com/google/go-github/pull/1576
but I'm not sure if these are related.
Turned out that is was hiding the actual errors:
Failed to upload one of assets: one of the goroutines failed: failed to upload asset: /tmp/jl_kxYk28/Clang_assert.v12.0.1.aarch64-apple-darwin.tar.gz: failed to upload release asset: /tmp/jl_kxYk28/Clang_assert.v12.0.1.aarch64-apple-darwin.tar.gz: Post https://uploads.github.com/repos/JuliaBinaryWrappers/Clang_assert_jll.jl/releases/49230189/assets?name=Clang_assert.v12.0.1.aarch64-apple-darwin.tar.gz: write tcp 128.30.92.237:33810->140.82.113.13:443: use of closed network connection
Failed to upload one of assets: one of the goroutines failed: failed to upload asset: /tmp/jl_kxYk28/Clang_assert.v12.0.1.x86_64-unknown-freebsd.tar.gz: failed to upload release asset: /tmp/jl_kxYk28/Clang_assert.v12.0.1.x86_64-unknown-freebsd.tar.gz: Post https://uploads.github.com/repos/JuliaBinaryWrappers/Clang_assert_jll.jl/releases/49230189/assets?name=Clang_assert.v12.0.1.x86_64-unknown-freebsd.tar.gz: write tcp 128.30.92.237:33988->140.82.113.13:443: use of closed network connection
Failed to upload one of assets: one of the goroutines failed: failed to upload asset: /tmp/jl_kxYk28/Clang_assert.v12.0.1.aarch64-linux-gnu-cxx11.tar.gz: failed to upload release asset: /tmp/jl_kxYk28/Clang_assert.v12.0.1.aarch64-linux-gnu-cxx11.tar.gz: Post https://uploads.github.com/repos/JuliaBinaryWrappers/Clang_assert_jll.jl/releases/49230189/assets?name=Clang_assert.v12.0.1.aarch64-linux-gnu-cxx11.tar.gz: write tcp 128.30.92.237:36032->140.82.114.14:443: write: broken pipe
Glad you found it. Closing issue.
I still think there is an issue here to be fixed. Upgrading to HTTP/2 shouldn't have swallowed these error messages.
Is anyone able to write a unit test that demonstrates the problem?
any update on this?
FWIW this happens occasionally for some goreleaser users as well (using v39).
https://github.com/goreleaser/goreleaser/issues/2746
having the same issue when using goreleaser
Still getting this error
i have same, i using recreate but it said already exist...
--> Uploading: app_compat_db.xml Failed to upload one of assets: one of the goroutines failed: failed to upload asset: D:\a\compatibility\compatibility\app_compat_db.xml: failed to upload release asset: D:\a\compatibility\compatibility\app_compat_db.xml: POST https://uploads.github.com/repos/Vita3K/compatibility/releases/92110749/assets?name=app_compat_db.xml: 422 Validation Failed [{Resource:ReleaseAsset Field:name Code:already_exists Message:}]
According to the official documentation here: https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset
If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset.
So I don't believe these reported errors are a fault of this client library, as the GitHub v3 API provides no apparent mechanism to overwrite an existing file using UploadReleaseAsset.