AWS Elastic Beanstalk - 错误要求.txt

时间:2016-09-14 15:00:19

标签: python django amazon-web-services amazon-ec2 elastic-beanstalk

当我尝试部署我的Amazon Web Services Elastic Beanstalk项目(Python + Django)时,出现以下错误:

 2016-09-14 14:46:37,244 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1 (Executor::NonZeroExitStatus)

几个月前我遇到了这个错误,我只是在.ebextensions中更改了我的配置,这使得部署能够正常工作(问题是postgresql93-devel缺失):

packages:
    yum:
        git: []
        postgresql93-devel: []
        libffi-devel: []

我认为AWS在requirements.txt中有一个或多个我的库存在问题 - 我尝试安装/卸载其中一些库以找到导致问题的库,但尚未管理。这是我的要求.txt:

awsebcli==3.7.7
beautifulsoup4==4.4.1
boto==2.40.0
botocore==1.4.40
cement==2.8.2
cffi==1.5.2
colorama==0.3.7
cryptography==1.3.1
Django==1.9.4
django-storages==1.4.1
docker-py==1.7.2
dockerpty==0.4.1
docopt==0.6.2
docutils==0.12
enum34==1.1.2
future==0.15.2
futures==3.0.5
gax-google-logging-v2==0.8.1
gax-google-pubsub-v1==0.8.1
google-api-python-client==1.5.0
google-gax==0.13.0
googleads==3.13.0
googleapis-common-protos==1.3.4
grpc-google-logging-v2==0.8.1
grpc-google-pubsub-v1==0.8.1
grpcio==1.0.0
httplib2==0.9.2
idna==2.1
ipaddress==1.0.16
jmespath==0.9.0
oauth2client==2.0.1
pathspec==0.3.4
ply==3.8
protobuf==3.0.0
psycopg2==2.6.1
pyasn1==0.1.9
pyasn1-modules==0.0.8
pycparser==2.14
pyOpenSSL==16.0.0
PySocks==1.5.6
python-dateutil==2.5.3
pytz==2016.2
PyYAML==3.11
requests==2.9.1
rsa==3.4
s3transfer==0.1.4
semantic-version==2.5.0
simplejson==3.8.2
six==1.10.0
suds-jurko==0.6
texttable==0.8.4
uritemplate==0.6
websocket-client==0.37.0
xmltodict==0.10.1

我的猜测是问题来自其中一个库(但我可能错了!):

future==0.15.2
futures==3.0.5
gax-google-logging-v2==0.8.1
gax-google-pubsub-v1==0.8.1
google-gax==0.13.0
googleapis-common-protos==1.3.4
grpc-google-logging-v2==0.8.1
grpc-google-pubsub-v1==0.8.1
grpcio==1.0.0
ply==3.8
protobuf==3.0.0
s3transfer==0.1.4

Django项目在本地完美运作。我的问题仅在于AWS Elastic Beanstalk部署。

如果您有任何想法,请告诉我。

1 个答案:

答案 0 :(得分:1)

我在这里看到了同样的问题,这是未来的图书馆。如果查看AWS EB服务器错误日志(/ var / log / httpd / error_log),则会看到该错误。

python3 / django2在将来的模块中不能很好地发挥作用,但是wasebcli坚持使用它。

我在这里通过不将awsebcli安装到虚拟环境中来解决此问题。然后,您需要使用本地环境(安装了awsebcli)进行部署。

似乎我们应该为AWSEBCLI进行更新以最终解决此问题。