2

When I try to push a git project to heroku, it gives me an error -

Your key with fingerprint xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx is not authorized to access my_heroku_app.

I've tried almost anything and everything I found on the internet - adding keys, uploading, removed every key and then retried. I've checked there are no multiple accounts. I've also checked the .git/config file to see if the project name is accurate.

I noticed that after I delete the known_hosts file and try to push the project, it says -

The authenticity of host 'heroku.com (50.19.85.132)' can't be established.
RSA key fingerprint is *some.random.fingerprint.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of known hosts.
! Your key with fingerprint my.original.configured.fingerprint is not authorized to access first-app.
fatal: The remote end hung up unexpectedly

This is interesting because that is not my fingerprint. The one I have in ib_rsa.pub is different from the one that heroku tries to use. I did a heroku keys and I see only one key (the one it's supposed to use.) I have no idea where it's picking this weird key from. Any suggestions will help. Thanks!

derekerdmann
  • 17,696
  • 11
  • 76
  • 110
shrmaj
  • 79
  • 1
  • 8

3 Answers3

4

I found the solution.

in .git/config, changed the project name in [remote "heroku"] to the name given by heroku.

shrmaj
  • 79
  • 1
  • 8
4

to avoid Fingerprint problems just enter

$ heroku git:remote -a your-heroku-app-name

(my case: $ heroku git:remote -a blooming-plateau-75741)

and follow with $ git push heroku master

2

For the beginning, should, as mentioned above -

to avoid Fingerprint problems just enter

$ heroku git:remote -a your-heroku-app-name

Then, you need create a key again:

ssh-keygen -t rsa

And add to heroku:

heroku keys:add

And follow you can push:

$ git push branch_name:master
Alex Reuka
  • 91
  • 1
  • 7