繁体   English   中英

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

[英]Deploying Dash app to Heroku: error code=H10, H13

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

我使用的是一台 Windows 机器,还必须添加和使用此自定义构建包([位于此处][1])才能使用 Git LFS,因为我的一个数据文件太大,无法放入 Git 存储库。

我创建了一个Procfile:

web: gunicorn app:server

并将 gunicorn 安装/添加到requirements.txt

当我在构建成功完成后尝试启动应用程序时遇到这些应用程序错误。

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

我无法从日志中理解 output 的意义,所以我对要排除故障或尝试的事情非常困惑。

关于 Heroku 错误的一些说明:

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


那么您的应用程序发生了什么?
很明显,您正在使 dyno 的 memory 超载,导致连接立即关闭并且应用程序崩溃。

解决方案:

  • 考虑扩大你的测功机(至少调试并查看你的应用程序是否适用于更大的可用内存)。
  • 从您的应用程序卸载数据,将其存储在数据库中并根据需要动态检索。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM