401 - Bad credentials (Octokit::Unauthorized)

Our release keeps erroring out because of bad credentials. The release worked before, but we needed to change the user credentials used for authenticating, which was done using travis setup releases. However, after doing this the authorization fails and the build errors.

Here’s a link to the latest failed build: https://travis-ci.com/kits-ab/LogLady/jobs/242982422

This is what our travis.yml looks like:

language: node_js
node_js: "10"
os: osx
osx_image: xcode10.2
script:
  - npm run lint
  - npm test
  - npm run electron-pack
branches:
  only:
    - master
    - develop
deploy:
  provider: releases
  api_key:
    secure: ERpJxGce5QXVN1V2uwVc+hlrPxBZwYhVq5XX1HI2e5d4SCUV/Mx3x2+ba9TdTQNvv9h6pjWScEjGVLvk/X6KXVIKlABNBB3zn3/lwJwAGUTD97IWCmyvYtcbNElTog/XXeg4j9/NwEDaL3jOOv1b8cVSCfzhi+znd48Dv73NKe74uaGPiN1WcD+hHMlh1lXorWH9MwJujNT5ske00xHi9PZHaYFHZpEAtM85cbq1JLpxLc9J7uqQyOLMQDfDDp4ZyiWsWT3f/1NwY3Yz2BrOvrAOo7i5u/7htRHckWXzcDxwpPyMPTZAsVjFzhbCLAmAyaHUo6VP7SwQvqNiU8PYS8lljN+XikwxY4FJWGMFUUYku6S0Fq0fzoxEEFQgLYNlstv9sKT0cxuT7/0y85ld6bskQRvhcowlVJ2z8aOgZHiBc365QaXSg2fmSb3cBnLgMSG68ADHKfoMRVs/NqOSgIzpqon2P6XgrD5QJlg70YM6T5FEAP3bJ7IKpqXorqZEUTyRpEUfX9G3xF2PGn/ERvsePsvmVw+Zd/XCU0TWjwUA1Yd5MWiCpKLYOjmh3hGs1rbHoRLqqrk6KNQ3KH6W8YLnHY+zGzmRh1Ri8IJR20sYPkaJQJPQMOdee4LtKt6ZaWIiTlQPVnt+IwRgpzQlia7ODAizcqnmgEhddyNRvcQ=
  file:
    - 'dist/loglady 1.0.0.AppImage'
    - 'dist/loglady-1.0.0.dmg'
    - 'dist/loglady Setup 1.0.0.exe'
  skip_cleanup: true
  on:
    branch: master
    tags: false

I assume there is something wrong with the encrypted api_key, but a Personal Access Token is created on github for the correct user with what seems to be the correct scope, so I am not sure where things are going wrong.

I am using Windows when running travis setup releases, not sure if that changes anything.

Your credentials are wrong. Since your build runs on https://travis-ci.com, you need to use the .com API endpoint to encrypt your API key. Try

travis encrypt --pro

Yes! That solved it! Thank you for the help :slight_smile:

Imprint