我在heroku上运行了带有gunicorn的django应用程序。我的heroku日志文件中的这个错误是什么意思?

时间:2012-01-10 21:06:30

标签: django heroku gunicorn

我正试图在heroku上使用我的django应用程序使用gunicorn。我按照这里的说明进行操作:http://devcenter.heroku.com/articles/django#using_a_different_wsgi_server。似乎gunicorn正在奔跑,因为日志表明它。但是,我不喜欢在我的日志文件中看到我不理解的错误消息,并且在查看日志时我看到“Error R12(退出超时) - >行程未能在10秒内退出SIGTERM“然后”用SIGKILL停止进程“。我的应用程序似乎在预期的URL上正常运行,所以这不是紧急情况,但我只是好奇发生了什么。感谢。

2012-01-10T20:56:36+00:00 heroku[web.1]: State changed from up to bouncing
2012-01-10T20:56:36+00:00 heroku[web.1]: State changed from bouncing to created
2012-01-10T20:56:36+00:00 heroku[web.1]: State changed from created to starting
2012-01-10T20:56:39+00:00 heroku[web.1]: Stopping process with SIGTERM
2012-01-10T20:56:39+00:00 heroku[web.1]: Starting process with command `python blossom/manage.py run_gunicorn -b "0.0.0.0:27470" -w 3`
2012-01-10T20:56:40+00:00 app[web.1]: Validating models...
2012-01-10T20:56:40+00:00 app[web.1]: Django version 1.3.1, using settings 'blossom.settings'
2012-01-10T20:56:40+00:00 app[web.1]: 
2012-01-10T20:56:40+00:00 app[web.1]: Server is running
2012-01-10T20:56:40+00:00 app[web.1]: 0 errors found
2012-01-10T20:56:40+00:00 app[web.1]: Quit the server with CONTROL-C.
2012-01-10T20:56:40+00:00 app[web.1]: 2012-01-10 15:56:40 [3] [INFO] Starting gunicorn 0.13.4
2012-01-10T20:56:40+00:00 app[web.1]: 2012-01-10 15:56:40 [3] [INFO] Listening at: http://0.0.0.0:27470 (3)
2012-01-10T20:56:40+00:00 app[web.1]: 2012-01-10 15:56:40 [3] [INFO] Using worker: sync
2012-01-10T20:56:40+00:00 app[web.1]: 2012-01-10 15:56:40 [6] [INFO] Booting worker with pid: 6
2012-01-10T20:56:40+00:00 app[web.1]: 2012-01-10 15:56:40 [7] [INFO] Booting worker with pid: 7
2012-01-10T20:56:40+00:00 app[web.1]: 2012-01-10 15:56:40 [8] [INFO] Booting worker with pid: 8  
2012-01-10T20:56:41+00:00 heroku[web.1]: State changed from starting to up
2012-01-10T20:56:48+00:00 heroku[web.1]: Error R12 (Exit timeout) -> Process failed to exit within 10 seconds of SIGTERM
2012-01-10T20:56:48+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-01-10T20:56:50+00:00 heroku[web.1]: Process exited

2 个答案:

答案 0 :(得分:3)

基本上它在锡上说的是什么。在Heroku堆栈中,进程总是以SIGTERM终止,该进程告诉进程正常关闭,并给它10秒钟。

如果这在10秒内没有终止,那么你会得到一个R12错误和一个SIGKILL,这实际上是一个杀戮。

现在,为什么在这里发生这种情况并不完全清楚,因为日志不能回溯得足够多,但你可以看到SIGTERM发生在20:56:39

答案 1 :(得分:0)

没有足够的日志来确定您的问题(错误R12可能意味着很多事情)。而且为了记录,我没有运行Gunicorn。也就是说,我遇到了类似的问题。

如果项目中的其他任何地方没有该模块的模块,那么雪松堆栈不喜欢你在settings.py的INSTALLED_APPS部分提及应用程序。

我甚至在开始在views.py中编写代码之前将我的应用程序编码为INSTALLED_APPS,并且本地DJANGO服务器没有抱怨,所以我习惯这样做。不幸的是,它破坏了雪松堆栈。

当我注释掉项目中其他地方没有模块的应用程序并推出新版本时,它立即开始工作。