How to resolve H-10 App Crash Error on Heroku?

41 Views Asked by At

I have an old Rails application hosted on Heroku with PostgreSQL that I'm working towards getting onto Heroku-18 (I am aware of the support lifetime on 18).

I had to upgrade the rails application to get onto Heroku 18 Previous setup: Ruby 2.1.2 on Rails 4.1.6 / Heroku 14 Work in progress setup: Ruby 2.7.7 on Rails 5.2.2 / Heroku 18

Everything works locally but I'm having an app crash issue post Heroku deploy.

heroku logs --tail

app\[web.1\]: Exiting heroku\[web.1\]: Process exited with status 1 heroku\[web.1\]: State changed from starting to crashed heroku\[router\]: at=error code=H10 desc="App crashed" method=GET

I need to find the cause of the H10 error to get the app up and running on Heroku. I reached out to their support but so far they have not been helpful.

Any ideas for tracking down what might be causing this? Ideally I pull more logs than what I see here.

I do not have a procfile set up.

heroku pg:info

looks good

heroku run rake db:migrate

works

heroku pg:psql

connects successfully

psql -h <hostname> -p 5432 -d <dbname> --username=<username> -w

Connection timed out (from local machine, not heroku)

Visit website

Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command heroku logs --tail

1

There are 1 best solutions below

0
sb-devora On

I updated my webserver to use Puma per https://devcenter.heroku.com/articles/getting-started-with-rails5

Then added a Procfile

with the following

web: bundle exec puma -C config/puma.rb

and the puma.rb

workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)
threads threads_count, threads_count

preload_app!

rackup      DefaultRackup if defined?(DefaultRackup)
port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'development'

on_worker_boot do
  # Worker specific setup for Rails 4.1+
  # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
  ActiveRecord::Base.establish_connection
end

and the site is back up