Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku cli login showing wrong account info

When I successfully log in on the command line using my personal account using:

$heroku login

Enter your Heroku credentials.
Email: [email protected]
Password (typing will be hidden):
Authentication successful.

when I push with:

git push staging master

It gives me an error:

!  Your account [email protected] does not have access to MYAPP-staging.
!
!  SSH Key Fingerprint: FINGERPRINT_REMOVED

What's interesting is that the account shown in the error is someone that I added as a collaborator using the web interface. Heroku support isn't online until morning and I can't push out any code. I can reconfigure my environment etc but since the account in the error message was never used on my machine I feel like it might be an error on heroku's side.

Any ideas? Seen this before?

Thanks.

like image 520
errata Avatar asked Oct 14 '13 04:10

errata


People also ask

How do I log into a different heroku account in terminal?

How can I login using a different account, after the "heroku login" command? You have to create a new profile in your browser, log in to heroku.com and save the password, make sure the browser you're using is your default browser, make sure it's the only open browser window, and run heroku login .

Where does heroku CLI store credentials?

The Heroku command-line tool stores API tokens in the standard Unix file ~/. netrc ( $HOME\_netrc on Windows).

How does heroku CLI login work?

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 .

How do I logout of heroku in terminal?

Hit the command "Heroku Logout" from you cli terminal. If the error persists clear your browser cache. So that you can login again.


2 Answers

You need to manually add the ssh keys:

ssh-add -K ~/.ssh/id_rsa

After that logout and login again

heroku logout

heroku login
like image 196
Sergey Prishak Avatar answered Oct 11 '22 02:10

Sergey Prishak


1. See all the accounts you are having:
heroku accounts

2. Add appropriate account to current repo:
heroku accounts:set <account_name>
like image 28
Moin Haidar Avatar answered Oct 11 '22 00:10

Moin Haidar