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

Improve handling of bad credentials erros by suggesting to generate a new token. #427

Open
fblanqui opened this issue Jan 12, 2022 · 5 comments

Comments

@fblanqui
Copy link

Hello. I get the following error:

14:40 ~/trash/lambdapi (release) dune-release publish distrib
[-] Publishing distribution
[-] Publishing to github
[-] The tag 2.1.0 is present and uptodate on the remote: skipping the tag push
[?] Create release 2.1.0 on https://github.com/Deducteam/lambdapi.git? [Y/n]
Y
[-] Creating release 2.1.0 on https://github.com/Deducteam/lambdapi.git via github's API
dune-release: [ERROR] Github API error:
    Could not retrieve release ID from response
    Github API returned: "Bad credentials"
    See the documentation "https://docs.github.com/rest" that might help you resolve this error.
14:46 ~/trash/lambdapi (release) dune-release --version
1.5.2
14:48 ~/trash/lambdapi (release) git remote -v
origin	[email protected]:fblanqui/lambdapi.git (fetch)
origin	[email protected]:fblanqui/lambdapi.git (push)

What is strange is that it did work on December 13, and that I am never asked for a password or a token.
I don't know what to do. I hope you can help me.

@NathanReb
Copy link
Contributor

Thanks for reporting this!

If you're not asked for a token, it must mean that you already set one at some point in the past. You can try looking for it in ~/.config/dune/github.token.

This looks like your github token might be wrong somehow, either the file was compromised (this has happened in the past, some version of dune-release must have created corrupted token files) or the token expired. Could you run this in verbose mode (i.e. with -vvv) and paste the output here to get a bit more information? Make sure to replace your token in the ouput if it ever gets printed there.

You could try deleting your token file in ~/.config/dune/github.token to get prompted for a fresh github token and see if that fixes the issue.

Please let us know if any of the above fixed the issue!

@fblanqui
Copy link
Author

Indeed, I had a ~/.config/dune/github.token file which expired. It would be nice to add this in your README.md file that, in case of problems, one can try to remove ~/.config/dune/github.token. Thank you for your help.

@NathanReb
Copy link
Contributor

Yeah the documentation needs to improve here along with the tooling, i.e. using dune-release config for this rather than removing the file by hand. It would also be nice to detect this specific kind of error and suggest that solution directly in the tool's output.

Happy to have been of help here, I'm keeping this open until we improve the handling of this kind of errors!

@NathanReb NathanReb changed the title Github API returned: "Bad credentials" Improve handling of bad credentials erros by suggesting generating a new token. Jan 14, 2022
@NathanReb NathanReb changed the title Improve handling of bad credentials erros by suggesting generating a new token. Improve handling of bad credentials erros by suggesting to generate a new token. Jan 14, 2022
@MisterDA
Copy link
Contributor

MisterDA commented Feb 4, 2022

If you're not asked for a token, it must mean that you already set one at some point in the past.

This just happened to me too. Quite confusing! It should be clearer in the readme/documentation where to find the token. Note that public_repo is sufficient for permissions.

@Drup
Copy link

Drup commented Sep 27, 2023

I can confirm this was a very confusing error to get! The only hicup on the road, though, the rest was smooth. :)

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

4 participants