Git push heroku master error? - ruby-on-rails

I have successfully created using heroku create but when i push from git it gives me error as below:-
C:\Sites\boot>git push heroku master
! Your account snehp92#gmail.com does not have access to protected-thicket-253
8.
!
! SSH Key Fingerprint: 6e:d8:39:da:45:ad:b5:b2:e5:36:2e:14:0e:92:b5:8e
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

You need to add your ssh key to heroku. To add your keys run the following command
heroku keys:add
If you don't have a key then generate a new key with
ssh-keygen -t rsa
and then add the ssh key to heroku

I would recommend getting the latest version of Heroku Toolbelt, and then adding the repository again:
$ heroku login
Enter your Heroku credentials.
Email: adam#example.com
Password:
Could not find an existing public key.
Would you like to generate one? [Yn]
Generating new SSH public key.
Uploading ssh public key /Users/adam/.ssh/id_rsa.pub
git remote -v
git remove heroku master
heroku git:remote -a protected-thicket-253

Related

Can't push to Heroku using git push heroku master (Could not read from remote repository)

I am trying to push my rails app to Heroku. When I attempt to push to heroku:
git push heroku master
I get the following error:
! Your account abc#abc.com does not have access to APPNAME
! SSH Key Fingerprint: 8b:ac:.......
fatal: Could not read from remote repository
Please make sure you have the correct access rights and the repository exists.
When I type:
heroku keys
I can see my ssh-rsa key.
What I have tried:
Clear all SSH keys (both heroku and gitHub). Create a new SSH key for GitHub and upload this same SSH key to both Heroku and Github
Opened GitBash and
ssh-add
ssh-add -l
To add and verify only one key:
Login to heroku website and verify only one key at SSH key field
I can push to GitHub fine but not to Heroku. Can anyone please help?
1) Firstly do the heroku keys:add and then try or copy your ssh key and paste it, on the account settings of heroku.
2) Secondly checking that ur this ssh key not be accessed by another heroku app ?

Is heroku key set correctly?

I'm trying to deploy a project to heroku. I'm working on win7.
$ git push heroku master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
$ heroku keys
Enter your Heroku credentials.
Email: MYREALEMAIL
Password (typing will be hidden):
=== MYREALEMAIL Keys
ssh-rsa AAAAB3NzaC...ol1Ukh0Q== your_email#youremail.com
$ heroku keys:remove your_email#youremail.com
Removing your_email#youremail.com SSH key... done
dnir#BCMAM27 /f/EasyPHP-12.1/www/phantomjs123 (master)
$ heroku keys
You have no keys.
$ heroku keys:add f:/.ssh/id_rsa.pub
Uploading SSH public key f:/.ssh/id_rsa.pub... done
$ heroku keys
=== MYREALEMAIL Keys
ssh-rsa AAAAB3NzaC...ol1Ukh0Q== your_email#youremail.com
$ git push heroku master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I am concerned that the last line should actually say:
ssh-rsa ****3NzaC...ol1Uk****== MYACTUALEMAIL
Am I correct in this? If so how do I fix this?
check out this article on how to set up ssh keys on heroku.
to remove the bad key
heroku keys:remove your_email#youremail.com
then verify that you have a ssh key
cat ~/.ssh/id_rsa.pub
if not create one
ssh-keygen -t rsa -C "your_email#youremail.com"
then upload the key to heroku
heroku keys:add
Looks like an SSH issue. I think you'll need to generate a new SSH key based on your email.
If you cat ~/.ssh/id_rsa.pub you'll see "your_email#youremail.com" at the end. you need to generate a new one with your email (or hostname).

Heroku with Multiple Domains

I have multiple heroku domains. After I created a new one, and I pushed, it checked the rsa for the first one.
How to handle this? Thanks.
203-96:first_app marklaudalauw$ heroku create
Creating serene-chamber-4301... done, stack is cedar
http://serene-chamber-4301.herokuapp.com/ | git#heroku.com:serene-chamber-4301.git
203-96:first_app marklaudalauw$ git push heroku master
! Your key with fingerprint 98:6b:fe:d4:e3:0a:17:16:ab:f8:11:18:a2:66:76:b6 is not authorized to access glacial-shelf-8147.
fatal: The remote end hung up unexpectedly
Before pushing Try this:-
$ git remote add heroku git#heroku.com:yourappname.git ( to add current stack )
$ heroku keys:add ~/.ssh/id_rsa.pub (if stuck with key then add local machine key to heroku)
$ git commit -m "message"
$ git push heroku master <branch name>
I managed to solve it by the following commands:
git remote rm heroku
git remote add heroku git#heroku.com:serene-chamber-4301.git
Thanks...

Error while deploying application in heroku

I am getting below error while creating app and deploying in heroku using below command
sudo git push heroku master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I tried all the possible scenarios
creating new ssh key , giving admin rights to folder, deleting git remote for heroku and adding it again etc
Steps followed by me:
1) git init
2) git add .
3) git commit -m "Initial Commit"
4) heroku login
5) heroku create
6) sudo git push heroku master
Usually when we create new heroku project using "heroku create" it will create new project and that heroku URL is set as heroku GIT remote URL, but that also not happening everytime i am doing it manually. May be this also due to that same issue i guess...
Below is my detailed error
ponvino#ponvino-desktop:~/RubyWorkspace/prod/theScholarsPage$ sudo mv ~/.ssh/ /.ssh_backup
ponvino#ponvino-desktop:~/RubyWorkspace/prod/theScholarsPage$ heroku keys:add
Could not find an existing public key.
Would you like to generate one? [Yn] y
Generating new SSH public key.
Uploading SSH public key /home/ponvino/.ssh/id_rsa.pub... done
ponvino#ponvino-desktop:~/RubyWorkspace/prod/theScholarsPage$ git push heroku master
The authenticity of host 'heroku.com (50.19.85.156)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'heroku.com,50.19.85.156' (RSA) to the list of known hosts.
Agent admitted failure to sign using the key.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Please help me
Thanks in Advance,
Check that your ssh key is loaded:
ssh-add -l
If not:
ssh-add ~/.ssh/your_private_key
Try again to push to heroku
You should generate pair of keys and add your public key to your heroku account.
More info: https://devcenter.heroku.com/articles/keys
ssh-keygen -t rsa
and then:
heroku keys:add
should be enough.
If nothing works even after trying the above solutions. do this
$ mv ~/.ssh/ ~/.ssh_backup
$ heroku keys:add
$ git push heroku master
Almost same problem was asked and answered in the link below.
Try it

Trouble Deploying Rails App To Heroku

Below is are the steps I tried to deploy my rails app to heroku. However I'm getting "Your key with fingerprint is not authorized to access" my application.
Deleted all existing keys from ~/.ssh
$ heroku keys:clear
$ heroku create lunch-tr
Enter your Heroku credentials.
Email: adam.aahrens#gmail.com
Password (typing will be hidden):
Could not find an existing public key.
Would you like to generate one? [Yn] Y
Generating new SSH public key.
Uploading SSH public key /.ssh/id_rsa.pub... done
Creating lunch-tr... done, stack is cedar
http://lunch-tr.herokuapp.com/ | git#heroku.com:lunch-tr.git Git remote heroku added
$ git remote -v
heroku git#heroku.com:lunch-tr.git (fetch) heroku git#heroku.com:lunch-tr.git (push)
$ git push heroku master
! Your key with fingerprint 2f:0b:2c:e9:95:b4:52:af:dc:db:9c:57:e3:f2:57:7f is not authorized to access lunch-tr. fatal: The remote end hung up unexpectedly
Not sure what else I should try I'm running out of ideas. Thanks for any suggestions
Try ssh-add command, this adds private key identities to the authentication agent.

Resources