Eb deploy --profile default command failing

elasticbeanstalk
docker
python

#1

I’ve been using Circle CI for over a year to deploy from my repo at BitBucket to AWS Elastic Beanstalk. This morning, the same command has failed and I’ve got no idea why. Here is the error:

$ eb deploy --profile default
Traceback (most recent call last):
  File "/opt/circleci/.pyenv/versions/2.7.11/bin/eb", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/opt/circleci/python/2.7.11/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3095, in <module>
    @_call_aside
  File "/opt/circleci/python/2.7.11/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3079, in _call_aside
    f(*args, **kwargs)
  File "/opt/circleci/python/2.7.11/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/opt/circleci/python/2.7.11/lib/python2.7/site-packages/pkg_resources/__init__.py", line 572, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/opt/circleci/python/2.7.11/lib/python2.7/site-packages/pkg_resources/__init__.py", line 585, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/opt/circleci/python/2.7.11/lib/python2.7/site-packages/pkg_resources/__init__.py", line 779, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyYAML 4.1 (/opt/circleci/python/2.7.11/lib/python2.7/site-packages), Requirement.parse('PyYAML<4,>=3.10'), set(['docker-compose']))

eb deploy --profile default returned exit code 1

Action failed: eb deploy --profile default

This is my circle.yml file:

dependencies:
  pre:
    - pip install awsebcli
test:
  override:
    - "true"
deployment:
  production:
    branch: master
    commands:
      - eb deploy --profile default

Did anything within Circle CI change that is causing this very error to happen?

I really appreciate any insights on this topic.

Thanks!


#2

I’ve noticed that a newer version of PyYAML library has been downloaded by default as consequence of the pip install awswebcli and it is incompatible with awswebcli as you can see here:

Successfully installed awsebcli-3.14.1 backports.ssl-match-hostname-3.5.0.1 blessed-1.15.0 botocore-1.10.46 cached-property-1.4.3 cement-2.8.2 certifi-2018.4.16 chardet-3.0.4 colorama-0.3.9 docker-3.4.0 docker-compose-1.21.2 docker-pycreds-0.3.0 dockerpty-0.4.1 docopt-0.6.2 docutils-0.14 enum34-1.1.6 functools32-3.2.3.post2 idna-2.6 ipaddress-1.0.22 jmespath-0.9.3 jsonschema-2.6.0 pathspec-0.5.5 python-dateutil-2.7.3 --> pyyaml-4.1 <-- requests-2.18.4 semantic-version-2.5.0 setuptools-39.2.0 six-1.11.0 tabulate-0.7.5 termcolor-1.1.0 texttable-0.9.1 urllib3-1.22 wcwidth-0.1.7 websocket-client-0.48.0

The previous deploy has a different version:
Successfully installed awsebcli-3.14.1 backports.ssl-match-hostname-3.5.0.1 blessed-1.15.0 botocore-1.10.45 cached-property-1.4.3 cement-2.8.2 certifi-2018.4.16 chardet-3.0.4 colorama-0.3.9 docker-3.4.0 docker-compose-1.21.2 docker-pycreds-0.3.0 dockerpty-0.4.1 docopt-0.6.2 docutils-0.14 enum34-1.1.6 functools32-3.2.3.post2 idna-2.6 ipaddress-1.0.22 jmespath-0.9.3 jsonschema-2.6.0 pathspec-0.5.5 python-dateutil-2.7.3 --> pyyaml-3.12 <-- requests-2.18.4 semantic-version-2.5.0 setuptools-39.2.0 six-1.11.0 tabulate-0.7.5 termcolor-1.1.0 texttable-0.9.1 urllib3-1.22 wcwidth-0.1.7 websocket-client-0.48.0

I understand that the pip call must then explicitly enforce the PyYAML version to be <4,>=3.10.

I’ve then changed the line:

- pip install awswebcli

to become:

- pip install "PyYAML<4,>=3.10" awsebcli

And that fixed the deploy.

Hope it helps out for someone else facing similar issue!


#3

Thank you!


#4

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.