Unable to connect to Heroku API, please check internet connectivity and try again
Asked Answered
F

6

13

I'm getting this error, but obviously I'm connected! I entered a ticket with Heroku 15 hours ago but received no response.

C:\>heroku config
Enter your Heroku credentials.
Email: myemail@mydomain
Password (typing will be hidden):
 !    Unable to connect to Heroku API, please check internet connectivity and try again.

$ heroku status
 !    Unable to connect to Heroku API, please check internet connectivity and try again.

I even re-installed Heroku client. I even pushed to Heroku while this problem was happening through Git.

Fog answered 8/3, 2014 at 22:55 Comment(8)
did you run heroku login first? It seems it doesn't have your credentials...Dewan
I was connected before. I did use Heroku login, and it still gives that error.Fog
seems you're really have some kind of connectivity issue. You should try adding a debugger on the heroku gem, here is the code that gives the exception, line 260. Good luck... I wish I could help you more, but it seems one of those bugs difficult to track.Dewan
Have a look at this threadInigo
@anuragal It's not git related. I see the Heroku remotes. $ git remote -v heroku [email protected]:appname.git.Fog
@Dewan I can't find the file to debug! I put puts "*** run(#{cmd}, #{arguments})" at the top of the run method in C:\Program Files (x86)\Heroku\lib\heroku\command.rb, yet it doesn't print anything!Fog
use require 'ruby-debug'; debugger before the line you need to debug, and make sure you have installed gem install debugger. I think you should but a debugger on line 260 of that file, to see if this is really giving you the error of connectivity or if it's another thing. First make sure it's really stopping in the debugger.Dewan
Ok I installed the debugger and put require 'ruby-debug'; debugger on line 253 (line 252 without my puts) and it didn't work and still gave the same error with heroku status. I don't think that will work because Heroku uses its own Ruby, and when I run gem install, it is installing in my normal Ruby, not the Ruby Heroku uses. I even put syntax errors in that command.rb file and it still spits out the same error.Fog
F
20

It was because of a missing certificate authority file. The environment variable was pointing to a file that wasn't there.

SSL_CERT_FILE=C:\ruby200\cacert.pem

I wish it gave an error message.

Fog answered 14/4, 2014 at 6:17 Comment(4)
I am running in to same issue with deploying Node app to heroku. Any ideas?Donation
I suppose Heroku still uses the same toolbelt app for Node, so maybe check the $SSL_CERT_FILE exists? Try downloading a CA cert list from Curl and putting it in the Heroku Ruby directory with a link. Verify you can use curl to access Heroku via SSL.Fog
Glad you found your answer, but I've got the same error message but not the same missing file. The error handling in this thing is terrible.Pirzada
Its solved my problem. Here it solve too #5720984Gunzburg
T
1

I want to offer one more piece of clarification here in case the above answer (which is correct) is still unclear. To fix this issue, look up your "Environment Variables" via start menu. On the bottom, you'll see a list of system varibles. Where you see SSL_CERT_FILE follow the path to see if the value path actually exists.

In my case, I had moved a bunch of files around so it was no longer in the correct place. I found a replacement cacert.pem file and replaced the incorrect value. This fixed the connection issue.

Toothpick answered 17/5, 2015 at 4:6 Comment(0)
E
1

For newbies out there using the cloud9 IDE. It's embarrassing to post this but it might help to refresh the browser (If using cloud9 IDE). Sometimes, Cloud9 has minor issues with connectivity.

Electrotonus answered 2/9, 2015 at 2:21 Comment(0)
W
0

This other SO answer solved it for me.

Basically, my heroku remote was missing.

If there isn't a remote branch set up, do heroku git:remote -a my-app-name and it should configure it.

Wayside answered 1/6, 2014 at 3:12 Comment(1)
Except it wasn't git related because I could still push with git.Fog
E
0

For me, it was because I was using an old version of the Heroku CLI/Toolbelt. Even after running heroku update, it was still stuck at version 3.12.1.

To fix, I just uninstalled that old version, and installed the newest version from: https://devcenter.heroku.com/articles/heroku-cli

Extrusive answered 8/2, 2020 at 22:11 Comment(0)
C
0

When picking up an old laptop I ran into this issue too. There is a bit that pointed me in the right direction at the end of this article: https://devcenter.heroku.com/articles/heroku-cli#uninstalling-the-legacy-heroku-gem

So in my case, heroku sat at /usr/local/heroku instead of /usr/local/bin/heroku.

I ended up executing rm -rf /usr/local/heroku. If you try this too, be sure this is relevant to you, it might make a mess out of things. Ugly solution but problem solved.

Chunky answered 14/10, 2021 at 7:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.