将Dash应用程序部署到Heroku:错误代码= H10,H13

问题描述 投票:1回答:1

这是我第一次将应用程序部署到Heroku。我在Python中构建了一个Dash应用程序,该应用程序在localhost上运行良好,并且能够按照Dash教程成功地在Heroku上成功构建和部署它,尽管在尝试启动该应用程序时未加载该应用程序(相反,它会在日志中产生错误)。

我正在使用Windows计算机,还必须添加并使用此自定义构建包([位于此处] [1])来使用Git LFS,因为我的数据文件之一太大而无法容纳在Git存储库中。

我已经创建了一个Procfile:

web: gunicorn app:server

并在requirements.txt中安装/添加了Gunicorn

构建成功完成后,尝试启动应用程序时出现这些应用程序错误。

2020-05-27T03:43:30.000000+00:00 app[api]: Build succeeded
2020-05-27T03:50:00.231102+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-27T03:50:30.788014+00:00 heroku[web.1]: Starting process with command `gunicorn app:server`
2020-05-27T03:50:34.709044+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-05-27T03:50:34.710044+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [4] [INFO] Listening at: http://0.0.0.0:37455 (4)
2020-05-27T03:50:34.710172+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [4] [INFO] Using worker: sync
2020-05-27T03:50:34.715383+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [10] [INFO] Booting worker with pid: 10
2020-05-27T03:50:34.720666+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [11] [INFO] Booting worker with pid: 11
2020-05-27T03:50:35.355566+00:00 heroku[web.1]: State changed from starting to up
2020-05-27T03:50:56.465384+00:00 heroku[web.1]: Process running mem=1280M(250.0%)
2020-05-27T03:50:56.493628+00:00 heroku[web.1]: Error R15 (Memory quota vastly exceeded)
2020-05-27T03:50:56.496502+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-05-27T03:50:56.653528+00:00 heroku[web.1]: Process exited with status 137
2020-05-27T03:50:56.689016+00:00 heroku[web.1]: State changed from up to crashed
2020-05-27T03:50:56.575446+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=####.herokuapp.com request_id=56fd4ef7-74a1-4142-9637
-e76cb6a078f6 fwd="155.33.132.49" dyno=web.1 connect=0ms service=19725ms status=503 bytes=0 protocol=https
2020-05-27T03:51:01.934855+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=####.herokuapp.com request_id=1c984ec2-5f22-4620-b3c5-34957d287d0
f fwd="155.33.132.49" dyno=web.1 connect=5000ms service= status=503 bytes= protocol=https

我无法充分理解日志的输出,因此我对于解决或尝试的事情一无所知。

python heroku gunicorn plotly-dash git-lfs
1个回答
1
投票

关于Heroku错误的一些澄清:

Error R15:您的应用程序的内存超过允许的内存的200%。错误H13:您的dyno中的进程打开了一个连接,但在将任何内容写入该连接之前将其关闭。错误H10:应用程序崩溃并正在关闭。


那么您的应用程序是怎么回事?很明显,您的dyno内存超载,导致连接立即关闭并且应用程序崩溃。

解决方案:

  • 请考虑扩大您的测功机(至少要调试一下,看看您的应用程序是否可以使用更大的可用内存)。
  • 从应用程序中卸载数据,将其存储在数据库中,并根据需要动态检索。
© www.soinside.com 2019 - 2024. All rights reserved.