Page MenuHomeSolus

docker-compose doesn't work with PyYAML 5.1.2
Closed, ResolvedPublic

Description

After the recent PyYAML update to 5.1.2, docker-compose has stopped working:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3126, in <module>
    @_call_aside
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3110, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3139, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 596, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 784, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'PyYAML<5,>=3.10' distribution was not found and is required by docker-compose

Apparently they are going to wait until 5.2 before adding support: https://github.com/docker/compose/issues/6619
Some other distributions have made their own patches where they have removed the upper bounds on versions, so maybe something similar could be the solution? https://github.com/docker/compose/issues/6756

Event Timeline

MadMac created this task.Aug 16 2019, 7:42 PM

Temporary fix:

  1. create virtualenv virtualenv env
  2. Activate virtualenv source ./env/bin/activate
  3. install docker-compose pip install docker-compose
  4. run docker-compose ./env/bin/docker-compose up

Hi, I tried temporary fix, but I get this:
(env) zeljko@optiplex7020  ~/devilbox   master  ./env/bin/docker-compose up
zsh: no such file or directory: ./env/bin/docker-compose

Just run the following instead:

sudo eopkg install https://packages.getsol.us/unstable/d/docker-compose/docker-compose-1.25.0_rc2-20-1-x86_64.eopkg

Thank you Josh. That fixed the issue :)

After last update (on October 25), docker compose is once again broken:
l
zeljko@optiplex7020  ~/devilbox   master ●  docker-compose up -d
Traceback (most recent call last):

File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 581, in _build_master
  ws.require(__requires__)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 898, in require
  needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 789, in resolve
  raise VersionConflict(dist, req).with_context(dependent_req)

pkg_resources.ContextualVersionConflict: (jsonschema 3.1.1 (/usr/lib64/python3.6/site-packages), Requirement.parse('jsonschema<3,>=2.5.1'), {'docker-compose'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/bin/docker-compose", line 6, in <module>
  from pkg_resources import load_entry_point
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3126, in <module>
  @_call_aside
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3110, in _call_aside
  f(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3139, in _initialize_master_working_set
  working_set = WorkingSet._build_master()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 583, in _build_master
  return cls._build_from_requirements(__requires__)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 596, in _build_from_requirements
  dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 784, in resolve
  raise DistributionNotFound(req, requirers)

pkg_resources.DistributionNotFound: The 'jsonschema<3,>=2.5.1' distribution was not found and is required by docker-compose

Any workaround available?
Thank you

JoshStrobl reopened this task as Open.EditedOct 26 2019, 6:42 AM
JoshStrobl assigned this task to joebonrichie.
JoshStrobl triaged this task as High priority.
JoshStrobl added a subscriber: joebonrichie.

Yes, it appears that @joebonrichie updated python-jsonschema per R2608:6c719d43c7be4540f45c22c59522dc6264d8d6e0 without proper testing of its reverse dependencies. I anticipate that the referenced commit will be reversed as soon as possible, or alternatively this commit be applied on docker-compose and tested, so I may cherrypick the fix onto stable. I am re-opening this issue and assigning it. Until then, my recommendation would be to do sudo eopkg install https://mirrors.rit.edu/solus/packages/shannon/p/python-jsonschema/python-jsonschema-2.6.0-3-1-x86_64.eopkg

JoshStrobl edited projects, added Software; removed Lacks Project.Oct 26 2019, 6:44 AM
JoshStrobl moved this task from Backlog to Package Fixes on the Software board.

Thank you Josh, that last fix solved the issue :)

docker-compose update cherrypicked to shannon

Hi Josh,
I just did last update (which included docker compose), and now I get this:

zeljko@optiplex7020  ~/devilbox   master ●  docker-compose up -d
Traceback (most recent call last):

File "/usr/bin/docker-compose", line 6, in <module>
  from pkg_resources import load_entry_point
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3126, in <module>
  @_call_aside
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3110, in _call_aside
  f(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3139, in _initialize_master_working_set
  working_set = WorkingSet._build_master()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 581, in _build_master
  ws.require(__requires__)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 898, in require
  needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 784, in resolve
  raise DistributionNotFound(req, requirers)

pkg_resources.DistributionNotFound: The 'importlib_metadata' distribution was not found and is required by jsonschema

Install it with sudo eopkg it python-importlib-metadata. Resolved with R2608:bfbbf889cc61.

Skyeun added a subscriber: Skyeun.Oct 27 2019, 9:39 AM

I tried to install python-importlib-metadata as per @joebonrichie advice and it doesn't work. I got an error telling me that there is a file conflict with python-backports.

Program terminated.
File conflicts:
/usr/lib/python2.7/site-packages/backports/__init__.py from python-backports package
/usr/lib/python2.7/site-packages/backports/__init__.pyc from python-backports package

Ok python-configparser needs to cherry-picked to stable as well. Please follow Josh's original advise and install an old version of jsonschema for now. sudo eopkg install https://mirrors.rit.edu/solus/packages/shannon/p/python-jsonschema/python-jsonschema-2.6.0-3-1-x86_64.eopkg.

It does work, thanks. Good luck with all this update ;)