Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issues with Deploying to Heroku via Travis-CI

I keep getting this error when deploying with Heroku and have been getting it with several different reports that I'm trying to deploy to Heroku after running their build through Travis.

No stash entries found.
API request failed.
Message: Invalid credentials provided.
Reference: 
failed to deploy

I don't get any more information than that.I tried updating my Heroku API key but that didn't seem to work. I've used the Travis setup Heroku command as well as creating the build step manually, but I still get the same error. Here's what the deploy section of my .travis.yml file looks like

deploy: provider: heroku api_key: secure: g3gj25vI58r48P63E... app: heroku-travis-test-01 on: repo: andrico1234/heroku-travis-test

Is this a common issue?

Edited: Adding Travis' install dependencies stack trace

2.71s$ rvm $(travis_internal_ruby) --fuzzy do ruby -S gem install dpl
Fetching: dpl-1.10.0.gem (100%)
Successfully installed dpl-1.10.0
1 gem installed
dpl.1
Installing deploy dependencies
Fetching: multipart-post-2.0.0.gem (100%)
Successfully installed multipart-post-2.0.0
Fetching: faraday-0.15.2.gem (100%)
Successfully installed faraday-0.15.2
Fetching: rendezvous-0.1.2.gem (100%)
Successfully installed rendezvous-0.1.2
Fetching: netrc-0.11.0.gem (100%)
Successfully installed netrc-0.11.0
Fetching: dpl-heroku-1.10.0.gem (100%)
Successfully installed dpl-heroku-1.10.0
5 gems installed
like image 403
Andrico Karoulla Avatar asked Aug 20 '18 07:08

Andrico Karoulla


People also ask

What are some ways you can deploy your code to Heroku?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.

Can you deploy on Heroku?

Heroku lets you deploy, run and manage applications written in Ruby, Node. js, Java, Python, Clojure, Scala, Go and PHP.

Can you host a server on Heroku?

Heroku is a Platform as a Service(PaaS) that makes it easy to deploy servers to the web. Heroku takes pride in its simplicity and ease by which users can take their local servers to production. Heroku has a very intuitive dashboard making it easy for users to deploy their servers.

What is Heroku API?

The platform API empowers developers to automate, extend and combine Heroku with other services. You can use the platform API to programmatically create apps, provision add-ons and perform other tasks that could previously only be accomplished with the Heroku CLI or Dashboard.


1 Answers

For some reason heroku auth:token was returning a wrong token for me, even after making sure that I was logged in to heroku on the command line.

After trying all the solutions posted, what worked for me was:

  • Go to Heroku Account
  • Manually copy the API Key and then paste it into command line:
    • For the ones hosted at travis-ci.com:
    • travis encrypt pasteAPIKeyHere --add deploy.api_key --pro
    • For the ones hosted at travis-ci.org:
    • travis encrypt pasteAPIKeyHere --add deploy.api_key --org

Hope this helps.

like image 126
Nicolas Buitrago Castaño Avatar answered Oct 22 '22 10:10

Nicolas Buitrago Castaño