Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku: Your account [email protected] does not have access to <app-name>

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 [email protected] 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.

like image 458
SSR Avatar asked Dec 14 '13 18:12

SSR


People also ask

How do I add an app name in Heroku?

Renaming an application It is possible to rename an application by using the heroku:rename command. The application becomes accessible by the new name immediately, and the old name should not be used anymore to address it. This command succeeded because we typed inside the application folder.

What is app name in Heroku?

By default, a Heroku app is available at its Heroku domain, which has the form [name of app]. herokuapp.com . For example, an app named serene-example-4269 is hosted at serene-example-4269.herokuapp.com . Heroku DNS uses DNSSEC to authenticate requests to all herokuapp.com and herokudns.com domains.

How do I rename my Heroku app URL?

If you want to rename your app, run heroku apps:rename [newname] in the app folder and swap out newname with the name that you want to change to. You can also see a complete list of Heroku apps that you're a creator or contributor to by running heroku apps .

Is Heroku free forever?

Starting November 28th, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® will no longer be available. If you have apps using any of these resources, you must upgrade to paid plans by this date to ensure your apps continue to run and to retain your data.


1 Answers

You need to:

  • clean any extra ssh key in your Heroku app that you don't have locally (See SSR's edit)
  • register your new account (as described in "Managing Multiple Heroku Accounts"):

    heroku accounts:add myNewAccount (2013, ddollar/heroku-accountsdeprecated)
    Use heroku/heroku-accounts with heroku plugins:install heroku-accounts
    heroku accounts:add myNewAccount followed by Heroku credentials (Email, password)

Make sure your ~/.ssh/config file has an 'myNewAccount' entry

Host heroku.myNewAccount   HostName heroku.com   IdentityFile ~/.ssh/id_heroku_myNewAccount_rsa   IdentitiesOnly yes 

And then change the remote 'origin' url:

git remote set-url origin [email protected]:<appname>.git 

Or, as Ian Vaughan comments below

origin is normally heroku when using the 'heroku-toolbelt':

git remote set-url heroku [email protected]:<appname>.git 

That last step will make sure the git push will use your new account, and not the old one.

See more at "Multiple heroku accounts".


If you add "User git" in your config file, you can remove the credential user name 'git':

Host heroku.myNewAccount   User git   HostName heroku.com   IdentityFile ~/.ssh/id_heroku_myNewAccount_rsa   IdentitiesOnly yes 

That means you can use:

git remote set-url origin heroku.myNewAccount:<appname>.git # or git remote set-url heroku heroku.myNewAccount:<appname>.git 
like image 112
VonC Avatar answered Sep 19 '22 14:09

VonC