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

401 - Bad credentials Travis #104

Open
flofriday opened this issue Jun 8, 2018 · 7 comments
Open

401 - Bad credentials Travis #104

flofriday opened this issue Jun 8, 2018 · 7 comments

Comments

@flofriday
Copy link

flofriday commented Jun 8, 2018

I don't like writing an issue here and bore you but I spend the whole day with 22 releases and everyone failed. I simply don't know what to do at this point.

What I did

  1. copy the trust files in my repository https://github.com/flofriday/thumbcloud
  2. changing some build options
  3. create the appveyor encrypted key with my github token -> and appveyor works perfectly which means my github token must work
  4. create the travis encrypted key with travis encrypt bd2XXXXXXX46f -> travis fails everytime at deployment with GET https://api.github.com/user: 401 - Bad credentials https://travis-ci.com/flofriday/thumbcloud/jobs/128447592

I also tried:

@flofriday
Copy link
Author

It took me 27 releases but I got it.

I had to type travis encrypt bd2XXXXXX46f --pro (bd2XXXXXX46f is my github token).

Little bit of backstory:

Originally travis was split in travis-ci.org for opensource and travis-ci.com for paid private project. However in may 2018 they decided to move to travis.com only. So when I signed up to travis I got an travis-ci.com account, but the commandline tool https://github.com/travis-ci/travis.rb was last updated in march and so it doesn't know that the two domains are now united.

Therefore, the tool assumed that my opensource project is on .org which is wrong and with travis encrypt --pro you can force the .com domain.

However, I am not sure if this is the reason it didn't worked, it is just the only explanation I can think of. Please correct me if I am wrong.

Add this to .travis.yml

Maybe it would be a good idea to add to .travis.yml something like:

deploy:
  # TODO update `api_key.secure`
  # - Create a `public_repo` GitHub token. Go to: https://github.com/settings/tokens/new
  # - Encrypt it: `travis encrypt 0123456789012345678901234567890123456789`
  #      Note: If your project is on travis-ci.com you need to add the --pro flag like so:
  #      `travis encrypt 0123456789012345678901234567890123456789 --pro`
  # - Paste the output down here
  api_key:

@psychelzh
Copy link

psychelzh commented Jun 13, 2018

@flofriday Thanks! It solved my issue, too. This could be added to the documentation of travis-ci or to StackOverflow for future reference.

@psychelzh
Copy link

Now I understand it. We should choose --org or --pro (travis.com) at first. Based on the full conversion from org to com, so I used --pro. I manually turned off the services of org, then the releases never result in a bad credential now.

@flofriday
Copy link
Author

flofriday commented Jun 14, 2018 via email

@psychelzh
Copy link

psychelzh commented Jun 14, 2018

@flofriday Maybe this doc would help a little. Seemingly there will be a full transit from org to pro.

@flofriday
Copy link
Author

I created the PR #105, and I will leave this issue open for now until the problem is fixed, so future users can find the solution faster.

@psychelzh yes if found the document helped once I found out that --pro fixed my problem, but until that moment it wasn't clear to me that my problem and the transit where connected.
As the doc points out the decision for the transit took place on May 2nd, 2018 however the CLI travis tool was last updated on February 12, 2018 (as you can see here. So the tool just doesn't know about this move to travis-ci.com. Personally I really hope that they will update their tool so it can auto-detect between .com and .org.

HenrySwanson added a commit to VenerableHouse/VenerableWebsite that referenced this issue Aug 13, 2019
Travis appears to be broken: something about bad credentials: https://travis-ci.org/RuddockHouse/RuddockConstitution

I think it could be solved by japaric/trust#104 though. Time to ask Alex about it.
otreblan added a commit to otreblan/hello that referenced this issue Sep 15, 2019
@srianbury
Copy link

srianbury commented Nov 17, 2019

Just had this issue and had the wrong permission on my personal token. It's successfully building with these permissions: user:email, read:org, repo_deployment, repo:status, write:repo_hook and I added repo_public because mine is a public repo.

source

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