Failed to deploy (heroku): "API request failed. Message: Invalid credentials provided."

This is what i got

Installing deploy dependencies
Fetching dpl-heroku-1.10.15.gem
Fetching multipart-post-2.1.1.gem
Fetching faraday-1.0.1.gem
Fetching rendezvous-0.1.3.gem
Fetching netrc-0.11.0.gem
Successfully installed multipart-post-2.1.1
Successfully installed faraday-1.0.1
Successfully installed rendezvous-0.1.3
Successfully installed netrc-0.11.0
Successfully installed dpl-heroku-1.10.15
5 gems installed
dpl.2
Preparing deploy
No stash entries found.
API request failed.
Message: Invalid credentials provided.
Reference: 
failed to deploy

My travis config

language: node_js
node_js:
  - 12
branches:
  only:
    - master
deploy:
  provider: heroku
  app: my-react-burger
  api_key:
    secure: $HEROKU_API_KEY
after_success:
  - cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js
  - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

Please help to figure out the issue.

How is $HEROKU_API_KEY defined? If it’s in the settings as a private variable, there is no need for the secure: key in .travis.yml.

I have defined it in Settings -> Enviroment variables
Should i change my travis config?

Yes. secure: ENCRYPTED_STRING is for the cases where ENCRYPTED_STRING is included in .travis.yml.

1 Like

Thanks a lot, you’ve made my day :smiley:

I have replaced

  api_key:
    secure: $HEROKU_API_KEY

to

  api_key: $HEROKU_API_KEY

and it deploys successfully now!

1 Like