Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IP Address Mismatch on signing into Heroku CLI

Previously I could sign into the heroku command line interface with heroku login. But now I get an IP address mismatch error. How should I resolve this?

like image 433
Christian Doucette Avatar asked Aug 11 '20 17:08

Christian Doucette


People also ask

Why heroku login is not working?

Here are some steps you can follow to ensure you're logging in using valid credentials: Double check that you've typed your email address correctly. Double check that there are no typos in your password as well. Reset your password and try logging in with the new password.

What is IP address mismatch?

The IP-Shipping Address Mismatch Filter allows you to identify transactions with shipping addresses that are different from the order's originating IP address. This helps to determine whether or not the order is shipping to the country in which it originated.

How do I find my heroku IP address?

Heroku attaches a “x-forwarded-for” header to requests, and gives you an array of IP Addresses as the value. All you need to do is read this array by splitting the raw string at “,” and then find the last item in the array. This will be the real IP address of the client.

How do I log into Heroku command line?

After you install the CLI, run the heroku login command. Enter any key to go to your web browser to complete login. The CLI then logs you in automatically. If you'd prefer to stay in the CLI to enter your credentials, run heroku login -i .


2 Answers

Copy and paste heroku login -i in your terminal. This is what solved it for me.

like image 187
Lex Carter Avatar answered Sep 19 '22 15:09

Lex Carter


The accepted answer (run heroku login -i) doesn't work for accounts with MFA enabled. What I did instead was to reveal my account's API key and put it into ~/.netrc like so:

machine api.heroku.com   login <MY_EMAIL>   password <API_KEY> machine git.heroku.com   login <MY_EMAIL>   password <API_KEY> 

And voila! I can now use the CLI. This worked for me with Google CloudShell.

P.S. -- I added my machine's SSH key but could not understand how to use that to configure the CLI's access. It seems hard-coded to look for API keys in ~/.netrc.

like image 28
Neil C. Obremski Avatar answered Sep 18 '22 15:09

Neil C. Obremski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!