Repository navigation
Closed
Labels
bugSomething isn't workinghelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic
Description
Describe the bug
Sometimes gh release create with files fails due to upload errors. When it does, the draft release gets left behind.
Steps to reproduce the behavior
- Run
gh release createwith files - If it failed, observe the draft release still on the repo
Expected vs actual behavior
Expected the draft release to be deleted in such a case (or at least CLI should attempt to delete it).
Actual behavior is the draft release left behind and needing to be manually deleted.
Logs
We retry failed releases in our jobs - https://github.com/submariner-io/releases/actions/runs/3491034412/jobs/5843200596#step:4:536
Attempt 1/3 to run 'dryrun gh release create v0.14.0-rc4 projects/subctl/dist/subctl-v0.14.0-rc4-darwin-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-ppc64le.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-s390x.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-windows-amd64.exe.tar.xz --prerelease --title 0.14.0-rc4 --repo submariner-io/releases --target 028e897467e763af21965593387796a99ab3a1ec'
[18:56:13.824] [dir=releases; fn=dryrun]$ gh release create v0.14.0-rc4 projects/subctl/dist/subctl-v0.14.0-rc4-darwin-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-ppc64le.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-s390x.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-windows-amd64.exe.tar.xz --prerelease --title 0.14.0-rc4 --repo submariner-io/releases --target 028e897467e763af21965593387796a99ab3a1ec
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
Attempt 2/3 to run 'dryrun gh release create v0.14.0-rc4 projects/subctl/dist/subctl-v0.14.0-rc4-darwin-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-ppc64le.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-s390x.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-windows-amd64.exe.tar.xz --prerelease --title 0.14.0-rc4 --repo submariner-io/releases --target 028e897467e763af21965593387796a99ab3a1ec'
[18:56:15.543] [dir=releases; fn=dryrun]$ gh release create v0.14.0-rc4 projects/subctl/dist/subctl-v0.14.0-rc4-darwin-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-ppc64le.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-s390x.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-windows-amd64.exe.tar.xz --prerelease --title 0.14.0-rc4 --repo submariner-io/releases --target 028e897467e763af21965593387796a99ab3a1ec
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
Attempt 3/3 to run 'dryrun gh release create v0.14.0-rc4 projects/subctl/dist/subctl-v0.14.0-rc4-darwin-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-ppc64le.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-s390x.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-windows-amd64.exe.tar.xz --prerelease --title 0.14.0-rc4 --repo submariner-io/releases --target 028e897467e763af21965593387796a99ab3a1ec'
[18:56:18.020] [dir=releases; fn=dryrun]$ gh release create v0.14.0-rc4 projects/subctl/dist/subctl-v0.14.0-rc4-darwin-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-amd64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-arm64.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-ppc64le.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-linux-s390x.tar.xz projects/subctl/dist/subctl-v0.14.0-rc4-windows-amd64.exe.tar.xz --prerelease --title 0.14.0-rc4 --repo submariner-io/releases --target 028e897467e763af21965593387796a99ab3a1ec
https://github.com/submariner-io/releases/releases/tag/v0.14.0-rc4
The releases page (we will delete the drafts, so I took a screenshot):

Metadata
Metadata
Assignees
Labels
bugSomething isn't workinghelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic
Activity
mislav commentedon Nov 21, 2022
Hi, thank you for reporting, and agreed that creating a draft release first (and then uploading files to it) is an implementation detail of
gh release create <files>...and that when the operation fails, it shouldn't leave unexpected artifacts behind.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
Ref. https://github.com/golang/net/blob/ecf7fda6a59edbedc58c1207f55285a9ad98e10a/http2/transport.go#L1130
Ref.
io.ErrUnexpectedEOFhttps://pkg.go.dev/io#pkg-variablesmkolesnik commentedon Nov 22, 2022
Thanks @mislav , it would be very useful if file uploads could be retried automatically more thoroughly.
I think the draft release should still be deleted in case of failure to create the release with the files.
Do you want me to report a separate issue for retrying file uploads?
mislav commentedon Nov 22, 2022
@mkolesnik Sure! Let's treat retrying logic as a separate issue