When I create a new Heroku app it gives me
https://obscure-plains-01212.herokuapp.com/
but this URL is not conventional to my app so I change the app name in the Heroku site buzzing-api and then Heroku gives me a new repository
https://git.heroku.com/buzzing-api.git
in stack its shows
Stack heroku-22 will replace Heroku-20 on the next deploy
So I try to re-deploy in my terminal but says
remote: ! No such app as obscure-plains-01212.
how can I add a new repository in the previous Heroku repository to avoid this error
You renamed the heroku app so your heroku repository url is also changed. But most probably you didn't change your heroku remote git url in your local project. Running these 2 commands should do the job:
git remote rm heroku
git remote add heroku https://git.heroku.com/buzzing-api.git
I would like to deploy a Heroku app which will be done ideally using git push -u heroku master. However this will only work if there are any pending commits to be pushed to master.
How can I redeploy the app while there is nothing to push ? I tried git push -u heroku master -f and still get the same below
Branch master set up to track remote branch master from heroku.
Everything up-to-date
PS: I also want to retain the existing app, which means I cannot make use of this answer https://stackoverflow.com/a/22043184/968442
Normally setting a config var causes your application to be restarted. In most situations there should be no need to redeploy after doing this.
If you really do need to trigger a new deployment you can add a new empty commit, then push to Heroku again:
git commit --allow-empty -m "Trigger Heroku deploy after enabling collectstatic"
git push heroku master
The new empty commit is a regular commit. It has a hash, an author, a timestamp, etc. It will have the same tree as its parent. This should cause Heroku to build your app slug again using the same code as the previous commit.
It's a bit awkward, but it works.
You can do it from UI as well!
Login to your Heroku dashboard and go to deploy section
Find Manual deploy option
Hit Deploy Branch button!
Note: you must have your app connected to GitHub for this option to be available (see comment from Derek below).
There is now also a plugin for the Heroku command-line that allows you to re-release the most recently deployed slug.
See https://www.npmjs.com/package/heroku-releases-retry
It turns out there is a neat plugin for Heroku called heroku release retry that lets you retry the last deploy without resorting to adding bad commits to your repository.
// install plugin
heroku plugins:install heroku-releases-retry
// retry release
heroku releases:retry --app {your-app}
Source: https://www.darraghoriordan.com/2019/03/02/heroku-push-failed-force-rebuild
You can run heroku restart --app app_name and you are good to go.
This worked for me, it did an actual build and release without any commit, contrary to one other post that only does a release:
heroku plugins:install heroku-builds
heroku builds:create --source-url https://user:token#api.github.com/repos/<username>/<repo name>/tarball/master/ --app <app-name>
Source: https://help.heroku.com/I3E6QPQN/how-do-i-force-a-new-deploy-without-adding-a-commit-to-my-github-repo
For stop the heroku app uses :
$ heroku ps:scale web=0
And for start it uses :
$ heroku ps:scale web=1
I accidentally added npm start in the heroku post build process so now the build progress is stuck.
I did git push heroku master the build started normal and my server started as it should when running npm start, but because the npm start was in the post build it never finished. Because I'm on free account I only have one concurrent build process and because of the one stuck I can't build new version.
I already tried heroku ps -a APP_NAME and then heroku ps:kill web.1 for the single process that was running, but it didn't help.
ty
Heroku has a CLI Plugin with which you can manage your builds.
heroku builds -a example-app # take note of the build ID you'd want to display
heroku builds:cancel <id> -a example-app
In case anybody reading this might still need it!
I have a node app used only in a scheduler. But heroku keeps trying to call npm start on in.
State changed from starting to crashed
Process exited with status 1
State changed from crashed to starting
Starting process with command `npm start`
Even with a dummy worker in Procfile:
worker: echo 1
There's always a web process added at deploy:
Default types for Node.js -> web
Any ideas on how I could get rid of heroku continuously trying to npm start?
Not really a direct solution, but you could easily scale down your web processes to 0.
heroku ps:scale web=0
i am trying to deploy my application to Heroku, but, after have succesfully created the app, when i run in the shell the command
$ git push heroku master
the process doesn't start and after made me waiting some times it returns:
Initializing repositoryReceived disconnect from 50.19.85.132: 10: user closed connection
fatal: The remote end hung up unexpectedly
How can i solve this issue? I tried many ways but it seems i just can't deploy any app! Thank in advance