Heroku的部署错误H10(应用程序崩溃)(Heroku deployment error H10

2019-06-21 06:26发布

我有一个RoR的应用我的本地计算机上工作,但是当我把它发送到Heroku的,它崩溃。 错误日志给出错误H10和说:

    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=

编辑:

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

有没有人有这个,并知道什么可能导致这个问题? 我无法找到一个解决方案。

谢谢。

Answer 1:

我碰到了同样的错误之上,应用程序崩溃了Heroku上(运行在dev的罚款),但在Heroku上的错误日志未透露任何线索。 我这个页面上阅读其他答案,并在汗水爆发后看到“重建应用程序。” 我想也许我可以在Heroku的控制台中看到走一走,看一看。 我做了,甚至控制台崩溃,但这次它告诉我为什么。 这是一些不起眼的可变我忘了在早期疑难解答会话小时内删除。 我不是说你会遇到同样的问题,但我发现,当我试图去通过控制台的更多信息。 希望这可以帮助。

$ heroku run rails console


Answer 2:

我也有同样的问题。 日志没有给我任何线索,无论是。 所以,我按比例缩小,并缩减了DYNOS。 这解决了这个问题对我来说:

heroku ps:scale web=0

等了几秒钟......

heroku ps:scale web=1


Answer 3:

$heroku run rails console 

这是因为它会给你在你的终端中的错误,这将是更详细的比你的Heroku日志“应用程序崩溃”的错误是最好的选择。



Answer 4:

$ heroku restart

帮我把我的赛道再次运行。 我是新来的Heroku,但很高兴我现在知道了。



Answer 5:

这发生在我身上时,我是听错误的端口上

我改变了我的听(),以“process.env.PORT”等等:

http.listen((process.env.PORT || 5000), function(){
  console.log('listening on *:5000');
});

代替

http.listen(5000, function(){
  console.log('listening on *:5000');
});


Answer 6:

有同样的问题,今天晚上。 不是一个非常有用的错误,所以我试图在控制台中运行

heroku run rails c

它失败,给了我很多更实用的错误。 我忘了把删除的生产方法调用。 一旦我固定的,应用程序正常工作。



Answer 7:

我推到Git的解决了这个问题:

git add .
git commit -am "some text"
git push

然后推入的Heroku:

git push heroku

然后耙分贝:迁移在Heroku:

heroku run rake db:migrate


Answer 8:

我设法不包括我的.gitignore文件 - >打破的Heroku。 #doh

这里是一个工作的.gitignore文件

/.bundle
/vendor/bundle/
/vendor/ruby/


db/*.sqlite3
/db/*.sqlite3-journal
/log/*
/tmp/*


**.war
*.rbc
*.sassc
.redcar/
.sass-cache
/config/config.yml
/config/database.yml
/coverage.data
/coverage/
/db/*.javadb/
/db/*.sqlite3
/doc/api/
/doc/app/
/doc/features.html
/doc/specs.html
/public/cache
/public/stylesheets/compiled
/public/system/*
/spec/tmp/*
/cache
/capybara*
/capybara-*.html
/gems
/specifications
rerun.txt
pickle-email-*.html
.zeus.sock

**.orig

.DS_Store

/nbproject/

.idea

/*.tmproj

**.swp

.env
.powenv

要创建的.gitignore文件,在终端导航到你的应用程序目录,并使用下面的命令

touch .gitignore

然后你就可以在你的文本编辑器打开它,并把上面的代码到它。



Answer 9:

我得到这个相同的H10应用在Heroku的崩溃错误。 我点击了Heroku的接口“重新启动所有DYNOS”和问题就解决了。



Answer 10:

在我来说,我在我的应用程序中使用ENV变量,但它并没有在Heroku的配置设置。

Heroku的控制台给予适当的错误:

heroku console
`validate_options': Missing required arguments: aws_access_key_id, aws_secret_access_key (ArgumentError)

然后设置ENV配置

heroku config:set AWS_ACCESS_KEY_ID='key'

重新启动的Heroku

heroku restart

有用!!



Answer 11:

如果你见

bash: bin/rails: No such file or directory

在运行时,日志(Heroku的日志-t)命令,如果是的话,请运行

bundle exec rake rails:update

不要覆盖你的文件,到底该命令将创建

  create  bin
  create  bin/bundle
  create  bin/rails
  create  bin/rake

按这些文件的Heroku和你做。



Answer 12:

我面临的问题的根源是由于没有一个数据库。 要解决我第一次出口我的本地数据库中的问题:

$ heroku addons:add heroku-postgresql:dev 
$ heroku addons:add pgbackups
$ PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump 

然后导入到的Heroku:

$ heroku pgbackups:restore DATABASE 'http://site.tld/mydb.dump'

在这些例子中,以取代变量是: mypasswordmyusermydbhttp://site.tld/mydb.dump 。 请注意,我不得不转储上传到一个临时服务器。

解决我的所有问题我写了关于如何恩基部署到Heroku的快速指南, 它可以在这里找到 。



Answer 13:

我得到了同样的上述错误的“应用程序崩溃”和Heroku的应用程序日志中没有显示相关的错误味精原因很多信息。 然后我重新启动在Heroku上的DYNOS,然后在我的设置中index.js文件中的一个显示错误说额外的大括号。 一旦它被删除并重新部署在Heroku上的应用程序的问题得到了解决。

希望这会有所帮助的人面临着同样的问题。



Answer 14:

我有H10与Heroku的和节点由于主代码文件的名称不正确。 编辑package.json

{

  ...

  "main": "correct_file_name.js",

  ...

  "scripts": {
    "start": "node correct_file_name.js"
  }
}

或重命名文件。



Answer 15:

通过答案的整个列表会后,我偶然发现了这个网站: https://status.heroku.com/里面详细介绍了当前的状态/事件对Heroku。 它总是安全撞你的头靠在墙上之前检查出事故。 对我来说,这是上面提到的链接,是造成错误上公布的附加事故报告。



Answer 16:

我有同样的问题,我做了以下

heroku run rails c

它确定了一个控制器允许PARAMS中的语法错误和遗漏逗号。 作为Heroku的日志,上面提到的并没有问题提供足够的信息解决问题。

我还没有看到应用程序崩溃的消息在Heroku之前。



Answer 17:

我今天遇到同样的问题。 我做heroku run rake db:migrate ,虽然我之前迁移的模式,应用程序不会崩溃。



Answer 18:

要非常谨慎的复制和粘贴代码。 有时,当你添加一个块到一个文件,它的格式不正确,并会产生一个错误。

我以前有这个问题,得到这个错误:意外tIDENTIFIER,keyword_end期待



Answer 19:

有同样的问题。 对我来说这是before_action过滤器错误(因为空DB)检查before_action过滤器,也许他们扔unhendled产生的异常。



Answer 20:

当试图在一个子目录中运行Rails,而不是我有这个问题/ 。 例如,我有角/节点/咕嘟咕嘟的应用程序运行在/client和运行Rails应用程序/server ,但他们两人在同一个混帐回购协议,这样我就可以跟踪整个前端和后端的变化。 我得到这个错误尝试将它们部署到Heroku的时候。 对于任何人有这个问题,这里是一个自定义buildpack,将允许在一个子目录中的运转轨道。

https://github.com/aarongray/heroku-buildpack-ruby



Answer 21:

我有同样的问题(同样的错误在Heroku上,本地机器上工作),我试图在这里列出包括所有解决方案heroku run rails console跑没有错误消息。 我试过heroku run rake db:migrateheroku run rake db:migrate:reset几次。 这些都没有解决的问题。 在通过在生产,但不是在开发环境中使用的一些文件去,我发现在puma.rb文件中的一些空白是罪魁祸首。 希望这可以帮助别人谁拥有了同样的问题。 改变,这使得它的工作

  ActiveRecord::Base.establish_connection
  End

  ActiveRecord::Base.establish_connection
end


Answer 22:

我碰到了同样的问题,同时部署到Heroku的(应用程序崩溃)。 日志没有说明这个问题可能是什么。 Heroku的控制台在一个额外的支架的代码显示的语法错误。 出人意料的是,在运行应用程序,我并没有对本地轨的问题,并因此错过了。 校正和混帐推到Heroku上后,应用程序开始在Heroku上工作!



Answer 23:

我从app.set( 'IP_ADDRESS',process.env.IP || '127.0.0.1')更新了我的设置;

app.set( 'IP_ADDRESS',process.env.IP || '0.0.0.0');

这是我改变Openshift托管



Answer 24:

在我的情况下Procfile我所用的是打破一切。 Heroku的查找Procfile和启动应用程序时应用设置-显然我以前没有为督促服务器任何意义dev的设置。 我不得不重命名为Procfile.dev ,一切都开始正常工作。



Answer 25:

我有同样的问题,当我开始在Heroku上使用彪马按他们的向导页,当我评论如下所示的港行这个问题得到解决

# port        ENV['PORT']     || 3000

因此,禁止在puma.rb上面一行的config目录解决问题

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

preload_app!

rackup      DefaultRackup
# port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'production'

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


Answer 26:

如果您使用节点,你可以尝试运行直接在控制台服务命令。 就我而言,我运行的应用程序的角度,所以我尝试:

heroku run npm start

此应用程序启动时给我确切的错误。



文章来源: Heroku deployment error H10 (App crashed)