Heroku日志:致命信号异常:SIGTERM我们很抱歉,但出了点问题。 App在开发中运行良好

时间:2015-09-12 13:38:12

标签: ruby-on-rails ruby heroku

我的应用程序在开发中运行良好,但出于某种原因,我在生产中运行时遇到“我们很抱歉,但出现了问题”错误。只有当我运行这个特定页面时才会这样。请帮我理解服务器关闭的原因。

2015-09-12T13:22:04.223590+00:00 heroku[router]: at=info method=GET path="/findparking?lat=44.6684713&lng=-63.491052100000005&name=My%20Location&rad=0.5" host=www.ugopark.com request_id=f91f3e17-92d5-4a76-b4c9-f1417e4b095e fwd="100.42.240.204" dyno=web.1 connect=1ms service=31ms status=500 bytes=1754
2015-09-12T13:23:27.202566+00:00 heroku[router]: at=info method=GET path="/findparking?lat=44.6684713&lng=-63.491052100000005&name=My%20Location&rad=0.5" host=www.ugopark.com request_id=8b4aa884-2914-4ea2-a926-f099da0acdef fwd="100.42.240.204" dyno=web.1 connect=1ms service=30ms status=500 bytes=1754
2015-09-12T13:24:06.808472+00:00 heroku[web.1]: State changed from up to starting
2015-09-12T13:24:09.002852+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-09-12T13:24:09.540522+00:00 app[web.1]: [2015-09-12 13:24:09] FATAL SignalException: SIGTERM
2015-09-12T13:24:09.540529+00:00 app[web.1]: 	/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2015-09-12T13:24:09.540531+00:00 app[web.1]: 	/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
2015-09-12T13:24:09.540532+00:00 app[web.1]: 	/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2015-09-12T13:24:09.540533+00:00 app[web.1]: 	/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2015-09-12T13:24:09.540535+00:00 app[web.1]: 	/app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:34:in `run'
2015-09-12T13:24:09.540536+00:00 app[web.1]: 	/app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
2015-09-12T13:24:09.540537+00:00 app[web.1]: 	/app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/server.rb:80:in `start'
2015-09-12T13:24:09.540539+00:00 app[web.1]: 	/app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
2015-09-12T13:24:09.540540+00:00 app[web.1]: 	/app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
2015-09-12T13:24:09.540541+00:00 app[web.1]: 	/app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
2015-09-12T13:24:09.540544+00:00 app[web.1]: 	/app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
2015-09-12T13:24:09.540543+00:00 app[web.1]: 	/app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
2015-09-12T13:24:09.540545+00:00 app[web.1]: 	bin/rails:8:in `require'
2015-09-12T13:24:09.540547+00:00 app[web.1]: 	bin/rails:8:in `<main>'
2015-09-12T13:24:09.540553+00:00 app[web.1]: [2015-09-12 13:24:09] INFO  going to shutdown ...
2015-09-12T13:24:09.540573+00:00 app[web.1]: [2015-09-12 13:24:09] INFO  WEBrick::HTTPServer#start done.
2015-09-12T13:24:09.574346+00:00 app[web.1]: => Booting WEBrick
2015-09-12T13:24:09.574352+00:00 app[web.1]: => Rails 4.2.1 application starting in production on http://0.0.0.0:59176
2015-09-12T13:24:09.574353+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-09-12T13:24:09.574354+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-09-12T13:24:09.574356+00:00 app[web.1]: Exiting
2015-09-12T13:24:10.404692+00:00 heroku[web.1]: Process exited with status 143
2015-09-12T13:24:14.787364+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 37527 -e production`
2015-09-12T13:24:23.123953+00:00 app[web.1]: [2015-09-12 13:24:23] INFO  WEBrick 1.3.1
2015-09-12T13:24:23.124568+00:00 app[web.1]: [2015-09-12 13:24:23] INFO  WEBrick::HTTPServer#start: pid=3 port=37527
2015-09-12T13:24:23.124110+00:00 app[web.1]: [2015-09-12 13:24:23] INFO  ruby 2.0.0 (2015-04-13) [x86_64-linux]

1 个答案:

答案 0 :(得分:1)

你来到这里的例外情况与你之前获得的500s无关 您没有看到这些异常的任何堆栈跟踪的原因是因为您的应用程序当前正在将其日志发送到STDOUT时登录到本地文件(这是rails的默认文件),因此heroku记录器可以抓住它们并向你展示。

您可以安装rails_12factor gem,它将配置您的应用程序以将日志发送到STDOUT。完成此操作并重新部署您的应用后,您应该能够看到调用该页面时引发的确切异常。