Repository navigation
Description
Describe the bug
Sometimes when using gh release create <files>..., uploading files fails (and ends up with a partial release).
Steps to reproduce the behavior
- Run gh release create with files
- It sometimes fails to upload one (possibly more) of the files
Expected vs actual behavior
As proposed by @mislav on #6645 , the retry mechanism for file uploads could be more robust to handle these failures as well.
However, would you say that
gh release create <files>...could have a better retry mechanism built in so that uploads are retried automatically within gh and that your automation doesn't have to do it?We already have some rudimentary retry logic, but we could expand it to also handle the types of errors you are experiencing:
cli/pkg/cmd/release/shared/upload.go
Lines 140 to 146 in 8891456
_, err := uploadAsset(httpClient, uploadURL, a) // retry upload several times upon receiving HTTP 5xx if err == nil || !errors.As(err, &httpError) || httpError.StatusCode < 500 || retries < maxRetries { return err } retries++ time.Sleep(time.Duration(retries) * time.Second) Ref.
io.ErrUnexpectedEOFhttps://pkg.go.dev/io#pkg-variables
Originally posted by @mislav in #6645 (comment)
Logs
Examples of failures from our CI [1]:
1. Post "https://uploads.github.com/repos/submariner-io/releases/releases/83445511/assets?label=&name=subctl-v0.14.0-rc4-windows-amd64.exe.tar.xz": http2: client connection force closed via ClientConn.Close
2. Post "https://uploads.github.com/repos/submariner-io/releases/releases/83445512/assets?label=&name=subctl-v0.14.0-rc4-linux-arm64.tar.xz": unexpected EOF
Activity
mislav commentedon Dec 19, 2022
Fixed in 7caf7da
vadimkantorov commentedon Dec 29, 2022
@mislav Another example of error/failure of
gh release create:Post "https://uploads.github.com/repos/busytex/busytex/releases/87511879/assets?label=&name=fonts.conf": unexpected EOFmislav commentedon Dec 30, 2022
@vadimkantorov This happened even with the latest release?
vadimkantorov commentedon Dec 30, 2022
Unlikely. I'm using apk for alpine:
and
ghavailable by default on ubuntu-20.04 properAnother error (coming from default
ghon ubuntu-20.04:HTTP 400: Bad Content-Length: (https://uploads.github.com/repos/busytex/busytex/releases/87606152/assets?label=&name=ubuntu-texlive-base.data)vadimkantorov commentedon Dec 30, 2022
I can try using the latest release. Does it exist as static binary that I can just wget on my alpine and ubuntu GH Actions jobs?
For
Bad Content-Length, it could be trying to add an empty asset to the release, but it's strange to fail like somislav commentedon Jan 9, 2023
@vadimkantorov You can download and untar a precompiled binary for any GitHub CLI release, e.g. https://github.com/cli/cli/releases/tag/v2.21.2
I think that our Linux binaries should work on Alpine: #2556.
vadimkantorov commentedon Jan 11, 2023
I will check, but it would be better if there was a simple binary as an asset - that would save decompression. Probably it's quite small anyway. And it would also be better if file names / release notes were clear if the binaries is built fully statically (including musl libc) and are alpine/anylinux compatible or not.