Plone 5.0.8 Unified Installer failed on building Zope/Plone

On a Debian (8 and 9) system I installed these packages:

sudo apt-get install python2.7 python2.7-dev build-essential libssl-dev libxml2-dev libz-dev libjpeg-dev libreadline-dev libxslt-dev python-dev python-setuptools python-imaging poppler-utils wv patch make

I try to install Plone 5.0.8:

wget https://launchpad.net/plone/5.0/5.0.8/+download/Plone-5.0.8-UnifiedInstaller-r1.tgz
tar -zxvf Plone*.tgz
cd Plone*Installer
./install.sh

which fails on the following line:

Building Zope/Plone; this takes a while...
Buildout returned an error code: 1; Aborting.
Buildout failed. Unable to continue

I've also tried Plone 5.0.7 both on local VPS and server.

This is the log output:

Detailed installation log
Starting at Wed Apr 11 13:44:45 CEST 2018
Processing ./packages/zc.buildout-2.9.5.tar.gz
Requirement already satisfied: setuptools>=8.0 in /home/solydxk/Plone/zinstance/lib/python2.7/site-packages (from zc.buildout==2.9.5)
Building wheels for collected packages: zc.buildout
  Running setup.py bdist_wheel for zc.buildout: started
  Running setup.py bdist_wheel for zc.buildout: finished with status 'done'
  Stored in directory: /home/solydxk/.cache/pip/wheels/3d/55/8b/bffe9ef59e0219f44cca7c2bbeec37f9066304caf19e67bc30
Successfully built zc.buildout
Installing collected packages: zc.buildout
Successfully installed zc.buildout-2.9.5
Creating directory '/home/solydxk/Plone/zinstance/parts'.
Creating directory '/home/solydxk/Plone/zinstance/develop-eggs'.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/ZODB3/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/ZODB3/
Getting distribution for 'ZODB3==3.10.7'.
In file included from src/BTrees/BTreeModuleTemplate.c:394:0,
                 from src/BTrees/_IIBTree.c:34:
src/BTrees/BucketTemplate.c: In function ‘bucket_traverse’:
src/BTrees/BucketTemplate.c:1627:12: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
     int i, len;
            ^~~
In file included from src/BTrees/BTreeModuleTemplate.c:394:0,
                 from src/BTrees/_IFBTree.c:34:
src/BTrees/BucketTemplate.c: In function ‘bucket_traverse’:
src/BTrees/BucketTemplate.c:1627:12: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
     int i, len;
            ^~~
In file included from src/BTrees/BTreeModuleTemplate.c:394:0,
                 from src/BTrees/_fsBTree.c:83:
src/BTrees/BucketTemplate.c: In function ‘bucket_traverse’:
src/BTrees/BucketTemplate.c:1627:12: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
     int i, len;
            ^~~
In file included from src/BTrees/BTreeModuleTemplate.c:394:0,
                 from src/BTrees/_LLBTree.c:36:
src/BTrees/BucketTemplate.c: In function ‘bucket_traverse’:
src/BTrees/BucketTemplate.c:1627:12: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
     int i, len;
            ^~~
In file included from src/BTrees/BTreeModuleTemplate.c:394:0,
                 from src/BTrees/_LFBTree.c:36:
src/BTrees/BucketTemplate.c: In function ‘bucket_traverse’:
src/BTrees/BucketTemplate.c:1627:12: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
     int i, len;
            ^~~
Got ZODB3 3.10.7.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.interface/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.interface/
Getting distribution for 'zope.interface==3.6.7'.
Got zope.interface 3.6.7.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Record/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Record/
Getting distribution for 'Record==2.13.0'.
Got Record 2.13.0.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Products.ZCTextIndex/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Products.ZCTextIndex/
Getting distribution for 'Products.ZCTextIndex==2.13.5'.
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
src/Products/ZCTextIndex/okascore.c: In function ‘initokascore’:
src/Products/ZCTextIndex/okascore.c:127:12: warning: variable ‘m’ set but not used [-Wunused-but-set-variable]
  PyObject *m;
            ^
Got Products.ZCTextIndex 2.13.5.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/initgroups/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/initgroups/
Getting distribution for 'initgroups==2.13.0'.
Got initgroups 2.13.0.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.security/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.security/
Getting distribution for 'zope.security==3.7.4'.
Got zope.security 3.7.4.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.proxy/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.proxy/
Getting distribution for 'zope.proxy==3.6.1'.
Got zope.proxy 3.6.1.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.i18nmessageid/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.i18nmessageid/
Getting distribution for 'zope.i18nmessageid==3.5.3'.
Got zope.i18nmessageid 3.5.3.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.container/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/zope.container/
Getting distribution for 'zope.container==3.11.2'.
Got zope.container 3.11.2.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Persistence/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Persistence/
Getting distribution for 'Persistence==2.13.2'.
Got Persistence 2.13.2.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/MultiMapping/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/MultiMapping/
Getting distribution for 'MultiMapping==2.13.0'.
src/MultiMapping/_MultiMapping.c:159:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  (inquiry)MM_length,  /*mp_length*/
  ^
src/MultiMapping/_MultiMapping.c:159:2: note: (near initialization for ‘MM_as_mapping.mp_length’)
Got MultiMapping 2.13.0.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Missing/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Missing/
Getting distribution for 'Missing==2.13.1'.
Got Missing 2.13.1.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/ExtensionClass/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/ExtensionClass/
Getting distribution for 'ExtensionClass==4.1.2'.
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
Got ExtensionClass 4.1.2.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/DocumentTemplate/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/DocumentTemplate/
Getting distribution for 'DocumentTemplate==2.13.4'.
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
src/DocumentTemplate/cDocumentTemplate.c:169:3: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
   (inquiry)InstanceDict_length,  /*mp_length*/
   ^
src/DocumentTemplate/cDocumentTemplate.c:169:3: note: (near initialization for ‘InstanceDict_as_mapping.mp_length’)
src/DocumentTemplate/cDocumentTemplate.c:600:2: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  (inquiry)MM_length,  /*mp_length*/
  ^
src/DocumentTemplate/cDocumentTemplate.c:600:2: note: (near initialization for ‘MM_as_mapping.mp_length’)
Got DocumentTemplate 2.13.4.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Acquisition/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/Acquisition/
Getting distribution for 'Acquisition==4.2.2'.
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
Got Acquisition 4.2.2.
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/AccessControl/
Not found: /home/solydxk/Plone/buildout-cache/downloads/dist/AccessControl/
Getting distribution for 'AccessControl==3.0.13'.
warning: no files found matching '*.rst'
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
Got AccessControl 3.0.13.
Installing instance.
While:
  Installing instance.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/home/solydxk/Plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 2123, in main
    getattr(buildout, command)(args)
  File "/home/solydxk/Plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 796, in install
    installed_files = self[part]._call(recipe.install)
  File "/home/solydxk/Plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1553, in _call
    return f()
  File "/home/solydxk/Plone/buildout-cache/eggs/plone.recipe.zope2instance-4.2.22-py2.7.egg/plone/recipe/zope2instance/__init__.py", line 95, in install
    major, minor = parsed[0:2]
TypeError: 'Version' object has no attribute '__getitem__'

I noticed that http://www.pypi-mirrors.org/ gives a time-out. Could that be the cause of the problem?

Another try with Plone 5.0.8 but still failed.

I advanced regardless the failed installation:

cd ~/Plone/z*
sed -i 's/http:/https:/g' buildout.cfg
sed -i '/\[buildout\]/a index = https:\/\/pypi.python.org\/simple' buildout.cfg

/bin/buildout fails as expected.

Then I found this thread: Problem with buildout Plone 5.08

and decided to give it a go and downgrade setuptools:

bin/pip install setuptools==38.7.0
Collecting setuptools==38.7.0
  Using cached setuptools-38.7.0-py2.py3-none-any.whl
Installing collected packages: setuptools
  Found existing installation: setuptools 39.0.1
    Uninstalling setuptools-39.0.1:
      Successfully uninstalled setuptools-39.0.1
Successfully installed setuptools-38.7.0

bin/buildout now finishes correctly:

Uninstalling zeoserver.
Installing zeoserver.
Created directory /home/solydxk/Plone/zeocluster/parts/zeoserver
Created directory /home/solydxk/Plone/zeocluster/parts/zeoserver/etc
Created directory /home/solydxk/Plone/zeocluster/parts/zeoserver/var
Created directory /home/solydxk/Plone/zeocluster/parts/zeoserver/log
Created directory /home/solydxk/Plone/zeocluster/parts/zeoserver/bin
Wrote file /home/solydxk/Plone/zeocluster/parts/zeoserver/etc/zeo.conf
Wrote file /home/solydxk/Plone/zeocluster/parts/zeoserver/bin/zeoctl
Changed mode for /home/solydxk/Plone/zeocluster/parts/zeoserver/bin/zeoctl to 755
Wrote file /home/solydxk/Plone/zeocluster/parts/zeoserver/bin/runzeo
Changed mode for /home/solydxk/Plone/zeocluster/parts/zeoserver/bin/runzeo to 755
Installing client1.
/home/solydxk/Plone/zeocluster/local/lib/python2.7/site-packages/pkg_resources/__init__.py:208: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need.
  stacklevel=1,
Getting distribution for 'Pillow==3.4.2'.
Single threaded build, not installing mp_compile:1 processes
warning: no files found matching '*.sh'
no previously-included directories found matching 'docs/_static'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching 'appveyor.yml'
warning: no previously-included files found matching 'build_children.sh'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version      Pillow 3.4.2
platform     linux2 2.7.13 (default, Nov 24 2017, 17:33:09)
             [GCC 6.3.0 20170516]
--------------------------------------------------------------------
--- JPEG support available
*** OPENJPEG (JPEG2000) support not available
--- ZLIB (PNG/ZIP) support available
*** LIBIMAGEQUANT support not available
*** LIBTIFF support not available
*** FREETYPE2 support not available
*** LITTLECMS2 support not available
*** WEBP support not available
*** WEBPMUX support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library and headers.
See https://pillow.readthedocs.io/en/latest/installation.html#building-from-source

To check the build, run the selftest.py script.

Got Pillow 3.4.2.
Getting distribution for 'lxml==3.5.0'.
Building lxml version 3.5.0.
Building without Cython.
Using build configuration of libxslt 1.1.29
Got lxml 3.5.0.
Generated script '/home/solydxk/Plone/zeocluster/bin/client1'.
Generated interpreter '/home/solydxk/Plone/zeocluster/parts/client1/bin/interpreter'.
Generated script '/home/solydxk/Plone/zeocluster/bin/gifmaker.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/enhancer.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/thresholder.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/pilfile.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/painter.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/viewer.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/explode.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/pildriver.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/pilconvert.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/pilfont.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/player.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/createfontdatachunk.py'.
Generated script '/home/solydxk/Plone/zeocluster/bin/pilprint.py'.
Installing backup.
Generated script '/home/solydxk/Plone/zeocluster/bin/backup'.
Generated script '/home/solydxk/Plone/zeocluster/bin/fullbackup'.
Generated script '/home/solydxk/Plone/zeocluster/bin/snapshotbackup'.
Generated script '/home/solydxk/Plone/zeocluster/bin/restore'.
Generated script '/home/solydxk/Plone/zeocluster/bin/snapshotrestore'.
Installing zopepy.
Generated interpreter '/home/solydxk/Plone/zeocluster/bin/zopepy'.
Installing unifiedinstaller.
Generated script '/home/solydxk/Plone/zeocluster/bin/plonectl'.

I now have a functioning Plone server although I don't think this is the right way to do it.

Is there anything I can do now?

yes, goto Issues · plone/Installers-UnifiedInstaller · GitHub
and create a new issue, there should be a new -r2 unified installer.
No idea about how to fix your install myself. Seen it, confirmed.

Trying to add last zc.buildout but then it breaks a bit later in zope2instance and there it's more hairy since installer can't change code of distribution. There may be a way to pin the setuptools in the installer but I don't know it. Maybe add setuptools directly in the installer and install it through pip. Ugly though.

I don't understand everything you said (I'm fairly new to Plone and its jargon) but I created the issue here: https://github.com/plone/Installers-UnifiedInstaller/issues/73