Heroku: Your account example@email.com does not have access to <app-name>

Viewed 15457

I am having trouble pushing code to Heroku. I have an account but I've forgotten the password. I created a new account and tried to push with it but now it shows me this error:

Your account someoneelse@gmail.com does not have access to
! SSH Key Fingerprint: 

How can I log in with the new account? I'd like to remove this error message with a fresh account. I have uploaded my latest ssh key to heroku. I have tried everything to push code on heroku (basic setup), but I can't get past this error.


Any application in your account has two ssh key and you should remove one which is not in your "~/.ssh/" folder or follow these steps.

Here's the solution:

  1. Go to www.heroku.com and login with the account that raises the error.

  2. Go to the applications settings. (e.g. for an application named "rails-demo", go to rails-demo settings and check whether there are two ssh keys)

  3. Remove the key which is no longer in your system

  4. Or you can remove them both and then generate new one with these commands.

    -> ssh-keygen -t rsa

    -> heroku keys:add

  5. Upload the new one and then in your console type

    -> heroku log-in

  6. Log in with your account and then push it to you app.

  7. It's solved now.

6 Answers

I had this same issue when deploying a Rails application to Heroku.

After logging in to the Heroku CLI using the command:

heroku login

and also creating the new app using the command:

heroku create

when I run the command git push heroku main, I get the error below:

remote: !       Your account name@mymail.com does not have access to stark-temple-39676.
fatal: unable to access 'https://git.heroku.com/stark-temple-39676.git/': The requested URL returned error: 403

I tried several solutions but none worked for me.

Here's how I fixed it:

First I ran the command git remote -v to see the list of remote, and I got this output:

heroku  https://git.heroku.com/stark-temple-39676.git (fetch)
heroku  https://git.heroku.com/stark-temple-39676.git (push)

The issue was that the name of the heroku git repo stark-temple-39676 was different from the name of the app gentle-lowlands-46404. Apparently, the heroku repo name stark-temple-39676 was for a previous app that I had earlier deployed to Heroku using another Heroku account.

All I had to do was to remove the heroku repo name:

git remote rm heroku

And then delete the app;

heroku apps:destroy --app=gentle-lowlands-46404

And then recreate the app:

heroku create

This time when I pushed the app using the command:

git push heroku main

it worked perfectly.

Note:

  1. You can just modify the repo name for the old app to say heroku-old if you still need it and then recreate the new app.
  2. You can also add the git repo URL for the new app from your Heroku account dashboard instead of deleting it and recreating it.

That's all.

I hope this helps

Related