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

GitHub release failed with status: 404, retrying... #110

Open
rhalaly opened this issue Jun 20, 2021 · 19 comments
Open

GitHub release failed with status: 404, retrying... #110

rhalaly opened this issue Jun 20, 2021 · 19 comments

Comments

@rhalaly
Copy link
Contributor

rhalaly commented Jun 20, 2021

Got the error: GitHub release failed with status: 404, retrying...

https://github.com/rhalaly/scope-to-this-vscode/runs/2869520835?check_suite_focus=true

Running in an infinite loop. Any idea what is the reason? And how to prevent an infinite loop in the release pipeline?

@aleks-ivanov
Copy link

aleks-ivanov commented Jun 21, 2021

It happens with 422 as well.

This should be high priority fix. Infinite loops are very detrimental in general and especially in this case, because the GitHub API calls limit is reached almost in an instant.

The problem is here on line 232. This return release(config, releaser); needs to be encased in a conditional that at least checks for these two 402 and 422 statuses and NOT execute when they occur.

I would love to contribute that, but I don't feel at all competent enough to contribute a well written solution.

@rhalaly
Copy link
Contributor Author

rhalaly commented Jun 21, 2021

But why the createRelease returns 404? A retry mechanism is important, but why it isn't working?

@aleks-ivanov
Copy link

Have you tried to create a release through the GitHub UI or CLI ?

@rhalaly
Copy link
Contributor Author

rhalaly commented Jun 21, 2021

Eventually, I created the release via GitHub UI

@aleks-ivanov
Copy link

aleks-ivanov commented Jun 21, 2021

Same with the 422 problem I am having.
Through the action fails, through the GitHub UI/CLI works.

According to the previous several issues, this action seems to have been left unmaintained, so I think I will be switching to CLI commands in the pipeline.

@rhalaly
Copy link
Contributor Author

rhalaly commented Jun 21, 2021

Can you please share the code of how to use the CLI directly in the pipeline? (Even though this repo is unmaintained, I will create a PR that will limit the retries)

@aleks-ivanov
Copy link

Depends on what you need specifically of course, but it should look something like this:

run: |
  gh release create ${{ env.VERSION }} -n "${{ env.MESSAGE }}" -t "${{ env.NAME }}" ${{ env.FILES }}
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  VERSION: "tag for release"
  MESSAGE: "message for release"
  NAME: "release name"
  FILES: path/to/file1 path/to/file2 ...

The sample code is from this thread

When I make it specifically for the pipeline I am working on, I will share a link to it.

@rhalaly
Copy link
Contributor Author

rhalaly commented Jun 21, 2021

@aleks-ivanov Thank you!

@aleks-ivanov
Copy link

aleks-ivanov commented Jun 21, 2021

You are welcome 🙂

On the GitHub Actions runners it should be pre-installed and setup on all variants.

Like this, on the Ubuntu 20.04 runner for example, that I will be using.

@softprops
Copy link
Owner

But why the createRelease returns 404

A 404 can happen for different reasons. In a future release Im going to include more debugging information from api response headers the logs. The the mean time the next release will include a change that limits the number of api retries are made

@awesome-manuel
Copy link

Which permissions are required for this action? If the repo is configures the GITHUB_TOKEN to be restrictive, you need to elevate the required permissions in the workflow.

See also https://docs.github.com/en/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token

@kxn468
Copy link

kxn468 commented Nov 1, 2022

image

having the same issue, can anyone help me out

@vitobotta
Copy link

Having this issue right now. Any suggestions?

@pF-luis
Copy link

pF-luis commented Jan 12, 2023

Same problem for me

@miso-dev
Copy link

I've got same error when I use Personal Access Token to release on other repo.

with:
  token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

in my case, I need to add "Content write" permission to that token, for both repositories.

  • home repository which have this GitHub Actions
  • foreign repository which is destination of release

I guess this Actions create release on both home and foreign repo even if we set repository input, so we need permission for both.

@asaurabhW
Copy link

image

having the same issue, can anyone help me out

I am also facing the same issue. I tried to give even permissions: write-all (only for trial), but I still face same issue. Any pointers are appreciated.

@alexrashed
Copy link

Just for the record: I was having the exact same issue with a custom token without referencing another issue. The custom token was used to have a specific user listed as the creator of the release. The workflow step looks like this:

      - name: Release
        uses: softprops/action-gh-release@v1
        with:
          files: 'builds/*'
          draft: true
          token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

In my case, the issue was caused that the personal access token used in the secret was in fact a PAT of the correct user, but did not have the right scopes assigned.

@vickvasquez
Copy link

In addition to having the correct permissions, don't forget to add the custom token in the secrets in the target repository

@multani
Copy link

multani commented Nov 4, 2023

For those facing this issue: the "create release" API returns 404 if the discussion category name is invalid.

image

If you are using the flag to create a discussion for the release and are getting this error, make sure:

  • The discussion feature is enabled inside the repository's settings
  • The related discussion category exists

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