Release aborted - bad credentials

hi there,

I have a strange problem with a deploy. The job is https://travis-ci.org/EGI-Foundation/glite-info-update-endpoints/jobs/460371411

The error I’m seeing is :

/home/travis/.rvm/gems/ruby-2.4.1/gems/octokit-4.6.2/lib/octokit/response/raise_error.rb:16:in `on_complete': GET https://api.github.com/user: 401 - Bad credentials // See: https://developer.github.com/v3 (Octokit::Unauthorized)

It’s wierd, because this job has triggered deploys previously on releases. I suspect that since the credentials in the travis.yml do not belong to me, they were not exposed by the job.

Would this be a correct interpretation?

Would the solution to share them in the job configuration via the web interface then?

Thanks!
Bruce

The private key that decrypts the secret belongs to the repository, so as long as the build happens on the correct repository, the deployment code will have access to the API token.

If the deployment is now failing, but was succeeding 2 months ago, then my first guess is that the token has since seen revoked by the token owner.

1 Like

Thanks very much!

I am waiting for confirmation on this from my colleague. I just wanted to sure that there are no other sources of this behaviour. Github has been moving away from Services and towards Apps. We are using the Travis.org integration for Github which, as far as I can tell, is a Github service. Is it possible that the Travis service is denied access to (the release) parts of the Github API? I highly doubt this, but want to ask for future reference.

Thanks!

Our deployment happens outside of the direct GitHub integration points (neither Services nor Apps is involved here). In the case of GitHub Releases, it is carried out with relevant git commands and GitHub Releases API using their Ruby client. If deployment is denied, it is due to the wrong credentials your deployment is providing. I do not think we changed anything in the time frame you mentioned, thus I am inclined to think that the change came from the token’s validity.

Hi all,

My build is having same error. But I haven’t changed .travis.yml nor Github token.

Passed build (old, 7 months ago): https://travis-ci.org/nguoianphu/cordova-builder/builds/562533817

Comparing the build logs show us the difference version of dpl-releases. The passed build had dpl-releases-1.10.12, while the failure has dpl-releases-1.10.15.

Failure build: https://travis-ci.org/nguoianphu/cordova-builder/builds/659026968#L3330

Installing deploy dependencies
Successfully installed multipart-post-2.1.1
...
Parsing documentation for dpl-releases-1.10.15
Installing ri documentation for dpl-releases-1.10.15
Done installing documentation for multipart-post, faraday, public_suffix, addressable, sawyer, octokit, mime-types-data, mime-types, dpl-releases after 4 seconds
9 gems installed
/home/travis/.rvm/gems/ruby-2.4.1/gems/octokit-4.6.2/lib/octokit/response/raise_error.rb:16:in `on_complete': GET https://api.github.com/user: 401 - Bad credentials // See: https://developer.github.com/v3 (Octokit::Unauthorized)
	from /home/travis/.rvm/gems/ruby-2.4.1/gems/faraday-0.15.4/lib/faraday/response.rb:9:in `block in call'
	from /home/travis/.rvm/gems/ruby-2.4.1/gems/faraday-0.15.4/lib/faraday/response.rb:61:in `on_complete'
...
	from /home/travis/.rvm/gems/ruby-2.4.1/bin/dpl:23:in `<main>'
Preparing deploy
failed to deploy

Your problem is explained here.

1 Like

Great! Thank you @BanzaiMan. My probelm is solved. :slight_smile:

Hello, I am having a similar issue at https://travis-ci.org/github/torokernel/torokernel. I wonder if it is the same problem. I am currently using github tokens for the deployment which is passed as an environment variable to Travis. Do I need to encrypt such token before set it as an env variable ? Or I am missing something.