前提・実現したいこと
DjangoアプリをHerokuにデプロイする
こちらに書かれている内容の通りに一通り実行してみました。
$ git push heroku master
もうまく実行でき
いざ、$heroku open を実行したところ
画面上には
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
と表示されました。
$ heroku logs
$ heroku ps
で確認したところ、下記のように表示がされました。
発生している問題・エラーメッセージ
(venv) Yoshis-mac:myProject Yoshinori$ heroku logs 2018-04-02T05:49:41.357097+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 65, in load 2018-04-02T05:49:41.357100+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp . . . 2018-04-02T05:49:41.654745+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR) 2018-04-02T05:49:41.654747+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> 2018-04-02T05:49:41.767566+00:00 heroku[web.1]: Process exited with status 1 2018-04-02T05:49:41.785374+00:00 heroku[web.1]: State changed from up to crashed 2018-04-02T05:50:08.670379+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=rhubarb-pie-95237.herokuapp.com request_id=6528fd9b-465f-4b5d-8f85-4eb395cbe06d fwd="157.65.124.14" dyno= connect= service= status=503 bytes= protocol=https 2018-04-02T05:50:09.490415+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=rhubarb-pie-95237.herokuapp.com request_id=b0c2d952-a6c7-4e39-afaa-419bbeb09927 fwd="157.65.124.14" dyno= connect= service= status=503 bytes= protocol=https 2018-04-02T06:14:35.000000+00:00 app[api]: Build started by user cookingpapa2578@gmail.com 2018-04-02T06:15:03.167307+00:00 heroku[web.1]: State changed from crashed to starting 2018-04-02T06:15:02.673271+00:00 app[api]: Deploy 5a3816a1 by user cookingpapa2578@gmail.com 2018-04-02T06:14:35.000000+00:00 app[api]: Build succeeded 2018-04-02T06:15:02.673271+00:00 app[api]: Release v9 created by user cookingpapa2578@gmail.com 2018-04-02T06:15:12.058446+00:00 heroku[web.1]: Starting process with command `python ./main.py 14322` 2018-04-02T06:15:15.777426+00:00 heroku[web.1]: Process exited with status 2 2018-04-02T06:15:15.728380+00:00 app[web.1]: python: can't open file './main.py': [Errno 2] No such file or directory 2018-04-02T06:15:15.947626+00:00 heroku[web.1]: State changed from starting to crashed 2018-04-02T06:15:15.949988+00:00 heroku[web.1]: State changed from crashed to starting 2018-04-02T06:15:24.083290+00:00 heroku[web.1]: Starting process with command `python ./main.py 36815` 2018-04-02T06:15:26.725271+00:00 heroku[web.1]: State changed from starting to crashed 2018-04-02T06:15:26.598349+00:00 heroku[web.1]: Process exited with status 2 2018-04-02T06:15:26.519548+00:00 app[web.1]: python: can't open file './main.py': [Errno 2] No such file or directory 2018-04-02T06:15:36.412318+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=rhubarb-pie-95237.herokuapp.com request_id=b3cb09b3-5db1-42db-a96f-960fdd90929f fwd="157.65.124.14" dyno= connect= service= status=503 bytes= protocol=https 2018-04-02T06:15:37.153952+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=rhubarb-pie-95237.herokuapp.com request_id=9f874ee1-2cf3-4361-9165-5d02b7cb5c33 fwd="157.65.124.14" dyno= connect= service= status=503 bytes= protocol=https 2018-04-02T06:16:23.669804+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=rhubarb-pie-95237.herokuapp.com request_id=6d14e0df-67c2-4c53-a239-1ec62cee3ef7 fwd="157.65.124.14" dyno= connect= service= status=503 bytes= protocol=https 2018-04-02T06:16:24.399976+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=rhubarb-pie-95237.herokuapp.com request_id=e9dad4f0-a6a5-4dd0-8b66-db50fd4ca399 fwd="157.65.124.14" dyno= connect= service= status=503 bytes= protocol=https 2018-04-02T06:26:08.884602+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=rhubarb-pie-95237.herokuapp.com request_id=0a700e97-21d9-4b2a-913f-7c43f56c269c fwd="157.65.124.14" dyno= connect= service= status=503 bytes= protocol=https 2018-04-02T06:26:09.670249+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=rhubarb-pie-95237.herokuapp.com request_id=076c3a0a-0a8d-4b9d-9db2-cb946199758b fwd="157.65.124.14" dyno= connect= service= status=503 bytes= protocol=https 2018-04-02T06:41:45.303228+00:00 heroku[web.1]: State changed from crashed to starting 2018-04-02T06:41:53.429328+00:00 heroku[web.1]: Starting process with command `python ./main.py 31254` 2018-04-02T06:41:55.938239+00:00 heroku[web.1]: State changed from starting to crashed 2018-04-02T06:41:55.846930+00:00 heroku[web.1]: Process exited with status 2 2018-04-02T06:41:55.787850+00:00 app[web.1]: python: can't open file './main.py': [Errno 2] No such file or directory 2018-04-02T06:43:07.000000+00:00 app[api]: Build started by user cookingpapa2578@gmail.com 2018-04-02T06:43:36.100775+00:00 app[api]: Deploy e369da41 by user cookingpapa2578@gmail.com 2018-04-02T06:43:36.100775+00:00 app[api]: Release v10 created by user cookingpapa2578@gmail.com 2018-04-02T06:43:36.354054+00:00 heroku[web.1]: State changed from crashed to starting 2018-04-02T06:43:07.000000+00:00 app[api]: Build succeeded 2018-04-02T06:43:43.579876+00:00 heroku[web.1]: Starting process with command `python ./main.py 54325` 2018-04-02T06:43:46.314385+00:00 heroku[web.1]: Process exited with status 2 2018-04-02T06:43:46.347671+00:00 heroku[web.1]: State changed from starting to crashed 2018-04-02T06:43:46.265834+00:00 app[web.1]: python: can't open file './main.py': [Errno 2] No such file or directory (venv) Yoshis-mac:myProject Yoshinori$
試したこと
error code h10の意味は
Heroku Error Codes
Web dynoがクラッシュしていると書いてあります。
同じ内容でerrorを起こしていそうな方の記事をみてみるとProcfileに問題があるのではと思い、内容を変更しましたが、変わりませんでした。
Django: Heroku Failing to launch, at=error code=H10 desc=“App crashed”
guniconeもこちらの記事通りインストールしました。
Deploying Python Applications with Gunicorn
インストールしたあと呼び出せていないということなのでしょうか。
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
Procfile
この一文が原因でしょうか。
Haltserverも調べてみたんですがよくわかりません。
Procfile
web: gunicorn myDjango.wsgi --log-file - web: gunicorn gettingstarted.wsgi web: python ./main.py $PORT
どうぞ宜しくお願いいたします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。