travis-ci / travis.rb

Travis CI Client (CLI and Ruby library)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to authenticte on github with `--pro` flag

benkonz opened this issue · comments

I'm trying to login with the travis cli via travis login --pro. I'm putting in my username, password, and 2FA code, but after that I get this error message:

<~>-1-> travis login --pro --debug
** Loading "---/config.yml"
** GET "config"
**   took 0.38 seconds
We need your GitHub login to identify you.
This information will not be sent to Travis CI, only to api.github.com.
The password will not be displayed.

Try running with --github-token or --auto if you don't want to enter your password anyway.

Username: ---
Password for ---: 
** GitHub API: POST /authorizations
Two-factor authentication code for ---: ---
\** GitHub API: POST /authorizations
**   took 1.1 seconds
** GitHub API: GET /user?per_page=100
**   took 0.42 seconds
** POST "auth/github" {:github_token=>"---"}
**   took 0.4 seconds
** GET "users/"
**   took 0.1 seconds
--- has not granted Travis CI the required permissions, please log in via travis-ci.com
** GitHub API: DELETE /authorizations/---
**   took 0.53 seconds

Right afterwords, I get an email from github saying that a personal access token was created, but when I check github, I don't see a new token.

Can you try running the command without ~/.travis.yml?

You get the email about a new token because we create one (the second POST /authorizations). You won't see it on GitHub afterwards because we'd already deleted (DELETE /authorizations/NNNNNN) it by the time you get to it.

Can you try running the command without ~/.travis.yml?

How do I run it without ~/.travis.yml?

Ooops. I meant ~/.travis/config.yml.

Having the same issue here, fresh install of travis gem, no ~/.travis/config.yml. Was working up until I migrated from travis-ci.org to travis-ci.com, now I can't log in to either.

$ travis login --pro --debug
** GET "config"
**   took 0.43 seconds
We need your GitHub login to identify you.
This information will not be sent to Travis CI, only to api.github.com.
The password will not be displayed.

Try running with --github-token or --auto if you don't want to enter your password anyway.

Username: ---
Password for ---:
** GitHub API: POST /authorizations
Two-factor authentication code for ---: ---
** GitHub API: POST /authorizations
**   took 1.4 seconds
** GitHub API: GET /user?per_page=100
**   took 1.2 seconds
** POST "auth/github" {:github_token=>"---"}
**   took 0.81 seconds
** GET "users/"
**   took 0.13 seconds
--- has not granted Travis CI the required permissions, please log in via travis-ci.com
** GitHub API: DELETE /authorizations/---
**   took 1.1 seconds
$ travis report --pro
System
Ruby:                     Ruby 2.7.1-p83
Operating System:         Linux
RubyGems:                 RubyGems 3.1.2

CLI
Version:                  1.9.1
Plugins:                  none
Auto-Completion:          yes
Last Version Check:       2020-05-22 23:47:05 -0700

Session
API Endpoint:             https://api.travis-ci.com/
Logged In:                no
Verify SSL:               yes
Enterprise:               no

Endpoints
com:                      https://api.travis-ci.com/ (current)

I need the user names that are having difficulties. If you'd rather not share them in public, do send them to support@travis-ci.com.

In the mean time, could you try syncing your user data at https://travis-ci.com/account/preferences

Thanks.

Re-syncing my user data allowed me to login, thanks. I didn't realize syncing my data was a thing I needed to do

@benkonz Great to hear that my suggestion was effective. I am sorry about the issues you've had. I'll add comments to this effect so that others may not have the same issue.