![退会済みユーザー](https://ddjkaamml8q8x.cloudfront.net/profileImages/deletedUser/icnUserSample.jpeg)
こちらの記事を参考に
https://qiita.com/syachihoko/items/15b482505c588c4d163a
Vagrant内にvirtualenvをインストールし、
その中で初歩的なflaskアプリを作成しherokuにアップした所
Application errorが発生。
ポート変更前はローカルで問題なく表示されておりました。
知見のある方、ご意見をいただければ幸いです。
Procfile
1web: gunicorn app:app
#requirements.txt click==6.7 Flask==1.0.2 gem==0.1.12 gunicorn==19.9.0 itsdangerous==0.24 Jinja2==2.10 MarkupSafe==1.0 six==1.11.0 Werkzeug==0.14.1
python
1#app.py 2import os 3from flasknote3 import app 4 5app.run(host='0.0.0.0', port=int(os.environ.get("PORT", 5000)))
python
1#flasknote3/__init__.py 2 3from flask import Flask 4 5app = Flask(__name__) 6 7import flasknote3.views 8
python
1#flasknote3/views.py 2from flask import render_template, url_for 3from flasknote3 import app 4 5@app.route('/') 6def greeting(): 7 return render_template('index.html', message='Hello world!')
log
1Heroku logs --tail 2 3 42018-09-13T08:17:07.789318+00:00 app[web.1]: OSError: [Errno 98] Address already in use 52018-09-13T08:17:07.789728+00:00 app[web.1]: [2018-09-13 08:17:07 +0000] [8] [ERROR] Exception in worker process 62018-09-13T08:17:07.789731+00:00 app[web.1]: Traceback (most recent call last): 72018-09-13T08:17:07.789758+00:00 app[web.1]: File "/app/app.py", line 4, in <module> 82018-09-13T08:17:07.789759+00:00 app[web.1]: app.run(host='0.0.0.0', port=int(os.environ.get("PORT", 5000))) 92018-09-13T08:17:07.789761+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 943, in run 102018-09-13T08:17:07.789763+00:00 app[web.1]: run_simple(host, port, self, **options) 112018-09-13T08:17:07.789767+00:00 app[web.1]: inner() 122018-09-13T08:17:07.789765+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/werkzeug/serving.py", line 814, in run_simple 132018-09-13T08:17:07.789768+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/werkzeug/serving.py", line 774, in inner 142018-09-13T08:17:07.789770+00:00 app[web.1]: fd=fd) 152018-09-13T08:17:07.789772+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/werkzeug/serving.py", line 660, in make_server 162018-09-13T08:17:07.789773+00:00 app[web.1]: passthrough_errors, ssl_context, fd=fd) 172018-09-13T08:17:07.789775+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/werkzeug/serving.py", line 577, in __init__ 182018-09-13T08:17:07.789777+00:00 app[web.1]: self.address_family), handler) 192018-09-13T08:17:07.789779+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/socketserver.py", line 453, in __init__ 202018-09-13T08:17:07.789780+00:00 app[web.1]: self.server_bind() 212018-09-13T08:17:07.789782+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/http/server.py", line 136, in server_bind 222018-09-13T08:17:07.789784+00:00 app[web.1]: socketserver.TCPServer.server_bind(self) 232018-09-13T08:17:07.789786+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/socketserver.py", line 467, in server_bind 242018-09-13T08:17:07.789787+00:00 app[web.1]: self.socket.bind(self.server_address) 252018-09-13T08:17:07.789828+00:00 app[web.1]: OSError: [Errno 98] Address already in use 262018-09-13T08:17:07.790309+00:00 app[web.1]: [2018-09-13 08:17:07 +0000] [9] [INFO] Worker exiting (pid: 9) 272018-09-13T08:17:07.790602+00:00 app[web.1]: [2018-09-13 08:17:07 +0000] [8] [INFO] Worker exiting (pid: 8) 282018-09-13T08:17:07.857721+00:00 app[web.1]: Traceback (most recent call last): 292018-09-13T08:17:07.858127+00:00 app[web.1]: self.sleep() 302018-09-13T08:17:07.858130+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 360, in sleep 312018-09-13T08:17:07.858511+00:00 app[web.1]: ready = select.select([self.PIPE[0]], [], [], 1.0) 322018-09-13T08:17:07.858514+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 245, in handle_chld 332018-09-13T08:17:07.858756+00:00 app[web.1]: self.reap_workers() 342018-09-13T08:17:07.857731+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 210, in run 352018-09-13T08:17:07.858762+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers 362018-09-13T08:17:07.859156+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR) 372018-09-13T08:17:07.859210+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> 382018-09-13T08:17:07.859212+00:00 app[web.1]: 392018-09-13T08:17:07.859214+00:00 app[web.1]: During handling of the above exception, another exception occurred: 402018-09-13T08:17:07.859216+00:00 app[web.1]: 412018-09-13T08:17:07.859235+00:00 app[web.1]: Traceback (most recent call last): 422018-09-13T08:17:07.859240+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module> 432018-09-13T08:17:07.859415+00:00 app[web.1]: sys.exit(run()) 442018-09-13T08:17:07.859417+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 61, in run 452018-09-13T08:17:07.859603+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() 462018-09-13T08:17:07.859606+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 223, in run 472018-09-13T08:17:07.859839+00:00 app[web.1]: super(Application, self).run() 482018-09-13T08:17:07.859878+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run 492018-09-13T08:17:07.860068+00:00 app[web.1]: Arbiter(self).run() 502018-09-13T08:17:07.860106+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 232, in run 512018-09-13T08:17:07.860387+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 345, in halt 522018-09-13T08:17:07.860351+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status) 532018-09-13T08:17:07.860700+00:00 app[web.1]: self.stop() 542018-09-13T08:17:07.860741+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 390, in stop 552018-09-13T08:17:07.861083+00:00 app[web.1]: self.kill_workers(sig) 562018-09-13T08:17:07.861120+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 626, in kill_workers 572018-09-13T08:17:07.861577+00:00 app[web.1]: self.kill_worker(pid, sig) 582018-09-13T08:17:07.861615+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 636, in kill_worker 592018-09-13T08:17:07.862076+00:00 app[web.1]: os.kill(pid, sig) 602018-09-13T08:17:07.862114+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 245, in handle_chld 612018-09-13T08:17:07.862396+00:00 app[web.1]: self.reap_workers() 622018-09-13T08:17:07.862433+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers 632018-09-13T08:17:07.862805+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR) 642018-09-13T08:17:07.862856+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> 652018-09-13T08:17:07.950660+00:00 heroku[web.1]: Process exited with status 1 662018-09-13T08:17:07.967382+00:00 heroku[web.1]: State changed from up to crashed 672018-09-13T08:17:08.000000+00:00 app[api]: Build succeeded 682018-09-13T08:17:13.518941+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myflaskapp4.herokuapp.com request_id=ac704eb6-31e6-4a84-8490-af0e1bba58ef fwd="58.3.213.215" dyno= connect= service= status=503 bytes= protocol=https 692018-09-13T08:17:14.054286+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myflaskapp4.herokuapp.com request_id=c4eea809-d70c-4d71-b035-e8d09a7efe70 fwd="58.3.213.215" dyno= connect= service= status=503 bytes= protocol=https 702018-09-13T08:20:33.571414+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myflaskapp4.herokuapp.com request_id=198dcd9d-4240-41fd-9e27-15c0f3f5b287 fwd="58.3.213.215" dyno= connect= service= status=503 bytes= protocol=https 712018-09-13T08:20:34.082401+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myflaskapp4.herokuapp.com request_id=c33a6eec-5bfd-4bf8-b17a-efc2da22aeab fwd="58.3.213.215" dyno= connect= service= status=503 bytes= protocol=https 722018-09-13T08:20:39.815315+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myflaskapp4.herokuapp.com request_id=deac8c79-0622-45df-b912-a15715bbd5f1 fwd="58.3.213.215" dyno= connect= service= status=503 bytes= protocol=https 732018-09-13T08:20:40.674426+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myflaskapp4.herokuapp.com request_id=2b612a23-c721-4052-b754-70a5348ae3fc fwd="58.3.213.215" dyno= connect= service= status=503 bytes= protocol=https 742018-09-13T08:24:03.577086+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myflaskapp4.herokuapp.com request_id=6ab3858a-4b37-41ca-a7de-b571d23fe8c6 fwd="58.3.213.215" dyno= connect= service= status=503 bytes= protocol=https 752018-09-13T08:24:04.089941+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myflaskapp4.herokuapp.com request_id=e3f74fba-e603-4255-ba53-4bc3f12765d1 fwd="58.3.213.215" dyno= connect= service= status=503 bytes= protocol=https 76 77
(文字制限のため上の方のログはカットしています)
初歩的なことだと思うのですが検討つかず・・よろしくお願いいたします。
![退会済みユーザー](https://ddjkaamml8q8x.cloudfront.net/profileImages/deletedUser/icnUserSample.jpeg)
![退会済みユーザー](https://ddjkaamml8q8x.cloudfront.net/profileImages/deletedUser/icnUserSample.jpeg)
![guest](/img/icon/icnUserSample.jpg)
回答2件
あなたの回答
tips
プレビュー