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

use of closed file #90

Closed
tcurdt opened this issue Jul 4, 2018 · 3 comments
Closed

use of closed file #90

tcurdt opened this issue Jul 4, 2018 · 3 comments

Comments

@tcurdt
Copy link

tcurdt commented Jul 4, 2018

I am trying to test the re-upload of a release

WARNING: found release (v0.0.5). Use existing one.
--> Uploading:  foo-v0.0.5.tgz
Failed to upload one of assets: one of the goroutines failed: failed to upload asset: /Users/tcurdt/Desktop/base-ci/dist/foo-v0.0.5.tgz: failed to upload release asset: /Users/tcurdt/Desktop/base-ci/dist/foo-v0.0.5.tgz: stat /Users/tcurdt/Desktop/base-ci/dist/foo-v0.0.5.tgz: use of closed file
$ ll /Users/tcurdt/Desktop/base-ci/dist/foo-v0.0.5.tgz
-rw-r--r--  1 tcurdt  staff  209 Jul  4 17:07 /Users/tcurdt/Desktop/base-ci/dist/foo-v0.0.5.tgz

Honestly I have no clue what that error message is trying to tell me. "use of closed file"?

I figured I delete the asset on github and try again - which then worked.

So I see two issues:

  1. A better error message
  2. Support for replacing a release (asset)
@scorphus
Copy link
Contributor

Hi @tcurdt,

Have you tried with -replace or -recreate options? Check the help page:

$ ghr -h
Usage: ghr [options...] TAG PATH

ghr is a tool to create Release on Github and upload your
artifacts to it. ghr parallelizes upload of multiple artifacts.

You must specify tag (e.g., v1.0.0) and PATH to local artifacts.
If PATH is directory, ghr globs all files in the directory and
upload it. If PATH is a file then, upload only it.

And you also must provide GitHub API token which has enough permission
(For a private repository you need the 'repo' scope and for a public
repository need 'public_repo' scope). You can get token from GitHub's
account setting page.

You can use ghr on GitHub Enterprise. Set base URL via GITHUB_API
environment variable.

Options:

  -username, -u      Github repository owner name. By default, ghr
                     extracts it from global gitconfig value.

  -repository, -r    GitHub repository name. By default, ghr extracts
                     repository name from current directory's .git/config.

  -token, -t         GitHub API Token. By default, ghr reads it from
                     'GITHUB_TOKEN' env var.

  -parallel=-1       Parallelization factor. This option limits amount
                     of parallelism of uploading. By default, ghr uses
                     number of logic CPU.

  -recreate          Recreate release if it already exists. If want to
                     upload to same release and replace use '-replace'.

  -replace           Replace artifacts if it is already uploaded. ghr
                     thinks it's same when local artifact base name
                     and uploaded file name are same.

@tcurdt
Copy link
Author

tcurdt commented Jul 24, 2018

Thanks for the pointer. I don't think I tried. But my main gripe is the useless error message. It should be better no matter what.

@Songmu
Copy link
Collaborator

Songmu commented Aug 23, 2018

Fixed at #99

@Songmu Songmu closed this as completed Aug 23, 2018
marcelosalloum added a commit to lightsail-network/java-stellar-sdk that referenced this issue 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

No branches or pull requests

3 participants