django - 部署到Heroku:服务器错误(500)

时间:2017-09-09 06:27:33

标签: python django heroku

我正在尝试将我的第一个Django项目部署到Heroku 我的项目使用django渠道因此我需要设置基于 ASGI 的环境。

但是,我收到 500服务器错误,我看不出原因。我已经阅读了我的日志,没有什么突出的。

以下是我的日志。

2017-09-09T05:47:02.000000+00:00 app[api]: Build succeeded
2017-09-09T05:47:25.660750+00:00 heroku[web2.1]: Process exited with status 0
2017-09-09T05:47:25.651941+00:00 app[worker.1]: 2017-09-09 14:47:25,651 - INFO - worker - Shutdown signal received while idle, terminating immediately
2017-09-09T05:47:26.415829+00:00 heroku[worker.1]: Process exited with status 0
2017-09-09T05:47:29.354604+00:00 heroku[worker.1]: Starting process with command `python manage.py runworker`
2017-09-09T05:47:29.450528+00:00 heroku[web.1]: Starting process with command `gunicorn --pythonpath multichat multichat.wsgi --log-file -`
2017-09-09T05:47:29.811901+00:00 heroku[web2.1]: Starting process with command `daphne multichat.asgi:channel_layer --port 34071 --bind 0.0.0.0`
2017-09-09T05:47:29.967498+00:00 heroku[worker.1]: State changed from starting to up
2017-09-09T05:47:30.500574+00:00 heroku[web2.1]: State changed from starting to up
2017-09-09T05:47:31.850448+00:00 app[worker.1]: 2017-09-09 14:47:31,850 - INFO - runworker - Using single-threaded worker.
2017-09-09T05:47:31.850705+00:00 app[worker.1]: 2017-09-09 14:47:31,850 - INFO - runworker - Running worker against channel layer default (asgi_redis.core.RedisChannelLayer)
2017-09-09T05:47:31.850983+00:00 app[worker.1]: 2017-09-09 14:47:31,850 - INFO - worker - Listening on channels chat.receive, http.request, websocket.connect, websocket.disconnect, websocket.receive
2017-09-09T05:47:31.913010+00:00 app[web.1]: [2017-09-09 05:47:31 +0000] [4] [INFO] Starting gunicorn 19.7.1
2017-09-09T05:47:31.913782+00:00 app[web.1]: [2017-09-09 05:47:31 +0000] [4] [INFO] Listening at: http://0.0.0.0:20341 (4)
2017-09-09T05:47:31.913918+00:00 app[web.1]: [2017-09-09 05:47:31 +0000] [4] [INFO] Using worker: sync
2017-09-09T05:47:31.918937+00:00 app[web.1]: [2017-09-09 05:47:31 +0000] [8] [INFO] Booting worker with pid: 8
2017-09-09T05:47:31.946518+00:00 app[web.1]: [2017-09-09 05:47:31 +0000] [9] [INFO] Booting worker with pid: 9
2017-09-09T05:47:32.683202+00:00 app[web2.1]: 2017-09-09 14:47:32,683 INFO     HTTP/2 support not enabled (install the http2 and tls Twisted extras)
2017-09-09T05:47:32.683308+00:00 app[web2.1]: 2017-09-09 14:47:32,683 INFO     Using busy-loop synchronous mode on channel layer
2017-09-09T05:47:32.682463+00:00 app[web2.1]: 2017-09-09 14:47:32,680 INFO     Starting server at tcp:port=34071:interface=0.0.0.0, channel layer multichat.asgi:channel_layer.
2017-09-09T05:47:32.683420+00:00 app[web2.1]: 2017-09-09 14:47:32,683 INFO     Listening on endpoint tcp:port=34071:interface=0.0.0.0
2017-09-09T05:47:33.222235+00:00 heroku[web.1]: State changed from starting to up
2017-09-09T05:47:55.749141+00:00 app[api]: Starting process with command `python manage.py collectstatic --dry-run --noinput` by user juhyun1849@gmail.com
2017-09-09T05:48:02.018451+00:00 heroku[run.7437]: State changed from starting to up
2017-09-09T05:48:01.900426+00:00 heroku[run.7437]: Awaiting client
2017-09-09T05:48:01.962140+00:00 heroku[run.7437]: Starting process with command `python manage.py collectstatic --dry-run --noinput`
2017-09-09T05:48:07.849219+00:00 heroku[run.7437]: Process exited with status 0
2017-09-09T05:48:07.863129+00:00 heroku[run.7437]: State changed from up to complete
2017-09-09T05:47:29+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.04 sample#load-avg-5m=0.085 sample#load-avg-15m=0.09 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11716068kB sample#memory-cached=1049764kB sample#memory-redis=405016bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:48:46.157300+00:00 heroku[router]: at=info method=GET path="/" host=demo-multichat.herokuapp.com request_id=08527fd2-9eed-4688-a19a-ac19b738f34a fwd="61.73.163.81" dyno=web.1 connect=1ms service=148ms status=500 bytes=234 protocol=http
2017-09-09T05:48:46.505174+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=demo-multichat.herokuapp.com request_id=4f621bc3-dc33-4287-b800-f06430ae370a fwd="61.73.163.81" dyno=web.1 connect=1ms service=4ms status=404 bytes=266 protocol=http
2017-09-09T05:48:53.308278+00:00 heroku[router]: at=info method=GET path="/" host=demo-multichat.herokuapp.com request_id=9fd26432-3fb3-492f-a99a-f78ab741e862 fwd="61.73.163.81" dyno=web.1 connect=1ms service=19ms status=500 bytes=234 protocol=http
2017-09-09T05:48:54.802834+00:00 heroku[router]: at=info method=GET path="/" host=demo-multichat.herokuapp.com request_id=b084b3ef-3ea7-4aa7-ae2e-1a7fa755b1ba fwd="61.73.163.81" dyno=web.1 connect=1ms service=74ms status=500 bytes=234 protocol=http
2017-09-09T05:48:23+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.115 sample#load-avg-5m=0.095 sample#load-avg-15m=0.09 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11713836kB sample#memory-cached=1049764kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:49:54.371010+00:00 heroku[router]: at=info method=GET path="/" host=demo-multichat.herokuapp.com request_id=926fca79-c372-4bda-8fe1-7a5b2c89da7d fwd="61.73.163.81" dyno=web.1 connect=0ms service=22ms status=500 bytes=234 protocol=http
2017-09-09T05:50:13+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.135 sample#load-avg-5m=0.1 sample#load-avg-15m=0.095 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11715976kB sample#memory-cached=1049764kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:51:12+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.095 sample#load-avg-5m=0.095 sample#load-avg-15m=0.09 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11714448kB sample#memory-cached=1049772kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:52:07+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.075 sample#load-avg-5m=0.09 sample#load-avg-15m=0.09 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11714544kB sample#memory-cached=1049776kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:53:03+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.055 sample#load-avg-5m=0.08 sample#load-avg-15m=0.085 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11714356kB sample#memory-cached=1049780kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:54:01+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.04 sample#load-avg-5m=0.075 sample#load-avg-15m=0.085 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11715828kB sample#memory-cached=1049780kB sample#memory-redis=323112bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:54:37.905720+00:00 heroku[router]: at=info method=GET path="/" host=demo-multichat.herokuapp.com request_id=ef858ecc-5c6d-4428-8c0e-24577f0ede00 fwd="61.73.163.81" dyno=web.1 connect=1ms service=19ms status=500 bytes=234 protocol=http
2017-09-09T05:54:56+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.055 sample#load-avg-5m=0.065 sample#load-avg-15m=0.08 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11714440kB sample#memory-cached=1049780kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:55:50+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.05 sample#load-avg-5m=0.06 sample#load-avg-15m=0.075 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11715108kB sample#memory-cached=1049784kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:56:48+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.125 sample#load-avg-5m=0.085 sample#load-avg-15m=0.085 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11714820kB sample#memory-cached=1049788kB sample#memory-redis=323112bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:57:45+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.07 sample#load-avg-5m=0.075 sample#load-avg-15m=0.08 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11711676kB sample#memory-cached=1050052kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:58:38+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.045 sample#load-avg-5m=0.07 sample#load-avg-15m=0.08 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11712784kB sample#memory-cached=1050168kB sample#memory-redis=323112bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T05:59:35+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.045 sample#load-avg-5m=0.065 sample#load-avg-15m=0.075 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11712040kB sample#memory-cached=1050176kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:00:32+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.05 sample#load-avg-5m=0.06 sample#load-avg-15m=0.075 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11712164kB sample#memory-cached=1050176kB sample#memory-redis=323112bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:02:22+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.035 sample#load-avg-5m=0.055 sample#load-avg-15m=0.07 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11712116kB sample#memory-cached=1050176kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:03:22+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.01 sample#load-avg-5m=0.04 sample#load-avg-15m=0.065 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11709044kB sample#memory-cached=1050464kB sample#memory-redis=322984bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:04:17+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.05 sample#load-avg-5m=0.05 sample#load-avg-15m=0.065 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11706756kB sample#memory-cached=1050580kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:05:16+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.095 sample#load-avg-5m=0.06 sample#load-avg-15m=0.065 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11707916kB sample#memory-cached=1050580kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:06:07+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.14 sample#load-avg-5m=0.075 sample#load-avg-15m=0.07 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11708984kB sample#memory-cached=1050584kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:06:58+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.05 sample#load-avg-5m=0.06 sample#load-avg-15m=0.065 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11707924kB sample#memory-cached=1050592kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:07:40.000000+00:00 app[api]: Build started by user juhyun1849@gmail.com
2017-09-09T06:08:06.135198+00:00 app[api]: Deploy 5b023df6 by user juhyun1849@gmail.com
2017-09-09T06:08:06.135198+00:00 app[api]: Release v35 created by user juhyun1849@gmail.com
2017-09-09T06:07:40.000000+00:00 app[api]: Build succeeded
2017-09-09T06:08:06.811985+00:00 heroku[web.1]: Restarting
2017-09-09T06:08:06.812731+00:00 heroku[web.1]: State changed from up to starting
2017-09-09T06:08:06.854039+00:00 heroku[web2.1]: Restarting
2017-09-09T06:08:06.854567+00:00 heroku[web2.1]: State changed from up to starting
2017-09-09T06:08:06.865755+00:00 heroku[worker.1]: Restarting
2017-09-09T06:08:06.866509+00:00 heroku[worker.1]: State changed from up to starting
2017-09-09T06:08:07.643387+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2017-09-09T06:08:07.725441+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-09-09T06:08:07.658986+00:00 app[worker.1]: 2017-09-09 15:08:07,658 - INFO - worker - Shutdown signal received while idle, terminating immediately
2017-09-09T06:08:07.738464+00:00 heroku[web2.1]: Stopping all processes with SIGTERM
2017-09-09T06:08:07.738614+00:00 app[web.1]: [2017-09-09 15:08:07 +0900] [9] [INFO] Worker exiting (pid: 9)
2017-09-09T06:08:07.738900+00:00 app[web.1]: [2017-09-09 15:08:07 +0900] [8] [INFO] Worker exiting (pid: 8)
2017-09-09T06:08:07.769524+00:00 app[web.1]: [2017-09-09 06:08:07 +0000] [4] [INFO] Handling signal: term
2017-09-09T06:08:07.870406+00:00 app[web.1]: [2017-09-09 06:08:07 +0000] [4] [INFO] Shutting down: Master
2017-09-09T06:08:07.909260+00:00 heroku[worker.1]: Process exited with status 0
2017-09-09T06:08:08.007868+00:00 heroku[web.1]: Process exited with status 0
2017-09-09T06:08:08.271926+00:00 heroku[web2.1]: Process exited with status 0
2017-09-09T06:08:11.353622+00:00 heroku[web2.1]: Starting process with command `daphne multichat.asgi:channel_layer --port 58464 --bind 0.0.0.0`
2017-09-09T06:08:11.403802+00:00 heroku[worker.1]: Starting process with command `python manage.py runworker`
2017-09-09T06:08:11.901676+00:00 heroku[web.1]: Starting process with command `gunicorn --pythonpath multichat multichat.wsgi --log-file -`
2017-09-09T06:08:11.929088+00:00 heroku[web2.1]: State changed from starting to up
2017-09-09T06:08:12.126770+00:00 heroku[worker.1]: State changed from starting to up
2017-09-09T06:08:13.763354+00:00 app[web2.1]: 2017-09-09 15:08:13,763 INFO     Starting server at tcp:port=58464:interface=0.0.0.0, channel layer multichat.asgi:channel_layer.
2017-09-09T06:08:13.764095+00:00 app[web2.1]: 2017-09-09 15:08:13,763 INFO     HTTP/2 support enabled
2017-09-09T06:08:13.764210+00:00 app[web2.1]: 2017-09-09 15:08:13,764 INFO     Using busy-loop synchronous mode on channel layer
2017-09-09T06:08:13.764336+00:00 app[web2.1]: 2017-09-09 15:08:13,764 INFO     Listening on endpoint tcp:port=58464:interface=0.0.0.0
2017-09-09T06:08:14.328069+00:00 app[web.1]: [2017-09-09 06:08:14 +0000] [4] [INFO] Starting gunicorn 19.7.1
2017-09-09T06:08:14.328930+00:00 app[web.1]: [2017-09-09 06:08:14 +0000] [4] [INFO] Listening at: http://0.0.0.0:56981 (4)
2017-09-09T06:08:14.333353+00:00 app[web.1]: [2017-09-09 06:08:14 +0000] [8] [INFO] Booting worker with pid: 8
2017-09-09T06:08:14.329051+00:00 app[web.1]: [2017-09-09 06:08:14 +0000] [4] [INFO] Using worker: sync
2017-09-09T06:08:14.427254+00:00 app[web.1]: [2017-09-09 06:08:14 +0000] [10] [INFO] Booting worker with pid: 10
2017-09-09T06:08:14.379386+00:00 app[worker.1]: 2017-09-09 15:08:14,379 - INFO - runworker - Running worker against channel layer default (asgi_redis.core.RedisChannelLayer)
2017-09-09T06:08:14.379140+00:00 app[worker.1]: 2017-09-09 15:08:14,378 - INFO - runworker - Using single-threaded worker.
2017-09-09T06:08:14.379644+00:00 app[worker.1]: 2017-09-09 15:08:14,379 - INFO - worker - Listening on channels chat.receive, http.request, websocket.connect, websocket.disconnect, websocket.receive
2017-09-09T06:08:15.692631+00:00 heroku[web.1]: State changed from starting to up
2017-09-09T06:07:48+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.095 sample#load-avg-5m=0.07 sample#load-avg-15m=0.065 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11708968kB sample#memory-cached=1050600kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:08:37.592918+00:00 heroku[router]: at=info method=GET path="/" host=demo-multichat.herokuapp.com request_id=6d01047d-767e-4eeb-b8be-dcc89fc6bd60 fwd="61.73.163.81" dyno=web.1 connect=0ms service=167ms status=500 bytes=234 protocol=http
2017-09-09T06:08:39+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.035 sample#load-avg-5m=0.055 sample#load-avg-15m=0.06 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11709204kB sample#memory-cached=1050600kB sample#memory-redis=364064bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:10:26+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.085 sample#load-avg-5m=0.065 sample#load-avg-15m=0.065 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11707560kB sample#memory-cached=1050600kB sample#memory-redis=323112bytes sample#hit-rate=0.6 sample#evicted-keys=0
2017-09-09T06:11:24+00:00 app[heroku-redis]: source=REDIS sample#active-connections=3 sample#load-avg-1m=0.15 sample#load-avg-5m=0.085 sample#load-avg-15m=0.07 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664264kB sample#memory-free=11710036kB 

我在日志中找不到任何值得注意的严重错误 以下是我的Procfile设置。

web: gunicorn --pythonpath multichat multichat.wsgi --log-file -
web2: daphne multichat.asgi:channel_layer --port $PORT --bind 0.0.0.0
worker: python manage.py runworker

为什么我收到500服务器错误?你能帮帮我吗? 我也留下了我的github存储库URL。

repo

1 个答案:

答案 0 :(得分:1)

看起来很明显,但您是否在gunicorn文件中添加了requirements.txt