部署Dash应用程序时Heroku应用程序错误

时间:2018-06-14 07:15:02

标签: python heroku web-applications

我正在尝试使用Dash制作的应用程序在Heroku上部署Web应用程序。我已经在Heroku上成功部署了几个示例应用程序,并且我已成功在我的本地服务器上部署了我的应用程序。当我尝试在Heroku上部署我自己的应用程序时出现问题。我尝试了几种不同的方法在Heroku上进行部署,但是尽管构建成功,我仍然继续获得“应用程序错误”。我已经包含了我的日志,但可以使用帮助来理解它们。我对此仍然很陌生,所以任何见解都会受到赞赏。

2018-06-14T06:16:06.479983+00:00 app[web.1]:     self.reap_workers()
2018-06-14T06:16:06.479989+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2018-06-14T06:16:06.480336+00:00 app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2018-06-14T06:16:06.480369+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2018-06-14T06:16:06.571040+00:00 heroku[web.1]: State changed from up to crashed
2018-06-14T06:16:06.555492+00:00 heroku[web.1]: Process exited with status 1
2018-06-14T06:20:34.738228+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=builddlrapp.herokuapp.com request_id=75e9c068-72cb-41e3-8bbd-c6790c722f8e fwd="137.158.71.91" dyno= connect= service= status=503 bytes= protocol=https
2018-06-14T06:20:38.238293+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=builddlrapp.herokuapp.com request_id=c0905560-3e86-4059-918a-3c795824325c fwd="137.158.71.91" dyno= connect= service= status=503 bytes= protocol=https
2018-06-14T06:31:25.832995+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=builddlrapp.herokuapp.com request_id=3d771909-ec4e-4312-9567-6653b443ef6f fwd="137.158.71.91" dyno= connect= service= status=503 bytes= protocol=https
2018-06-14T06:31:26.464840+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=builddlrapp.herokuapp.com request_id=b1ae29be-3f08-4d94-b669-243b5a303a5b fwd="137.158.71.91" dyno= connect= service= status=503 bytes= protocol=https
2018-06-14T06:34:44.629354+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-14T06:34:53.953676+00:00 heroku[web.1]: Starting process with command `gunicorn app:server`
2018-06-14T06:34:55.963096+00:00 app[web.1]: [2018-06-14 06:34:55 +0000] [4] [INFO] Starting gunicorn 19.8.1
2018-06-14T06:34:55.963587+00:00 app[web.1]: [2018-06-14 06:34:55 +0000] [4] [INFO] Listening at: http://0.0.0.0:41360 (4)
2018-06-14T06:34:55.963682+00:00 app[web.1]: [2018-06-14 06:34:55 +0000] [4] [INFO] Using worker: sync
2018-06-14T06:34:55.967329+00:00 app[web.1]: [2018-06-14 06:34:55 +0000] [8] [INFO] Booting worker with pid: 8
2018-06-14T06:34:56.010075+00:00 app[web.1]: [2018-06-14 06:34:56 +0000] [9] [INFO] Booting worker with pid: 9
2018-06-14T06:34:56.449927+00:00 heroku[web.1]: State changed from starting to up
2018-06-14T06:34:57.353527+00:00 app[web.1]: [2018-06-14 06:34:57 +0000] [9] [ERROR] Exception in worker process
2018-06-14T06:34:57.353564+00:00 app[web.1]: Traceback (most recent call last):
2018-06-14T06:34:57.353566+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2018-06-14T06:34:57.353567+00:00 app[web.1]:     worker.init_process()
2018-06-14T06:34:57.353568+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process
2018-06-14T06:34:57.353569+00:00 app[web.1]:     self.load_wsgi()
2018-06-14T06:34:57.353570+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2018-06-14T06:34:57.353571+00:00 app[web.1]:     self.wsgi = self.app.wsgi()
2018-06-14T06:34:57.353573+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2018-06-14T06:34:57.353574+00:00 app[web.1]:     self.callable = self.load()
2018-06-14T06:34:57.353576+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2018-06-14T06:34:57.353577+00:00 app[web.1]:     return self.load_wsgiapp()
2018-06-14T06:34:57.353578+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2018-06-14T06:34:57.353579+00:00 app[web.1]:     return util.import_app(self.app_uri)
2018-06-14T06:34:57.353580+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
2018-06-14T06:34:57.353581+00:00 app[web.1]:     __import__(module)
2018-06-14T06:34:57.353582+00:00 app[web.1]:   File "/app/app.py", line 12, in <module>
2018-06-14T06:34:57.353583+00:00 app[web.1]:     import dash_table_experiments as dt
2018-06-14T06:34:57.353590+00:00 app[web.1]: ModuleNotFoundError: No module named 'dash_table_experiments'
2018-06-14T06:34:57.355356+00:00 app[web.1]: [2018-06-14 06:34:57 +0000] [9] [INFO] Worker exiting (pid: 9)
2018-06-14T06:34:57.358463+00:00 app[web.1]: [2018-06-14 06:34:57 +0000] [8] [ERROR] Exception in worker process
2018-06-14T06:34:57.358465+00:00 app[web.1]: Traceback (most recent call last):
2018-06-14T06:34:57.358466+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2018-06-14T06:34:57.358467+00:00 app[web.1]:     worker.init_process()
2018-06-14T06:34:57.358468+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process
2018-06-14T06:34:57.358469+00:00 app[web.1]:     self.load_wsgi()
2018-06-14T06:34:57.358471+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2018-06-14T06:34:57.358472+00:00 app[web.1]:     self.wsgi = self.app.wsgi()
2018-06-14T06:34:57.358473+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2018-06-14T06:34:57.358474+00:00 app[web.1]:     self.callable = self.load()
2018-06-14T06:34:57.358475+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2018-06-14T06:34:57.358476+00:00 app[web.1]:     return self.load_wsgiapp()
2018-06-14T06:34:57.358477+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2018-06-14T06:34:57.358479+00:00 app[web.1]:     return util.import_app(self.app_uri)
2018-06-14T06:34:57.358480+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
2018-06-14T06:34:57.358481+00:00 app[web.1]:     __import__(module)
2018-06-14T06:34:57.358482+00:00 app[web.1]:   File "/app/app.py", line 12, in <module>
2018-06-14T06:34:57.358483+00:00 app[web.1]:     import dash_table_experiments as dt
2018-06-14T06:34:57.358487+00:00 app[web.1]: ModuleNotFoundError: No module named 'dash_table_experiments'
2018-06-14T06:34:57.360264+00:00 app[web.1]: [2018-06-14 06:34:57 +0000] [8] [INFO] Worker exiting (pid: 8)
2018-06-14T06:34:57.415375+00:00 app[web.1]: Traceback (most recent call last):
2018-06-14T06:34:57.415384+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 210, in run
2018-06-14T06:34:57.415674+00:00 app[web.1]:     self.sleep()
2018-06-14T06:34:57.415677+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 360, in sleep
2018-06-14T06:34:57.415899+00:00 app[web.1]:     ready = select.select([self.PIPE[0]], [], [], 1.0)
2018-06-14T06:34:57.415901+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 245, in handle_chld
2018-06-14T06:34:57.416091+00:00 app[web.1]:     self.reap_workers()
2018-06-14T06:34:57.416095+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2018-06-14T06:34:57.416352+00:00 app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2018-06-14T06:34:57.416387+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2018-06-14T06:34:57.416389+00:00 app[web.1]: 
2018-06-14T06:34:57.416390+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2018-06-14T06:34:57.416391+00:00 app[web.1]: 
2018-06-14T06:34:57.416394+00:00 app[web.1]: Traceback (most recent call last):
2018-06-14T06:34:57.416395+00:00 app[web.1]:   File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2018-06-14T06:34:57.416514+00:00 app[web.1]:     sys.exit(run())
2018-06-14T06:34:57.416516+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 61, in run
2018-06-14T06:34:57.416632+00:00 app[web.1]:     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2018-06-14T06:34:57.416633+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 223, in run
2018-06-14T06:34:57.416796+00:00 app[web.1]:     super(Application, self).run()
2018-06-14T06:34:57.416797+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
2018-06-14T06:34:57.416923+00:00 app[web.1]:     Arbiter(self).run()
2018-06-14T06:34:57.416924+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 232, in run
2018-06-14T06:34:57.417088+00:00 app[web.1]:     self.halt(reason=inst.reason, exit_status=inst.exit_status)
2018-06-14T06:34:57.417089+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 345, in halt
2018-06-14T06:34:57.417316+00:00 app[web.1]:     self.stop()
2018-06-14T06:34:57.417341+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop
2018-06-14T06:34:57.417542+00:00 app[web.1]:     time.sleep(0.1)
2018-06-14T06:34:57.417543+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 245, in handle_chld
2018-06-14T06:34:57.417703+00:00 app[web.1]:     self.reap_workers()
2018-06-14T06:34:57.417705+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2018-06-14T06:34:57.417949+00:00 app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2018-06-14T06:34:57.417969+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2018-06-14T06:34:57.482436+00:00 heroku[web.1]: Process exited with status 1
2018-06-14T06:34:57.498547+00:00 heroku[web.1]: State changed from up to crashed

2 个答案:

答案 0 :(得分:1)

我在应用程序所需的所有软件包中都包含了requirements.txt文件,并通过命令行使用git将其推送到heroku并使其正常工作。话虽如此,通过虚拟环境中的pip安装软件包后,很难说出是怎么回事。程序包仍不加载吗?

这是使用miniconda环境的我的requirements.txt文件中的内容。它可能超出了您的应用程序所需:

cement==2.8.2
certifi==2018.4.16
chardet==3.0.4
click==6.7
colorama==0.3.9
Cython==0.28.3
dash==0.21.1
dash-auth==1.0.2
dash-core-components==0.25.1
dash-html-components==0.11.0
dash-renderer==0.13.0
dash-table-experiments==0.6.0
decorator==4.3.0
docutils==0.14
Flask==1.0.2
Flask-Compress==1.4.0
Flask-SeaSurf==0.2.2
gunicorn==19.9.0
idna==2.7
ipython-genutils==0.2.0
itsdangerous==0.24
Jinja2==2.10
jmespath==0.9.3
jsonschema==2.6.0
jupyter-core==4.4.0
MarkupSafe==1.0
nbformat==4.4.0
numpy==1.14.5
pandas==0.23.3
pathspec==0.5.5
plotly==3.0.2
python-dateutil==2.7.3
pytz==2018.5
PyYAML==3.13
requests==2.19.1
retrying==1.3.3
semantic-version==2.5.0
six==1.11.0
tabulate==0.7.5
termcolor==1.1.0
traitlets==4.3.2
urllib3==1.23
Werkzeug==0.14.1
wincertstore==0.2

答案 1 :(得分:0)

缺少“dash_table_experiments” 你需要把它添加到你的requirements.txt git add A- git commit -m '修改'