gpt4 book ai didi

python - 部署 Dash 应用程序时出现 Heroku 应用程序错误

转载 作者:行者123 更新时间:2023-12-01 09:20:11 25 4
gpt4 key购买 nike

我正在尝试使用 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

最佳答案

我包含了一个requirements.txt文件,其中包含应用程序所需的所有包,并通过命令行使用git推送到heroku并使其正常工作。话虽如此,在虚拟环境中通过 pip 安装软件包后,很难判断发生了什么。包还没有加载吗?

这是我使用 miniconda 环境在 requests.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

关于python - 部署 Dash 应用程序时出现 Heroku 应用程序错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50851651/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com