自从我将我的应用程序( Rails)部署到heroku之后,在过去的几天里,我一直在打开这个错误&关机。
2019-09-22T15:35:11.196499+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=myapp.herokuapp.com request_id=82376036-bcc3-4f63-8019-1b206e534947 fwd="60.114.58.106" dyno=web.1 connect=1ms service=908ms status=503 bytes=0 protocol=https
2019-09-22T15:35:11.252159+00:00 heroku[web.1]: Process exited with status 134我试着执行以下命令,但无法解决错误。
$heroku container:rm web
$heroku container:push web
$heroku container:release web我想知道如何解决H13错误。
谢谢。
发布于 2019-09-22 22:39:47
由于我不知道你的确切情况,所以我有几个想法:
如果您的服务器(例如,Unicorn)工作超时设置为小于30秒,则可以尝试将其提高到更高的值(但Heroku将其限制为30 explicitly).
发布于 2019-09-23 07:48:28
H13 -没有响应的连接已关闭
当您的web dyno中的进程接受连接,但随后关闭套接字而不向其写入任何内容时,将引发此错误。
这可能会发生的一个例子是,当一个Unicorn web服务器配置的超时时间小于30,并且在超时发生之前,工作人员还没有处理一个请求。在这种情况下,Unicorn会在写入任何数据之前关闭连接,从而导致H13。
有几个排队,您有一个错误的进程超时后,比如说15s:
ERROR -- : worker=1 PID:8 timeout (16s > 15s), killingHeroku help有一个关于超时设置的部分:
在Unicorn中,可以在config/unicorn.rb中设置一个超时,如下所示:
timeout 15计时器将在Unicorn开始处理请求时开始,如果15秒过去,主进程将向工作人员发送一个SIGKILL,但不会引发任何异常。
附注:如果您在一个请求中超出了错误,那么您可以尝试以下步骤-
-> push the API call to background job
-> submit the form as ajax
-> In the action which handle submit, trigger the background job and render the job_id , the path to which need to be redirected and other parameter you want to reuse
-> On success of ajax request, trigger another ajax call to a separate method which keep checking the status of the job after a fix interval say 3 seconds.
-> when the second ajax call see that status is complete, it will reload the pagehttps://stackoverflow.com/questions/58050862
复制相似问题