travis.rb icon indicating copy to clipboard operation
travis.rb copied to clipboard

Local environment cannot authenticate with Travis CLI (Enterprise)

Open arewm opened this issue 6 years ago • 9 comments

Every time I try to log into the CLI, the travis report comes back saying that I have an invalid access token. I have verified that there is not an issue with my GitHub token as logging in worked as expected from a coworker's computer. The contents of ~/.travis/config.yml were identical on my computer and my coworker's. Are there any settings that need to be cleared out that might be cached? Are there any applications that the CLI depends on that might be improperly configured? I have tried installing the CLI from gem, brew, and directly from GitHub, but all are affected similarly.

$ gem uninstall travis
Remove executables:
	travis

in addition to the gem? [Yn]  y
Removing travis
Successfully uninstalled travis-1.8.9
$ gem install travis
Fetching travis-1.8.9.gem
Successfully installed travis-1.8.9
Parsing documentation for travis-1.8.9
Installing ri documentation for travis-1.8.9
Done installing documentation for travis after 0 seconds
1 gem installed
$ travis endpoint --set-default -X -e "https://ENTERPRISE_ENDPOINT/api"
API endpoint: https://ENTERPRISE_ENDPOINT/api (stored as default)
$ travis login -X -e "https://ENTERPRISE_ENDPOINT/api" -g $GITHUB_TOKEN
Successfully logged in!
$ travis report
System
Ruby:                     Ruby 2.6.0-p0
Operating System:         Mac OS X 10.14.3
RubyGems:                 RubyGems 3.0.2

CLI
Version:                  1.8.9
Plugins:                  none
Auto-Completion:          yes
Last Version Check:       2019-03-01 15:08:11 -0500

Session
API Endpoint:             https://ENTERPRISE_ENDPOINT/api
Logged In:                invalid access token
Verify SSL:               no
Enterprise:               yes

Endpoints
org:                      https://api.travis-ci.org/ (access token)
enterprise "default":     https://ENTERPRISE_ENDPOINT/api (access token, insecure, default, current)

For issues with the command line tool, please visit https://github.com/travis-ci/travis.rb/issues.
For Travis CI in general, go to https://github.com/travis-ci/travis-ci/issues or email [email protected].

arewm avatar Mar 04 '19 13:03 arewm

Gem

ort55555 avatar Mar 16 '19 14:03 ort55555

I just installed the CLI on a new computer and still have the issue. I do not know if there was some configuration that I copied over that is causing the problem.

arewm avatar Oct 01 '19 17:10 arewm

This problem is giving me fits as well. I've wasted the day trying to simply encrypt a string for my slack notification! Is there anybody working on it?

psbrightly avatar Mar 04 '20 23:03 psbrightly

Not sure if it is any help, but the only workaround that I found out for it is to run the commands in a VM. There is something awry with the settings on my local machine, but I could never track it down.

As far as I know, nobody is working on it. I was even in contact with their internal support team via an enterprise agreement with my company but there is still no workaround. The best thing they gave was for me to interact with the API directly (i.e. using the token in the config in the payload). That was not usable for me...

arewm avatar Mar 05 '20 20:03 arewm

I've tried like 8 systems, containers, 3 operating systems... this is ridiculous. I don't understand why we can't just find the root cause, even if it isn't going to be fixed. Right now, I'd settle for an alternate way to encrypt a key or support for repo variables in the .travis.yml. Thanks for the info.

psbrightly avatar Mar 11 '20 01:03 psbrightly

I have never tried using encrypted keys. Can you use encrypted environment variables instead? I know that you can set those from the UI.

arewm avatar Mar 11 '20 13:03 arewm

I tried env vars. It would have been perfect! It doesn't work. And I finally got the official answer off the travis forum: it isn't supported.

On Wed, Mar 11, 2020 at 8:23 AM Andrew McNamara [email protected] wrote:

I have never tried using encrypted keys. Can you use encrypted environment variables instead? I know that you can set those from the UI.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/travis-ci/travis.rb/issues/663#issuecomment-597630730, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHSHKFS7SYLERFDBONKHLTRG6GEPANCNFSM4G3RNSZA .

psbrightly avatar Mar 11 '20 17:03 psbrightly

The official answer is that the Travis CLI is not supported? ☹️

arewm avatar Mar 11 '20 17:03 arewm

for what it is worth, I am still hitting this with a community repo as well. I still cannot log in. When I run all commands with sudo, however, it does seem to work even though travis report does not come back successfully.

arewm avatar Mar 15 '21 13:03 arewm