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

问题描述 投票:0回答:1

我有一个使用 PostgreSQL 托管在 Heroku 上的旧 Rails 应用程序,我正在努力进入 Heroku-18(我知道 18 的支持生命周期)。

我必须升级 Rails 应用程序才能进入 Heroku 18 之前的设置:Ruby 2.1.2 on Rails 4.1.6 / Heroku 14 进行中的设置:Ruby 2.7.7 on Rails 5.2.2 / Heroku 18

一切都在本地工作,但我在部署 Heroku 后遇到应用程序崩溃问题。

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

我需要找到 H10 错误的原因才能在 Heroku 上启动并运行该应用程序。 我向他们寻求支持,但到目前为止他们没有帮助。

有什么想法可以追踪造成这种情况的原因吗? 理想情况下,我提取的日志比我在这里看到的要多。

我没有设置procfile。

heroku pg:info

看起来不错

heroku run rake db:migrate

作品

heroku pg:psql

连接成功

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

连接超时(来自本地机器,而不是 heroku)

访问网站

应用错误 应用程序发生错误,无法提供您的页面。如果您是应用程序所有者,请检查您的日志以了解详细信息。您可以使用以下命令从 Heroku CLI 执行此操作

heroku logs --tail

ruby-on-rails heroku legacy-code
1个回答
0
投票

我根据 https://devcenter.heroku.com/articles/getting-started-with-rails5 更新了我的网络服务器以使用 Puma

然后加了一个

Procfile

与以下

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

和美洲狮.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

网站已备份

© www.soinside.com 2019 - 2024. All rights reserved.