Heroku Create: Could not read from remote repository - ruby-on-rails

Trying to deploy my first Rails app to Heroku.
All app code is here:
https://github.com/donpinkus/first_app.
Running heroku create gives me this error:
donaldmbp15:first_app donald$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
Connection closed by 50.19.85.132
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
donaldmbp15:first_app donald$
It sounds like something along the line, either Heroku or Github does not have access rights. I've pushed to Github from my local git repo, so I'm ruling out Github as the source of error. That leaves Heroku, or my local machine. Any ideas?

First Generate the RSA key first by following
bash: ssh-keygen -t rsa
Add your key to heroku
bash: heroku keys:add
Read more https://devcenter.heroku.com/articles/keys

Related

Can't access my Heroku repo even though I've added my key

I'm trying to clone a current project from Heroku. I was having permission access issues so I removed existing keys, and added my current key:
$ heroku keys:add
Found an SSH public key at /home/martyn/.ssh/id_rsa.pub
Would you like to upload it to Heroku? [Yn] Y
Uploading SSH public key /home/martyn/.ssh/id_rsa.pub... done
$ heroku keys
=== martynbissett#yahoo.co.uk Keys
ssh-rsa AAAAB3NzaC...5VRkk6UVBT martyn#martyn-Lenovo-B590
$ heroku git:clone -a young-lowlands-8336
Cloning from app 'young-lowlands-8336'...
Cloning into 'young-lowlands-8336'...
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.
I've check the site is live, and it is. From my Heroku control panel I can see that this project is active too. Why am I still being denied?
This is the response I got back from Heroku, and it seems to work now:
It looks like your local SSH is using a different key than the default one.
Could you try resetting your keys identities to the default with the following command:
ssh-add -D

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 ?

Heroku Deployment from multiple win7 64 machines

First of all, I read this question but I still have problems with deploying from multiple machines.
From work everything works like a charm, but from home-machine I have problem pushing to same Heroku app. Both machines are Win7 64, IDE is Rubymine (jumping between integrated git gui and terminal - but no problems with that), Ruby200 and devkit both 32 and 64 (but on separate machines), .ssh keys in C:/users/.ssh/ (on both machines). Git stuff is also working like a charm on both machines. Same heroku acc.
On home machine when I $ heroku keys it lists 2 keys like it should (for work and home machine). Then when I $ git remote add heroku git#heroku.com:my-app.git I get fatal saying that I already have that remote repository on this machine. I check for remotes $ git remote -v and it lists 2 reps (both github and heroku), like it should, but when I $ git push heroku I get:
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 deleting keys, generating new ones both with ssh-keygen -t rsa and heroku keys:add to create after previously removing one and with no luck. Even added it with heroku keys:add C:/path-to-ssh.pub if that specificity even mater.
I know that I can 'cheat' this out with DropBox but I'd rather avoid them and go this way, pulling from Github. Thank you in advance, if more info is needed I will provide it.
Edit: I tried $ heroku create project-with-another-name to create heroku app with same code and it goes through. After I check for that remote via $ git remote -v I don't see it (only old ones), but when I tried to add it with $ git remote add heroku ..., it said to me that remote allready exist and I can see it in Heroku dashboard. $ git push heroku master gives me same error as before.
The problem seems to be an issue with the local git repos on your system, and how they communicate with the remote Heroku repo.
The issue will either be with the ssh keys on your system, or the remote repos your computer will have (and how you're able to communicate with Heroku properly).
--
Fix
After looking at this question, you may wish to use the following:
Really all I had to do was follow these steps:
https://devcenter.heroku.com/articles/keys
First you have to create a key:
ssh-keygen -t rsa
Second you have to add the key to Heroku:
heroku keys:add
--
If that doesn't work, I would get rid of the local git repo & then create a new remote one for use with Heroku:
delete the .git repo for your local app
In the parent / apps directory, run git init [folder_name]
Inside the app folder directly, you can then run git#heroku.com:project.git
Solution:
# Generate key
ssh-keygen -t rsa
# Start of ssh-agent (I missed this step and
# it didn't added key to my machine even though it
# created file. In order to do: ssh-add C:/path/to/id_rsa_key
# I needed to start ssh-agent)
eval $(ssh-agent)
# Then add private key
ssh-add C:/path/to/id_rsa_key
cd C:/project
# And finaly send public key to heroku
heroku keys:add C:/path/to/id_rsa_key.pub

Unable to push ruby on rails master project to heroku windows 8

I have a problem whenever I do git push heroku master, it gives me the following error:
!Invalid path!
Syntax is: git#heroku.com<app>.git where <app> is your app's name
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I have used MSysGit and I created a ruby on rails project, pushed it to github.
then in the project folder I did heroku login, succesfully authenticated. Did heroku create sucessfully, created a RSA keypair, added it to heroku. then I try to push to heroku and it fails everytime, anyone able to help?
The problem is that your SSH key being used is NOT yet uploaded to Heroku. I'm not familiar with your Git client, but what you need to do is find your SSH key file, then run:
heroku keys:add /path/to/my/key.pub
This will upload your public SSH key to Heroku, allowing you to push your repository.

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

Resources