python - 权限被拒绝:Heroku + Docker + Conda 部署
问题描述
Heroku 有一个示例存储库,该存储库利用 Docker 容器注册表来存储 Anaconda 包:
我分叉了这个存储库并推送了一个添加文件的提交heroku.yml
:
build:
docker:
web: Dockerfile
这样我就可以git push
远程访问 Heroku,并且图像将构建在他们的服务器中。推动更改进展顺利(图像已成功构建)。
但是,当尝试向服务发出请求时,我收到一个错误:
2019-09-25T19:50:18.000000+00:00 app[api]: Build started by user <my_email>
2019-09-25T19:53:16.000000+00:00 app[api]: Build succeeded
2019-09-25T19:53:16.436402+00:00 app[api]: Deploy 6bd60459 by user <my_email>
2019-09-25T19:53:16.436402+00:00 app[api]: Release v93 created by user <my_email>
2019-09-25T19:53:18.407563+00:00 heroku[web.1]: State changed from crashed to starting
2019-09-25T19:53:40.751324+00:00 heroku[web.1]: Starting process with command `/bin/sh -c gunicorn\ --bind\ 0.0.0.0:\15070\ wsgi`
2019-09-25T19:53:43.694756+00:00 heroku[web.1]: State changed from starting to crashed
2019-09-25T19:53:43.673120+00:00 heroku[web.1]: Process exited with status 1
2019-09-25T19:53:43.586712+00:00 app[web.1]: Traceback (most recent call last):
2019-09-25T19:53:43.586736+00:00 app[web.1]: File "/opt/conda/bin/gunicorn", line 7, in <module>
2019-09-25T19:53:43.586738+00:00 app[web.1]: from gunicorn.app.wsgiapp import run
2019-09-25T19:53:43.586759+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 9, in <module>
2019-09-25T19:53:43.587076+00:00 app[web.1]: from gunicorn.app.base import Application
2019-09-25T19:53:43.587078+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/gunicorn/app/base.py", line 12, in <module>
2019-09-25T19:53:43.587080+00:00 app[web.1]: from gunicorn import util
2019-09-25T19:53:43.587081+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/gunicorn/util.py", line 12, in <module>
2019-09-25T19:53:43.587082+00:00 app[web.1]: import pkg_resources
2019-09-25T19:53:43.587084+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 2927, in <module>
2019-09-25T19:53:43.587086+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 2913, in _call_aside
2019-09-25T19:53:43.587144+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
2019-09-25T19:53:43.587191+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 626, in _build_master
2019-09-25T19:53:43.587258+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 619, in __init__
2019-09-25T19:53:43.587340+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 675, in add_entry
2019-09-25T19:53:43.587384+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 1982, in find_on_path
2019-09-25T19:53:43.587445+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 2370, in from_location
2019-09-25T19:53:43.587499+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 2687, in _reload_version
2019-09-25T19:53:43.587561+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 2335, in _version_from_file
2019-09-25T19:53:43.587626+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 2503, in _get_metadata
2019-09-25T19:53:43.587688+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 1873, in get_metadata_lines
2019-09-25T19:53:43.587751+00:00 app[web.1]: File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py", line 1861, in get_metadata
2019-09-25T19:53:43.587854+00:00 app[web.1]: IOError: [Errno 13] Permission denied: '/opt/conda/lib/python2.7/site-packages/.wh.conda-4.2.15-py2.7.egg-info'
为什么会发生这种情况,我该如何解决?
解决方案
推荐阅读
- angular - 当以编程方式更改表单输入值时,不会触发 NgForm.valueChanges
- python - 在 python 中仅测量 CPU 时间(不是时钟时间)
- python - 主文件 PyQt4 中的外部函数
- javascript - 如何在嵌套对象中查找属性
- uwp - 滚动不会停止,同时通过在 UWP 中的投掷动作后点击屏幕来停止滚动动作
- variables - TestComplete - 如何在 testComplete 中定义动态变量,就像我们在 Soapui 中使用 $ 符号“${#Var2}”一样
- android - JSON解析动态按钮
- mysql - LEFT JOIN 显示 NULL 行 + WHERE
- batch-file - 批量获取 2 个字符之间的字符串
- ios - 如何在swift中从字符串数组中拆分字符串