首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Heroku worker突然崩溃,日志中没有显示我的任何脚本。发生了什么?

Heroku worker突然崩溃,日志中没有显示我的任何脚本。发生了什么?
EN

Stack Overflow用户
提问于 2020-02-07 05:31:00
回答 2查看 318关注 0票数 0

我有一个托管在heroku上的flask,gunicorn,postgresql项目,它突然失败了。我可以访问日志,但是没有我写的脚本,所以我很困惑。我没有在“工作”和“不工作”之间添加任何东西,所以我不知道从哪里开始。

日志可以在此pastebin中找到。最后一部分是:

代码语言:javascript
复制
2020-02-06T21:09:02.748093+00:00 app[web.1]: from werkzeug.contrib.cache import FileSystemCache
2020-02-06T21:09:02.748100+00:00 app[web.1]: ModuleNotFoundError: No module named 'werkzeug.contrib'
2020-02-06T21:09:02.748789+00:00 app[web.1]: [2020-02-06 21:09:02 +0000] [10] [INFO] Worker exiting (pid: 10)

我尝试将werkzeug添加到requirements.txt中,但没有帮助。这无论如何都会很奇怪,因为它在没有需求变化的情况下工作得很好。

如果你能帮我减少requirements.txt,我将不胜感激。

原始requirements.txt:

代码语言:javascript
复制
cs50
Flask
Flask-Session
requests
gunicorn
psycopg2-binary
openpyxl

新的、有效的:

代码语言:javascript
复制
astroid==2.3.3
attrs==19.3.0
Authlib==0.13
autopep8==1.5
awscli==1.17.9
backports.shutil-get-terminal-size==1.0.0
backports.shutil-which==3.5.2
beautifulsoup4==4.8.2
botocore==1.14.9
bs4==0.0.1
cairocffi==1.1.0
CairoSVG==2.4.2
certifi==2019.11.28
cffi==1.13.2
chardet==3.0.4
check50==3.0.10
Click==7.0
colorama==0.4.1
compare50==1.1.2
cryptography==2.8
cs50==5.0.3
cssselect2==0.2.2
cycler==0.10.0
defusedxml==0.6.0
docutils==0.15.2
EditorConfig==0.12.2
et-xmlfile==1.0.1
Flask==1.1.1
Flask-Session==0.3.1
help50==3.0.0
html5lib==1.0.1
icdiff==1.9.1
idna==2.8
ikp3db==1.4.1
intervaltree==2.1.0
isort==4.3.21
itsdangerous==1.1.0
jdcal==1.4.1
jellyfish==0.7.2
Jinja2==2.11.1
jmespath==0.9.4
jsbeautifier==1.10.3
kiwisolver==1.1.0
lazy-object-proxy==1.4.3
lib50==2.0.7
logger==1.4
MarkupSafe==1.1.1
matplotlib==3.1.3
mccabe==0.6.1
natsort==7.0.1
nltk==3.4.5
numpy==1.18.1
oauthlib==3.1.0
openpyxl==3.0.3
pandas==1.0.0
pexpect==4.8.0
Pillow==7.0.0
plotly==4.5.0
psycopg2-binary==2.8.4
ptyprocess==0.6.0
pyasn1==0.4.8
pycodestyle==2.5.0
pycparser==2.19
Pygments==2.5.2
pylint==2.4.4
pylint-django==2.0.13
pylint-flask==0.6
pylint-plugin-utils==0.6
pyparsing==2.4.6
PyPDF2==1.26.0
Pyphen==0.9.5
python-dateutil==2.8.1
python-magic==0.4.15
pytz==2019.3
PyYAML==5.2
render50==3.1.3
requests==2.22.0
requests-oauthlib==1.3.0
retrying==1.3.3
rsa==3.4.2
s3cmd==2.0.2
s3transfer==0.3.2
six==1.14.0
sortedcontainers==2.1.0
soupsieve==1.9.5
SQLAlchemy==1.3.13
sqlparse==0.3.0
style50==2.7.4
submit50==3.0.2
termcolor==1.1.0
tinycss2==1.0.2
tqdm==4.42.1
twython==3.7.0
typed-ast==1.4.1
urllib3==1.25.8
virtualenv==16.7.9
WeasyPrint==49
webencodings==0.5.1
Werkzeug==0.16.1
wrapt==1.11.2
gunicorn
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-02-07 22:19:16

Werkzeug昨天发布了一个新版本:

Release history

显然,werkzeug.contrib已经被移到了一个单独的模块

建议您尝试一下

代码语言:javascript
复制
./env/bin/pip install werkzeug==0.16.0
票数 2
EN

Stack Overflow用户

发布于 2020-02-16 00:59:02

这里有另一个可能对你有效的解决方案。

因为Werkzeug 1.0.0已经从werkzeug.contrib中删除了不推荐使用代码。

我在werkzeug==1.0.0中使用Proxyfix时遇到了同样的问题

在降级到werkzeug==0.16.0后,我收到了以下警告:

代码语言:javascript
复制
DeprecationWarning: 'werkzeug.contrib.fixers.ProxyFix' has moved to 'werkzeug.middleware.proxy_fix.ProxyFix'.
This import is deprecated as of version 0.15 and will be removed in 1.0.
DeprecationWarning: 'werkzeug.contrib.cache' is deprecated as of version 0.15 and will be removed in version 1.0. It has moved to pallets.
from werkzeug.contrib.cache import FileSystemCache

要解决问题,请执行以下操作:

代码语言:javascript
复制
pip install werkzeug==1.0.0

对于ProxyFix

代码语言:javascript
复制
from werkzeug.middleware.proxy_fix import ProxyFix

对于FileSystemCache,您必须安装托盘:

代码语言:javascript
复制
pip install -U cachelib
from cachelib.file import FileSystemCache

我希望这能帮助你解决你的问题?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60103829

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档