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

Fix to open file in a retry loop #99

Merged
merged 1 commit into from
Aug 23, 2018

Conversation

shuheiktgw
Copy link

@shuheiktgw shuheiktgw commented Aug 23, 2018

In my project (called ghbr), when I run the command below,

ghr v0.0.5 ./pkg/dist/v0.0.5/

I encountered the following error.

Failed to upload one of assets: one of the goroutines failed: failed to upload asset: /Users/kitagawa-shuhei/go/src/github.com/shuheiktgw/ghbr/pkg/dist/v0.0.5/ghbr_v0.0.5_linux_386.tar.gz: failed to upload release asset: /Users/kitagawa-shuhei/go/src/github.com/shuheiktgw/ghbr/pkg/dist/v0.0.5/ghbr_v0.0.5_linux_386.tar.gz: stat /Users/kitagawa-shuhei/go/src/github.com/shuheiktgw/ghbr/pkg/dist/v0.0.5/ghbr_v0.0.5_linux_386.tar.gz: use of closed file

The real problem was, that the target repository (shuheiktgw/ghbr) already have a release tagged as v0.0.5 and UploadReleasedAsset failed with 422 Validation Failed.

However, currently the file is opened outside of a retry loop and if GitHub API request fails, the retry fails since the file is already read in UploadReleasedAsset once.

So I fixed to open the file in a retry loop! 👍

@shuheiktgw
Copy link
Author

#90 This issue may relate to this PR

@Songmu Songmu merged commit 0da6d2b into tcnksm:master Aug 23, 2018
@Songmu
Copy link
Collaborator

Songmu commented Aug 23, 2018

Thanks!

@Songmu Songmu mentioned this pull request Aug 23, 2018
marcelosalloum added a commit to lightsail-network/java-stellar-sdk that referenced this pull request Aug 8, 2022
### What

Fix the deployment CI that uploads the jar to the GitHub release by updating the image version of cibuilds/github from `0.10` to `0.13`.

### Why

Close #449.

In an attempt to fix the deploy job, that's failing at:
https://github.com/stellar/java-stellar-sdk/blob/b2a93410a39f7b39f4dbb8e462214ae119a3996b/.circleci/config.yml#L20-L29

With the error message:
```text
Failed to upload one of assets: one of the goroutines failed: failed to upload asset: /root/project/build/libs/stellar-sdk.jar: failed to upload release asset: /root/project/build/libs/stellar-sdk.jar: stat /root/project/build/libs/stellar-sdk.jar: use of closed file
```

Example of a failed deploy: [deploy (669)](https://app.circleci.com/pipelines/github/stellar/java-stellar-sdk/539/workflows/de14000a-07fe-481c-8707-787d3f58bd48/jobs/669/steps)

This error seems to have been fixed at tcnksm/ghr#99 and released in version `0.11.0`. Also referenced in tcnksm/ghr#90.
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 this pull request may close these issues.

2 participants