我正在运行使用Phusion Passenger部署的Meteor应用程序,并且最近注意到该应用程序间歇性地死亡并且重新启动时出现问题。它大多数时间都有效,而且我还没有更新它一个月或更长时间。我认为我的设置必须基本正确,否则根本无法正常工作。
这似乎与分块有关,遗憾的是我不知道那是什么或如何调试它。
我试过sudo service nginx restart
,但问题又重演了。
对于乘客日志级别3,我看到了这个错误:
phusion passenger Disconnecting client with error: error parsing app response chunked encoding: unexpected end-of-stream
以下是/var/log/nginx/error.log的示例输出,其乘客日志级别设置为7:
[ D3 2018-03-19 10:53:01.9223 20068/T5 Ser/HttpChunkedBodyParser.h:183 ]: [Client 103] ChunkedBodyParser: parsing new chunk
[ D3 2018-03-19 10:53:01.9223 20068/T5 Ser/HttpChunkedBodyParser.h:123 ]: [Client 103] ChunkedBodyParser: chunk size determined: 78 bytes
[ D3 2018-03-19 10:53:01.9224 20068/T5 Ser/HttpChunkedBodyParser.h:162 ]: [Client 103] ChunkedBodyParser: parsing 78 of 78 bytes of remaining chunk data; 0 now remaining
[ D3 2018-03-19 10:53:01.9224 20068/T5 Ser/FileBufferedChannel.h:1415 ]: [FBC 0xcb62f0] Feeding 78 bytes
[ D3 2018-03-19 10:53:01.9224 20068/T5 Ser/FileBufferedChannel.h:485 ]: [FBC 0xcb62f0] pushBuffer() completed: nbuffers = 1, bytesBuffered = 78
[ D3 2018-03-19 10:53:01.9226 20068/T5 Ser/FileBufferedChannel.h:553 ]: [FBC 0xcb62f0] Reader: reading next
[ D3 2018-03-19 10:53:01.9229 20068/T5 Ser/FileBufferedChannel.h:585 ]: [FBC 0xcb62f0] Reader: found buffer, 78 bytes
[ D3 2018-03-19 10:53:01.9230 20068/T5 Ser/FileBufferedChannel.h:492 ]: [FBC 0xcb62f0] popBuffer() completed: nbuffers = 0, bytesBuffered = 0
[ D3 2018-03-19 10:53:01.9230 20068/T5 Ser/FileBufferedChannel.h:593 ]: [FBC 0xcb62f0] Reader: feeding buffer, 78 bytes
[ D3 2018-03-19 10:53:01.9230 20068/T5 Ser/FileBufferedChannel.h:553 ]: [FBC 0xcb62f0] Reader: reading next
[ D3 2018-03-19 10:53:01.9230 20068/T5 Ser/FileBufferedChannel.h:560 ]: [FBC 0xcb62f0] Reader: no more buffers. Transitioning to RS_INACTIVE
[ D3 2018-03-19 10:53:01.9230 20068/T5 Ser/FileBufferedChannel.h:538 ]: [FBC 0xcb62f0] Calling dataFlushedCallback
[ D3 2018-03-19 10:53:01.9231 20068/T5 age/Cor/Con/ForwardResponse.cpp:64 ]: [Client 1-103] Event: onAppSourceData
[ D3 2018-03-19 10:53:01.9231 20068/T5 age/Cor/Con/ForwardResponse.cpp:206 ]: [Client 1-103] Processing 7 bytes of application data: "\r\n0\r\n\r\n"
[ D3 2018-03-19 10:53:01.9231 20068/T5 Ser/HttpChunkedBodyParser.h:248 ]: [Client 103] ChunkedBodyParser: done parsing a chunk
[ D3 2018-03-19 10:53:01.9231 20068/T5 Ser/HttpChunkedBodyParser.h:183 ]: [Client 103] ChunkedBodyParser: parsing new chunk
[ D3 2018-03-19 10:53:01.9231 20068/T5 Ser/HttpChunkedBodyParser.h:123 ]: [Client 103] ChunkedBodyParser: chunk size determined: 0 bytes
[ D3 2018-03-19 10:53:01.9231 20068/T5 Ser/HttpChunkedBodyParser.h:162 ]: [Client 103] ChunkedBodyParser: parsing 0 of 0 bytes of remaining chunk data; 0 now remaining
[ D3 2018-03-19 10:53:01.9231 20068/T5 Ser/HttpChunkedBodyParser.h:164 ]: [Client 103] ChunkedBodyParser: end chunk detected
[ D3 2018-03-19 10:53:01.9232 20068/T5 Ser/HttpChunkedBodyParser.h:267 ]: [Client 103] ChunkedBodyParser: end chunk reached
[ D2 2018-03-19 10:53:01.9232 20068/T5 age/Cor/Con/ForwardResponse.cpp:224 ]: [Client 1-103] End of application response body reached
[ D2 2018-03-19 10:53:01.9232 20068/T5 age/Cor/Con/ForwardResponse.cpp:1105 ]: [Client 1-103] Not keep-aliving application session connection because application did not allow it
[ D3 2018-03-19 10:53:01.9232 20068/T5 age/Cor/App/Socket.h:191 ]: Socket unix:/tmp/passenger.zqbz84I/apps.s/node.1gvzl3: connection not checked back into connection pool. There are$
[ D2 2018-03-19 10:53:01.9234 20068/T5 age/Cor/App/Gro/SessionManagement.cpp:150 ]: Session closed for process (pid=20096, group=/var/www/myapp/bundle/public)
[ D2 2018-03-19 10:53:01.9235 20068/T5 Ser/HttpServer.h:1185 ]: [Client 1-103] Ending request
[ D3 2018-03-19 10:53:01.9239 20068/T5 Ser/FileBufferedChannel.h:1459 ]: [FBC 0x7f09bc018270] Deinitialize
[ D3 2018-03-19 10:53:01.9240 20068/T5 Ser/FileBufferedChannel.h:1415 ]: [FBC 0xcb62f0] Feeding 0 bytes
[ D3 2018-03-19 10:53:01.9240 20068/T5 Ser/FileBufferedChannel.h:485 ]: [FBC 0xcb62f0] pushBuffer() completed: nbuffers = 1, bytesBuffered = 0
[ D3 2018-03-19 10:53:01.9240 20068/T5 Ser/FileBufferedChannel.h:553 ]: [FBC 0xcb62f0] Reader: reading next
[ D3 2018-03-19 10:53:01.9240 20068/T5 Ser/FileBufferedChannel.h:565 ]: [FBC 0xcb62f0] Reader: EOF encountered. Feeding EOF
[ D3 2018-03-19 10:53:01.9240 20068/T5 Ser/FileBufferedChannel.h:581 ]: [FBC 0xcb62f0] Reader: EOF fed. Transitioning to RS_TERMINATED
[ D3 2018-03-19 10:53:01.9240 20068/T5 Ser/FileBufferedChannel.h:538 ]: [FBC 0xcb62f0] Calling dataFlushedCallback
[ D3 2018-03-19 10:53:01.9241 20068/T5 Ser/HttpServer.h:278 ]: [Client 1-103] Request refcount decreased; it is now 1
[ D3 2018-03-19 10:53:01.9241 20068/T5 Ser/HttpServer.h:286 ]: [Client 1-103] Not keeping alive connection, disconnecting client
我的设置:
乘客5.1.12 / nginx
Server是运行Ubuntu 16.04的Digital Ocean Droplet
使用Meteor 1.6.0.1构建的应用程序
https://www.phusionpassenger.com/library/walkthroughs/deploy/meteor/
我在这台服务器上运行3个应用程序,所有应用程序都使用相同版本的Meteor构建,并在Passenger下运行,没有其他明显问题。
是否有人知道可能导致此问题的原因以及如何解决此问题?