Failed to deploy application to heroku - heroku

I am newbie into heroku. I was trying to deploy a Django application to heroku by following steps.
Installed vartualenv
Installed Django gunicron via pip
Installed heroku toolbelt
Created an empty git
git add .
git commit -m "First commit"
ssh-keygen
heroku create
heroku keys:add
git push heroku master
And the a error
(venv)han#HEEL:~/Desktop/projects/ossko$ heroku keys:add
Found existing public key: /home/han/.ssh/id_rsa.pub
Uploading SSH public key /home/han/.ssh/id_rsa.pub... done
(venv)han#HEEL:~/Desktop/projects/ossko$ git push heroku master
ssh: connect to host heroku.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have follow every steps from heroku help site.
Please help me to fix this error
I have Ubuntu 13.4 64bit os
Update: here is the result of git remote -v:
$git remote -v
heroku git#heroku.com:infinite-mesa-xxx.git (fetch)
heroku git#heroku.com:infinite-mesa-xxx.git (push)

Try running git remote -v. Does it give you more than one remote, like this?
your_app_name git#heroku.com:your_app_name.git (fetch)
your_app_name git#heroku.com:your_app_name.git (push)
If the remote depot is named something other than 'heroku' you will need to specify the push to that site instead. For example, if your remote is named ossko, try something like
git push ossko master
Often you will have different names for remote depots if you have more than one heroku app - you can use a different name for each app.

Ok, i just solved the problem, This problem is with adding ssh key.
So the correct commands for heroku deploying is
nihan#heel:~$ heroku login
Enter your Heroku credentials.
Email: debashis.dip#gmail.com
Password (typing will be hidden):
Authentication successful.
nihan#heel:~$ cd dev/flask-app
nihan#heel:~/dev/flask-app$ heroku keys:clear
Removing all SSH keys... done
nihan#heel:~/dev/flask-app$ heroku keys:add
Found existing public key: /home/nihan/.ssh/id_rsa.pub
Uploading SSH public key /home/nihan/.ssh/id_rsa.pub... done
nihan#heel:~/dev/flask-app$ ssh-add ~/.ssh/id_rsa <---- This was the missing key
Enter passphrase for /home/nihan/.ssh/id_rsa:
Identity added: /home/nihan/.ssh/id_rsa (/home/nihan/.ssh/id_rsa)
nihan#heel:~/dev/flask-app$ git push heroku master
Because my ssh never knew which key to use it somehow have heroku the wrong information and that's why heroku was denying.

Related

How to push my Heroku app on my personal Github account?

I created an application on Heroku. The application is pushed to my git#heroku.com:[My-project-name].git.
I would like to push this application to my own Github account. How can I do it?
By the way, doing:
git clone git#heroku.com:[My-project-name].git
gives back:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
If you're already signed in to Heroku account. Use the following command instead to clone an existing app to your local machine:
heroku git:clone -a your_app_name
cd your_app_name
This will clone your app on your current working directory, and then navigate to your_app_name. Then you can add your github repo's remote by:
git remote add origin url_to_your_github_repo
And finally run the following command to push the code to github:
git push origin master

Heroku : Username for 'https://git.heroku.com': git

I'm trying to check a git remote on heroku:
$ heroku auth:logout
Local credentials cleared.
$ heroku auth:login
Enter your Heroku credentials.
Email: ***#gmail.com
Password (typing will be hidden):
Authentication successful.
$ git remote
heroku
origin
$ git remote show heroku
Username for 'https://git.heroku.com':
Password for 'https://git.heroku.com':
remote: ! WARNING:
remote: ! Do not authenticate with username and password using git.
remote: ! Run `heroku login` to update your credentials, then retry the git command.
fatal: Authentication failed for 'https://git.heroku.com/***-1909.git/'
This error is referenced in the heroku docs, in the screenshot above at https://devcenter.heroku.com/articles/git , but I'm not sure what to do next to fix this.
This is what worked for me.
$ heroku auth:token
Use the result as the password when prompted.
As the warning says, you just need to do:
heroku login
And it will open your browser for logging in, enter details as per your authentication and you will be good to roll in.
I solve this issue no implicit conversion from nil to integer (TypeError) by it by pushing the updates to heroku and when they asked for the user name I added my email and the password it's in this link https://dashboard.heroku.com/account in API KEYS
Username for 'https://git.heroku.com': your email
Password for 'https://email#git.heroku.com': API KEYS
Run this
heroku login
git add .
git commit -m "..."
git push heroku main
This is going to work
After logged with: heroku login
Some access for example on cloning an existing project in your account, is not
allowed using git native even stay you logged in, and only using git from heroku, such as:
heroku git:[command]
an example clonning a repository:
heroku git:clone -a [app_name]
Otherwise, sometimes, after logged with heroku login, you can check your remote git with: git remote -v
Other way, is you use heroku auth:token and use their output as password, of course, run it after logged.

Don't have access to Heroku app

I have a mystery app in Heroku. It's called weird-app-5536
When I try to push my code to Heroku I get this message:
Your account my_email#geemail.com does not have access to weird-app-5536.
!
! SSH Key Fingerprint: *************************************************
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
When I try...
heroku apps
I get a list of my apps, but it does not include the mystery app, weird-app-5536.
I can't destroy or rename the weird-app-5536 app. It always says I don't have access.
The app does not appear on my list of apps on the Heroku website.
When I type
git remote -v
I get this:
heroku git#heroku.com:weird-app-5536.git (fetch)
heroku git#heroku.com:weird-app-5536.git (push)
origin git#github.com:thisisme/my_code.git (fetch)
origin git#github.com:thisisme/my_code.git (push)
I deleted my old ssh keys. I created a new one and added it to Heroku
I can create new apps and they show up on my list of apps.
As far as I know I only have one Heroku account.
Stumped. I don't know where to go from here.
What's happened is the git repo on which you're working is tied to an old remote. No need to contact heroku or anything... Just remove the heroku git remote and readd it.
Remove by running:
git remote rm heroku
Readd with:
heroku git:remote -a appname
More here: https://devcenter.heroku.com/articles/git
Honestly, I would try to get a hold of Heroku support. It might be possible that you were listed as a contributor to another app by someone but weren't given write access? Heroku support is probably your best bet.

git push heroku master fails in heroku

I am starting out with heroku and am following the getting to start with heroku tutorial. I am on windows 7 and am using Windows powershell as the command line.
The commands that I am using are
git clone git://github.com/heroku/ruby-sample.git
cd ruby-sample
heroku login
heroku create
git push heroku master
heroku open
The directory was cloned and after heroku login I got Authentication successful. in the command line. After heroku create I got
Creating immense-lowlands-8694... done, stack is cedar
http://immense-lowlands-8694.herokuapp.com/ | git#heroku.com:immense-lowlands-8694.git
Git remote heroku added
so the app was added to my heroku account. But there was problem with git push heroku master. I got
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What I have tried so far
This question said about adding keys but it is for Linux and didn't work for Windows 7.
I used heroku keys and it says that there is a key present for my e-mail ID.
As this answer says I tried heroku keys:add and got
this
Found existing public key: C:/Users/Aseem/.ssh/github_rsa.pub
Uploading SSH public key C:/Users/Aseem/.ssh/github_rsa.pub... done
but after that the error didn't end.
I tried what this answer says but ssh-keygen wasn't recognized so I guess it's for linux.
I tried removing using heroku keys:remove KEY_NAME and then heroku login to login again but that didn't take care of the error either.
What can I do to solve the problem?
Installed MSysGit instead of git. Added the C:\Program Files(x86)\Git\bin directory to the PATH variable and then doing what this answer says solved the problem.

How to attach my repo to heroku app

I create a heroku app and then my machine crashed. I have a new machine. How do I attach my existing app to heroku app. When I visit heroku page the url for my app is like this
git#heroku.com:myapp.git
I can't do clone this app because I already have myapp from github. So I need to add heroku as remote to my existing github app. Anyone knows the syntax.
If you've heroku toolbelt:
If you're using the Heroku Toolbelt, the newer syntax is
heroku git:remote -a project
See this for more.
Credits: user101289's solution
Else if you don't have heroku toolbelt:
First do this:
git remote add heroku git#heroku.com:{heroku-app-name}.git
Then do this:
git push heroku master
heroku open
If you're using the Heroku Toolbelt, the newer syntax is
heroku git:remote -a project
See this for more.
If you're using just Git without installing the Heroku Toolbelt, you can also create a new application.
Login to your account and go to this link
https://dashboard.heroku.com/apps
Look at the plus sign on the top right corner then select
Create new app
Leave the application name blank to let heroku choose one for you.
Let say your heroku app name is new-app-xxxxx, so to test on adding a file in to it you may try the following command:
git clone https://git.heroku.com/<new-app-xxxxx>.git
cd <new-app-xxxxx>
echo "my test file" > test.txt
git add .
git commit . -m "my test on commit"
git push
Put empty (blank) when the Git prompt for username, and your API Key for the password. You can get your API Key by showing it from the link below.
https://dashboard.heroku.com/account
Note: You cannot authenticate with the Heroku HTTP Git endpoint using your Heroku username (email) and password. Use an API key as described here.

Resources