Heroku deployment error H10 (App crashed)
Solution 1
I ran into the same error above, app was crashing on heroku (running fine in dev) but error logs on heroku were not revealing any clues. I read other answers on this page and broke out in a sweat after seeing "rebuilding the app." I figured maybe I could get in the heroku console and look around. I did and even the console crashed, but this time it told me why. It was some obscure variable I forgot to delete during a troubleshooting session hours earlier. I am not saying you will run into the same problem, but I found more info when I tried to go through the console. Hope this helps.
$ heroku run rails console
Solution 2
I was having the same issue. Logs weren't giving me any clues either. So I scaled down and scaled back up the dynos. This solved the problem for me:
heroku ps:scale web=0
Waited a few seconds...
heroku ps:scale web=1
Solution 3
$heroku run rails console
This is the best option since it will give you an error in your terminal which will be much more detailed than the 'app crashed' error in your Heroku logs.
Solution 4
$ heroku restart
helped me get my dyno running again. I'm new to Heroku but glad I know now.
Solution 5
this happened to me when I was listening on the wrong port
I changed my listen() to "process.env.PORT" so:
http.listen((process.env.PORT || 5000), function(){
console.log('listening on *:5000');
});
instead of
http.listen(5000, function(){
console.log('listening on *:5000');
});
Related videos on Youtube
bskool
Updated on July 22, 2022Comments
-
bskool almost 2 years
I have a RoR app working on my local computer, but when I send it to heroku, it crashes. The error log gives an error H10 & says:
2012-11-21T15:26:47+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.4.2/lib/new_relic/control/instance_methods.rb:95:in `start_agent' 2012-11-21T15:26:48+00:00 heroku[web.1]: State changed from starting to crashed 2012-11-21T15:26:48+00:00 heroku[web.1]: Process exited with status 1 2012-11-21T15:26:59+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 2012-11-21T15:27:00+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 2012-11-21T15:30:08+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 2012-11-21T15:30:08+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 2012-11-21T15:30:59+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 2012-11-21T15:31:19+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 2012-11-21T15:31:19+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 2012-11-21T15:32:08+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 2012-11-21T15:32:08+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
Edit:
2012-11-22T10:00:58+00:00 app[web.1]: 2012-11-22T10:00:59+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno=web.1 queue=0 wait=0ms connect=1ms service=26ms status=200 bytes=0
Has anyone had this before, and know what might be causing the problem? I cannot find a solution.
Thanks.
-
Rustem over 11 yearsHave same error few months before. Just started new HEROKU app, and it helps. I t looks like you have broken dyno in dyno pool.
-
bskool over 11 yearsUnfortunately this did not resolve my issue.
-
Tom Harrison over 11 yearsIs there anything you need to do to configure New Relic on Heroku, or perhaps in your app? (NewRelic is server and app monitoring software, so it's possible that what you're seeing is NewRelic kicking in to say "App has crashed"). Also, here's another SO post -- see the instructions in an answer.
-
bskool over 11 yearsThanks for the reply tharrison. I still can't seem to move past this issue. Regarding the link you posted I'd like to point out that the Heroku gem is depreciated and have already migrated from SQLite3 to PostgreSQL.
-
ChuckJHardy over 9 yearsTry this: heroku config:add BUILDPACK_URL=github.com/joelcogen/heroku-buildpack-rails-unicorn-nginx
-
max pleaner over 8 yearsThis is so annoying. Especially since it's so difficult to increase the log level to include error traces.
-
Jakob over 2 yearsHad the same H10 error. After inspecting the logs it turned out to be a problem with
whitenoise
and so I worked out this solution. Perhaps it helps someone here as well.
-
-
bskool about 11 yearsI don't see how that would make a difference. But glad it worked for you:)
-
Richlewis about 11 yearsi renamed my app and had this problem, ran heroku run rake db:migrate and it works :)
-
Micah almost 10 yearsThis was a great answer, helped me when the heroku logs lacked details. Thanks.
-
Kamiccolo almost 10 yearsThis does not appear to be an answer. Just a suggestion how to enhance the question. You should use comment section for this purpose.
-
mraaroncruz over 9 yearsJust wanted to say, I had this issue again, googled, found this answer, saw I'd upvoted it, and it solved my problem again. Thanks @user3721026. If you see this comment, please upvote the answer again because I can't :P
-
mraaroncruz over 9 yearsThis is an answer, the correct one actually. But the same as above stackoverflow.com/a/24113266/376680
-
Craig McGuff over 9 yearshad the same sweat when I found this answer, perfect!
-
dlb8685 over 9 yearsI had this same issue in python but stumbled across here instead. The equivalent there is "$ heroku run python manage.py shell" which immediately showed me what was wrong.
-
Steve over 9 years
heroku restart
helped me identify my issue. Mybin
folder was missing. -
Zakaria about 9 yearswhen i do it, i got this error:
/usr/bin/env: ruby2.2: No such file or directory
-
cman77 almost 9 yearsthis!! this was a life saver.
-
James Brown over 8 yearsThis is only because you had something to migrate to heroku db
-
David Meister over 8 yearscopying and pasting code without understanding it is called cargo cult programming and will cause you far more problems than a bit of "formatting"
-
A.D. over 8 yearsAKA "restart" :) Thanks!
-
Jochem Schulenklopper over 8 years
heroku restart
was the solution that worked for me, and I guess (behind the scenes) this is a similar trick. Restarting will be implemented by stopping all dynos and starting them anew. -
Diego Barros about 8 years@steve's comment of
heroku restart
fixed it. That's all it needed for me. -
Edvan Souza about 8 yearsThis really help me. Was a gem incompatible with the server. Thanx man.
-
bartoindahouse almost 8 yearsIts the best answer because it explains what the command does v/s ntimba20 answer that lacks an explanation of what it does.
-
Matthew White about 7 yearsThis did it for me! I was using a different version of Ruby locally and on Heroku, and it was resulting in a
SyntaxError
. Logs didn't give much information, butrails c
did. -
Ahmed Reza Siddique over 6 yearsand you just saved my ass @ntimba20
-
Zack Weiner over 6 yearsFor me the issue was that I created a Model/Table called Mail. This worked fine on local, but caused a Job conflict on Heroku since it thought I was trying to use ActionMailer for this model. Running the heroku console gave me the verbose error that allowed me to pinpoint the root of the H10 App Crashed error
-
Will Tew over 6 yearsI also had the exact same problem. Rails console didn't show any errors. No errors in the logs from the app. Tried restarting via the command line, tried scaling down to 0 and then back up. Nothing worked. The only thing that worked was logging into Heroku and clicking on "restart all dynos" in the dropdown at the top right. Thanks for your help!
-
Brett Bim about 6 yearsAnyone coming to this since the pg gem upgraded to 1.0 should downgrade back to 0.21.0 until Rails supports 1.0. github.com/rails/rails/pull/31671
-
Ronin about 6 years
heroku local
worked for me (runs the heroku project using the heroku cli locally) -
Mauro almost 6 yearsThanks this solved my problem. I finally get the real error superclass mismatch and nothing related to favicon
-
Steve Meisner over 5 yearsIn my case, there was an
uninitialized constant
error on Heroku that wasn't present locally. While I still need to resolve that, I was able to get a working deployment back out. -
uno over 5 yearsin case anyone is reading this going "how would running the console even help???" -- just by running it, it won't work, in turn resulting the error that is preventing the app from working
-
afishintaiwan almost 5 yearsthis is a great tip. i've found that often i get this error when there's an issue with YML syntax. running console helps to identify the offending file.
-
gsumk over 4 yearsthis was caused by simple misspelled authenticate_user!. this helps me to troubleshoot thanks man
-
robe007 over 4 yearsThis happened to me after upgrading to the latest stack (heroku-18). Running this, worked perfectly !
-
inmydelorean over 4 yearsAfter more than an hour of browsing for the possible solution, this command helped me to get the meaningful error log and fix the issue. Thank you!
-
Brandon Bravos almost 4 yearsYou're a life saver
-
Abdullah over 3 yearsThanks @paridhishah