当日志中没有错误消息时,如何诊断Heroku上的500错误?

时间:2021-05-05 09:51:09

I have a Rails app on Heroku that is serving 500 errors at random intervals. Web pages will display "Internal server error" in plain text, instead of the usual "We're sorry. Something went wrong." page. When I refresh the page, it works fine.

我在Heroku上有一个Rails应用程序,它以随机间隔提供500个错误。网页将以纯文本显示“内部服务器错误”,而不是通常的“我们很抱歉。出了问题。”页。当我刷新页面时,它工作正常。

The logs don't show me an error message, just

日志不会显示错误消息

» 14:20:34.107 2013-10-11 12:20:33.763690+00:00 heroku router - - at=info method=HEAD path=/ host=www.mydomain.com fwd="184.73.237.85/ec2-184-73-237-85.compute-1.amazonaws.com" dyno=web.1 connect=1ms service=63ms status=200 bytes=0
» 14:21:03.957 2013-10-11 12:21:03.561867+00:00 heroku router - - at=info method=GET path=/ host=www.mydomain.com fwd="50.112.95.211/ec2-50-112-95-211.us-west-2.compute.amazonaws.com" dyno=web.1 connect=0ms service=1ms status=500 bytes=21

Support has told me to look at request queuing in New Relic, but New Relic only shows a big red mark saying the server is down (even though the site works fine when refreshed).

支持告诉我要查看New Relic中的请求排队,但New Relic只显示一个大的红色标记,表示服务器已关闭(即使网站在刷新时工作正常)。

With no error messages, I'm at a loss for how to diagnose this issue.

没有错误消息,我对如何诊断此问题感到茫然。

2 个解决方案

#1


14  

In Heroku, I diagnose errors with LogEntries -- its far easier than the Heroku logs to diagnose errors.

在Heroku中,我使用LogEntries诊断错误 - 它比Heroku日志更容易诊断错误。

What I do is load up the app, and in the LogEntries panel, go to "Live (Beta)". This shows any errors which appear, and are generally very explanatory

我所做的是加载应用程序,在LogEntries面板中,转到“Live(Beta)”。这显示出现的任何错误,并且通常非常明确

Just something that might help

只是可能有所帮助的东西

#2


33  

Try adding the rails_12factor gem to get a more robust error log ( only if you're using Heroku ).

尝试添加rails_12factor gem以获得更强大的错误日志(仅当您使用Heroku时)。

Make sure you rake db:migrate your databased on Heroku with heroku run rake db:migrate

确保你使用heroku run rake db:migrate来rake db:在Heroku上迁移你的数据库

#1


14  

In Heroku, I diagnose errors with LogEntries -- its far easier than the Heroku logs to diagnose errors.

在Heroku中,我使用LogEntries诊断错误 - 它比Heroku日志更容易诊断错误。

What I do is load up the app, and in the LogEntries panel, go to "Live (Beta)". This shows any errors which appear, and are generally very explanatory

我所做的是加载应用程序,在LogEntries面板中,转到“Live(Beta)”。这显示出现的任何错误,并且通常非常明确

Just something that might help

只是可能有所帮助的东西

#2


33  

Try adding the rails_12factor gem to get a more robust error log ( only if you're using Heroku ).

尝试添加rails_12factor gem以获得更强大的错误日志(仅当您使用Heroku时)。

Make sure you rake db:migrate your databased on Heroku with heroku run rake db:migrate

确保你使用heroku run rake db:migrate来rake db:在Heroku上迁移你的数据库