Heroku deployment error H10 (App crashed)

190,702

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');
});
Share:
190,702

Related videos on Youtube

bskool
Author by

bskool

Updated on July 22, 2022

Comments

  • bskool
    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
      Rustem over 11 years
      Have 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
      bskool over 11 years
      Unfortunately this did not resolve my issue.
    • Tom Harrison
      Tom Harrison over 11 years
      Is 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
      bskool over 11 years
      Thanks 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
      ChuckJHardy over 9 years
      Try this: heroku config:add BUILDPACK_URL=github.com/joelcogen/heroku-buildpack-rails-un‌​icorn-nginx
    • max pleaner
      max pleaner over 8 years
      This is so annoying. Especially since it's so difficult to increase the log level to include error traces.
    • Jakob
      Jakob over 2 years
      Had 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
    bskool about 11 years
    I don't see how that would make a difference. But glad it worked for you:)
  • Richlewis
    Richlewis about 11 years
    i renamed my app and had this problem, ran heroku run rake db:migrate and it works :)
  • Micah
    Micah almost 10 years
    This was a great answer, helped me when the heroku logs lacked details. Thanks.
  • Kamiccolo
    Kamiccolo almost 10 years
    This does not appear to be an answer. Just a suggestion how to enhance the question. You should use comment section for this purpose.
  • mraaroncruz
    mraaroncruz over 9 years
    Just 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
    mraaroncruz over 9 years
    This is an answer, the correct one actually. But the same as above stackoverflow.com/a/24113266/376680
  • Craig McGuff
    Craig McGuff over 9 years
    had the same sweat when I found this answer, perfect!
  • dlb8685
    dlb8685 over 9 years
    I 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
    Steve over 9 years
    heroku restart helped me identify my issue. My bin folder was missing.
  • Zakaria
    Zakaria about 9 years
    when i do it, i got this error: /usr/bin/env: ruby2.2: No such file or directory
  • cman77
    cman77 almost 9 years
    this!! this was a life saver.
  • James Brown
    James Brown over 8 years
    This is only because you had something to migrate to heroku db
  • David Meister
    David Meister over 8 years
    copying 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.
    A.D. over 8 years
    AKA "restart" :) Thanks!
  • Jochem Schulenklopper
    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
    Diego Barros about 8 years
    @steve's comment of heroku restart fixed it. That's all it needed for me.
  • Edvan Souza
    Edvan Souza about 8 years
    This really help me. Was a gem incompatible with the server. Thanx man.
  • bartoindahouse
    bartoindahouse almost 8 years
    Its the best answer because it explains what the command does v/s ntimba20 answer that lacks an explanation of what it does.
  • Matthew White
    Matthew White about 7 years
    This 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, but rails c did.
  • Ahmed Reza Siddique
    Ahmed Reza Siddique over 6 years
    and you just saved my ass @ntimba20
  • Zack Weiner
    Zack Weiner over 6 years
    For 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
    Will Tew over 6 years
    I 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
    Brett Bim about 6 years
    Anyone 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
    Ronin about 6 years
    heroku local worked for me (runs the heroku project using the heroku cli locally)
  • Mauro
    Mauro almost 6 years
    Thanks this solved my problem. I finally get the real error superclass mismatch and nothing related to favicon
  • Steve Meisner
    Steve Meisner over 5 years
    In 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
    uno over 5 years
    in 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
    afishintaiwan almost 5 years
    this 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
    gsumk over 4 years
    this was caused by simple misspelled authenticate_user!. this helps me to troubleshoot thanks man
  • robe007
    robe007 over 4 years
    This happened to me after upgrading to the latest stack (heroku-18). Running this, worked perfectly !
  • inmydelorean
    inmydelorean over 4 years
    After 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
    Brandon Bravos almost 4 years
    You're a life saver
  • Abdullah
    Abdullah over 3 years
    Thanks @paridhishah