I got this error because I was using multiple heroku accounts:
I wanted to do this so I could 'play' independently with my own Heroku account while collaborating with others on a team/project account.
This is separate from the Heroku concept of multiple people collaborating on the team account: I wanted the team account to be the app owner for collaboration, so that my individual account could act as a less-privileged collaborator, just like the rest of the team. Only the owner gets to: Add/remove paid add-ons, Delete/rename the app, and View invoices.
For multiple account support (e.g., your own individual heroku account), you need to add this not-so-very-well-documented add-on:
$ heroku plugins:install git://github.com/ddollar/heroku-accounts.git
see: https://github.com/ddollar/heroku-accounts
This is what your git SSH setup will eventually look like:
(venv)MacPro:your_project username$ more .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = ssh://your_username@git.your_org.com/your_project.git
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "heroku_kb"]
url = git@heroku.individual:your_individual_app.git
fetch = +refs/heads/*:refs/remotes/heroku/*
[remote "heroku_ocp"]
url = git@heroku.your_project:your_team_app.git
fetch = +refs/heads/*:refs/remotes/heroku/*
[heroku]
account = individual
The last three sections above define the two separate heroku remotes and specify which one is active.
The heroku-accounts add-on makes all this work by adding ~/.ssh/config entries:
Host heroku.individual
HostName heroku.com
IdentityFile "/Users/username/.ssh/identity.heroku.individual"
IdentitiesOnly yes
Host heroku.your_project
HostName heroku.com
IdentityFile "/Users/username/.ssh/identity.heroku.your_project"
IdentitiesOnly yes
If you don't separate the accounts out like that, one SSH key will interfere with the other and you will end up in SSH limbo like I did, having fun google/forum-chasing an error that looks like this:
MacPro:your_project username$ git push heroku master
! Your key with fingerprint cf:5b:6b:91:d5:71:e8:8b:73:dc:cf:86:56:fd:7a:49 is not authorized to access [insert appname here].
fatal: The remote end hung up unexpectedly