Plone 5.2rc1 and Ansible playbook: ContextualVersionConflict zc.buildout

I'm trying to fiddle with our Ansible playbook, specifically the plone_server role to get it to work with Plone 5.2rc1.

Looking for suggestions on how to address this error:

$ cat /usr/local/plone-5.2rc1/zeoserver/buildout.log
Getting distribution for 'setuptools==36.2'.
warning: no files found matching '*' under directory 'setuptools/_vendor'
Got setuptools 36.2.0.
While:
  Installing.
  Getting section zeoserver.
  Initializing section zeoserver.
  Loading zc.buildout recipe entry plone.recipe.zeoserver:default.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1995, in main
    getattr(buildout, command)(args)
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 550, in install
    [self[part]['recipe'] for part in install_parts]
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1135, in __getitem__
    options._initialize()
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1239, in _initialize
    self.initialize()
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1245, in initialize
    recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1204, in _install_and_load
    req.project_name, group, entry)
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2589, in load_entry_point
    return ep.load()
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2248, in load
    self.require(*args, **kwargs)
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2265, in require
    items = working_set.resolve(reqs, env, installer)
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 859, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
ContextualVersionConflict: (zc.buildout 2.5.3 (/usr/local/plone-5.2rc1/zeoserver/lib/python2.7/site-packages), Requirement.parse('zc.buildout>=2.12.0'), set(['zc.recipe.egg']))

That's after trying to pin

setuptools = 36.2
zc.buildout = 2.12.0

in buildout.cfg.j2

Thanks @petschki for asking in Gitter "did you bin/pip install -r requirements.txt before?"

I checked and it seems @smcmahon has the playbook using bin/pip install … on https://github.com/plone/ansible.plone_server/commits/master scroll down to May 25, 2018

This morning when I ran vagrant up I ran into an error caused when you save the VM's running state, so I deleted the saved state.

I also got a message about upgrading the virtual box,

==> bionic: Checking if box 'ubuntu/bionic64' version '20190307.0.0' is up to date...
==> bionic: A newer version of the box 'ubuntu/bionic64' is available and already
==> bionic: installed, but your Vagrant machine is running against
==> bionic: version '20190307.0.0'. To update to version '20190314.0.0',
==> bionic: destroy and recreate your machine.

so I dutifully did vagrant box update

...and am now getting “Ansible software could not be found”… sigh

==> bionic: Running provisioner: ansible...
Vagrant gathered an unknown Ansible version:


and falls back on the compatibility mode '1.8'.

Alternatively, the compatibility mode can be specified in your Vagrantfile:
https://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode

    bionic: Running ansible-playbook...
The Ansible software could not be found! Please verify
that Ansible is correctly installed on your host system.

If you haven't installed Ansible yet, please install Ansible
on your host system. Vagrant can't do this for you in a safe and
automated way.
Please check https://docs.ansible.com for more information.

I had installed Ansible with bin/pip install ansible so I needed to add that bin directory to my PATH:

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public
$ export PATH=$PATH:`pwd`/bin

...and then vagrant provision ran farther, until

Getting distribution for 'buildout.sanitycheck==1.0.2'.
Got buildout.sanitycheck 1.0.2.
Creating directory '/usr/local/plone-5.2rc1/zeoserver/parts'.
Creating directory '/usr/local/plone-5.2rc1/zeoserver/develop-eggs'.
Getting distribution for 'plone.recipe.zeoserver==2.0.1'.
warning: no files found matching 'tox.ini'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '*' found under directory 'news'
warning: no previously-included files found matching 'news'
Got plone.recipe.zeoserver 2.0.1.
Getting distribution for 'ZopeUndo'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
Got ZopeUndo 4.3.
Getting distribution for 'zope.mkzeoinstance==4.1'.
Got zope.mkzeoinstance 4.1.
Getting distribution for 'ZODB==5.5.1'.
error: Setup script exited with error in ZODB setup command: 'extras_require' requirements cannot include environment markers, in 'test': 'mock; python_version == "2.7"'
An error occurred when trying to install /usr/local/plone-5.2rc1/buildout-cache/downloads/dist/ZODB-5.5.1.tar.gz. Look above this message for any errors that were output by easy_install.
While:
  Installing.
  Getting section zeoserver.
  Initializing section zeoserver.
  Installing recipe plone.recipe.zeoserver.
  Getting distribution for 'ZODB==5.5.1'.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 2128, in main
    getattr(buildout, command)(args)
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 682, in install
    [self[part]['recipe'] for part in install_parts]
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1279, in __getitem__
    options._initialize()
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1387, in _initialize
    self.initialize()
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1393, in initialize
    recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1343, in _install_and_load
    allow_hosts=buildout._allow_hosts
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 957, in install
    return installer.install(specs, working_set)
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 730, in install
    for dist in self._get_dist(req, ws):
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 574, in _get_dist
    dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
  File "/usr/local/plone-5.2rc1/zeoserver/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 1740, in _move_to_eggs_dir_and_compile
    [tmp_loc] = glob.glob(os.path.join(tmp_dest, '*'))
ValueError: need more than 0 values to unpack

Is the buildout using Python2.7?

It is. Is it not possible to run Plone 5.2 on Python 2.7?

Sure it is as you know.

Then why is everyone giving me grief for doing so... is this the new shaming? :frowning:

Shame! :joy: