Search code examples
herokuheroku-cli

How to kill an heroku build that is in progress?


I accidentally pushed a build that does an npm install in the postinstall script. This has led to my heroku app being stuck in an infinite install loop. I searched the heroku documentation on how to kill builds but came up blank. The closest thing I found was https://help.heroku.com/Z44Q4WW4/how-do-i-stop-a-release-phase and I tried killing as per those instructions but my build won't die :(


Solution

  • The heroku-builds CLI plugin (heroku plugins:install heroku-builds) has a command which will stop a running build:

    $ heroku builds:cancel -a your-app-name
    

    All builds will time out too after a time that can go between 15 minutes to 1 hour.