Upgrade Plone 5.0.7 to 5.1.0 fails

I need to upgrade my development environment from Plone 5.0.7 to Plone 5.1.0 to match the production version.

System: Debian 9 (Stretch)
I checked that python2.7 is the default version with: update-alternatives --config python

I changed extends= in buildout.cfg to:

extends =
    base.cfg
#    versions.cfg
    http://dist.plone.org/release/5.1.0/versions.cfg

Here's the output of sudo -u plone_buildout bin/buildout:

Getting distribution for 'plone.recipe.zope2instance==4.3'.
warning: no previously-included files matching '*pyc' found anywhere in distribution
Got plone.recipe.zope2instance 4.3.
Getting distribution for 'ZODB3==3.11.0'.
warning: no files found matching '*.rst'
warning: install_lib: 'build/lib.linux-x86_64-2.7' does not exist -- no Python modules to install

Got ZODB3 3.11.0.
Getting distribution for 'zc.recipe.egg==2.0.4'.
Got zc.recipe.egg 2.0.4.
Getting distribution for 'transaction==2.1.2'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching 'coverage.xml' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
Got transaction 2.1.2.
Getting distribution for 'BTrees==4.4.1'.
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
warning: no previously-included files matching 'coverage.xml' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'persistent/__pycache__'

Installed /tmp/easy_install-1REenJ/BTrees-4.4.1/.eggs/persistent-4.2.4.2-py2.7-linux-x86_64.egg
Searching for zope.interface
Reading https://pypi.python.org/simple/zope.interface/
Downloading https://pypi.python.org/packages/bd/d2/25349ed41f9dcff7b3baf87bd88a4c82396cf6e02f1f42bb68657a3132af/zope.interface-4.4.3.tar.gz#md5=8700a4f527c1203b34b10c2b4e7a6912
Best match: zope.interface 4.4.3
Processing zope.interface-4.4.3.tar.gz
Writing /tmp/easy_install-1REenJ/BTrees-4.4.1/temp/easy_install-_ZxS5P/zope.interface-4.4.3/setup.cfg
Running zope.interface-4.4.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-1REenJ/BTrees-4.4.1/temp/easy_install-_ZxS5P/zope.interface-4.4.3/egg-dist-tmp-fGNZLB
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
warning: no previously-included files matching 'coverage.xml' found anywhere in distribution
warning: no previously-included files matching 'appveyor.yml' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
creating /tmp/easy_install-1REenJ/BTrees-4.4.1/.eggs/zope.interface-4.4.3-py2.7-linux-x86_64.egg
Extracting zope.interface-4.4.3-py2.7-linux-x86_64.egg to /tmp/easy_install-1REenJ/BTrees-4.4.1/.eggs

Installed /tmp/easy_install-1REenJ/BTrees-4.4.1/.eggs/zope.interface-4.4.3-py2.7-linux-x86_64.egg
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
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*#' found anywhere in distribution
warning: no previously-included files matching 'coverage.xml' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
Got BTrees 4.4.1.
Getting distribution for 'persistent==4.2.4.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
warning: no previously-included files matching 'coverage.xml' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'persistent/__pycache__'
Got persistent 4.2.4.2.
Getting distribution for 'ZODB==5.3.0'.
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching 'appveyor.yml'
warning: no previously-included files found matching 'buildout.cfg'
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
warning: no previously-included files matching '*~' found anywhere in distribution
Got ZODB 5.3.0.
Getting distribution for 'ZEO==5.1.1'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got ZEO 5.1.1.
Getting distribution for 'Products.ZCatalog==3.0.3'.
warning: no files found matching '*.rst'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
Got Products.ZCatalog 3.0.3.
Getting distribution for 'initgroups==4.0'.
Got initgroups 4.0.
Getting distribution for 'zope.traversing==4.1.0'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zope.traversing 4.1.0.
Getting distribution for 'zope.security==4.1.1'.
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

Installed /tmp/easy_install-SXOsMd/zope.security-4.1.1/.eggs/zope.proxy-4.3.0-py2.7-linux-x86_64.egg
Searching for zope.interface
Reading https://pypi.python.org/simple/zope.interface/
Downloading https://pypi.python.org/packages/bd/d2/25349ed41f9dcff7b3baf87bd88a4c82396cf6e02f1f42bb68657a3132af/zope.interface-4.4.3.tar.gz#md5=8700a4f527c1203b34b10c2b4e7a6912
Best match: zope.interface 4.4.3
Processing zope.interface-4.4.3.tar.gz
Writing /tmp/easy_install-SXOsMd/zope.security-4.1.1/temp/easy_install-gxVuMH/zope.interface-4.4.3/setup.cfg
Running zope.interface-4.4.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-SXOsMd/zope.security-4.1.1/temp/easy_install-gxVuMH/zope.interface-4.4.3/egg-dist-tmp-Ou_S90
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
warning: no previously-included files matching 'coverage.xml' found anywhere in distribution
warning: no previously-included files matching 'appveyor.yml' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
creating /tmp/easy_install-SXOsMd/zope.security-4.1.1/.eggs/zope.interface-4.4.3-py2.7-linux-x86_64.egg
Extracting zope.interface-4.4.3-py2.7-linux-x86_64.egg to /tmp/easy_install-SXOsMd/zope.security-4.1.1/.eggs

Installed /tmp/easy_install-SXOsMd/zope.security-4.1.1/.eggs/zope.interface-4.4.3-py2.7-linux-x86_64.egg
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 zope.security 4.1.1.
Getting distribution for 'zope.schema==4.5.0'.
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
warning: no previously-included files matching 'coverage.xml' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
Got zope.schema 4.5.0.
Getting distribution for 'zope.publisher==4.3.2'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zope.publisher 4.3.2.
Getting distribution for 'zope.proxy==4.3.0'.
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 zope.proxy 4.3.0.
Getting distribution for 'zope.pagetemplate==4.2.1'.
warning: no files found matching '*.pt' under directory 'src'
Got zope.pagetemplate 4.2.1.
Getting distribution for 'zope.interface==4.4.3'.
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
warning: no previously-included files matching 'coverage.xml' found anywhere in distribution
warning: no previously-included files matching 'appveyor.yml' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
Got zope.interface 4.4.3.
Getting distribution for 'zope.i18nmessageid==4.1.0'.
warning: no files found matching '*.zcml' under directory 'src'
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 zope.i18nmessageid 4.1.0.
Getting distribution for 'zope.i18n[zcml]==4.2.0'.
Got zope.i18n 4.2.0.
Getting distribution for 'zope.contenttype==4.2.0'.
warning: no previously-included files found matching 'coverage.xml'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zope.contenttype 4.2.0.
Getting distribution for 'zope.component==4.4.1'.
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
warning: no previously-included files matching 'coverage.xml' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
Got zope.component 4.4.1.
Getting distribution for 'zope.browserresource==4.1.0'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zope.browserresource 4.1.0.
Getting distribution for 'zope.browserpage==4.1.0'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zope.browserpage 4.1.0.
Getting distribution for 'zope.browsermenu==4.2'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zope.browsermenu 4.2.
Getting distribution for 'zope.browser==2.1.0'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zope.browser 2.1.0.
Getting distribution for 'zLOG==3.0'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
Got zLOG 3.0.
Getting distribution for 'zdaemon==4.2.0'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zdaemon 4.2.0.
Getting distribution for 'tempstorage==4.0'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
Got tempstorage 4.0.
Getting distribution for 'pytz==2017.3'.
Got pytz 2017.3.
Getting distribution for 'docutils==0.14'.
warning: no files found matching 'MANIFEST'
warning: no previously-included files matching '*.pyc' found under directory '*'
warning: no previously-included files matching '*~' found under directory '*'
warning: no previously-included files matching '.DS_Store' found under directory '*'
zip_safe flag not set; analyzing archive contents...
docutils.parsers.rst.directives.misc: module references __file__
docutils.writers.docutils_xml: module references __path__
docutils.writers.html4css1.__init__: module references __file__
docutils.writers.html5_polyglot.__init__: module references __file__
docutils.writers.latex2e.__init__: module references __file__
docutils.writers.odf_odt.__init__: module references __file__
docutils.writers.pep_html.__init__: module references __file__
docutils.writers.s5_html.__init__: module references __file__
Got docutils 0.14.
Getting distribution for 'ZopeUndo==4.3'.
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 'ZConfig==3.1.0'.
warning: no files found matching '*.rst'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got ZConfig 3.1.0.
Getting distribution for 'MultiMapping==3.1'.
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 MultiMapping 3.1.
Getting distribution for 'Missing==3.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 Missing 3.2.
Getting distribution for 'ExtensionClass==4.3.0'.
warning: no previously-included files found matching 'src/coverage.xml'
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.3.0.
Getting distribution for 'DateTime==4.2'.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
Got DateTime 4.2.
Getting distribution for 'Acquisition==4.4.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.4.2.
Getting distribution for 'AccessControl==3.0.14'.
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.14.
Getting distribution for 'zodbpickle==0.7.0'.
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
  File "build/bdist.linux-x86_64/egg/zodbpickle/tests/pickletester_3.py", line 145
    class use_metaclass(object, metaclass=metaclass):
                                         ^
SyntaxError: invalid syntax

  File "build/bdist.linux-x86_64/egg/zodbpickle/pickletools_3.py", line 2049
    print("%5d:" % pos, end=' ', file=out)
                           ^
SyntaxError: invalid syntax

  File "build/bdist.linux-x86_64/egg/zodbpickle/pickle_3.py", line 178
    def __init__(self, file, protocol=None, *, fix_imports=True):
                                             ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/tmpMVB2nP/zodbpickle-0.7.0-py2.7-linux-x86_64.egg/zodbpickle/pickle_3.py", line 178
    def __init__(self, file, protocol=None, *, fix_imports=True):
                                             ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/tmpMVB2nP/zodbpickle-0.7.0-py2.7-linux-x86_64.egg/zodbpickle/pickletools_3.py", line 2049
    print("%5d:" % pos, end=' ', file=out)
                           ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/tmpMVB2nP/zodbpickle-0.7.0-py2.7-linux-x86_64.egg/zodbpickle/tests/pickletester_3.py", line 145
    class use_metaclass(object, metaclass=metaclass):
                                         ^
SyntaxError: invalid syntax

Got zodbpickle 0.7.0.
Getting distribution for 'zc.lockfile==1.2.1'.
warning: no files found matching '*.rst'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zc.lockfile 1.2.1.
Getting distribution for 'trollius==2.1'.
!!! WARNING !!! The Trollius project is now deprecated!

warning: no files found matching 'release.py'
zip_safe flag not set; analyzing archive contents...
trollius.test_utils: module references __file__

!!! WARNING !!! The Trollius project is now deprecated!
Got trollius 2.1.
Getting distribution for 'futures==3.1.1'.
Got futures 3.1.1.
Getting distribution for 'zope.dottedname==4.2'.
Got zope.dottedname 4.2.
Getting distribution for 'zope.untrustedpython==4.0.0'.
warning: no files found matching '*.txt'
warning: no files found matching '*' under directory 'doc'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Got zope.untrustedpython 4.0.0.
Uninstalling precompiler.
Uninstalling unifiedinstaller.
Uninstalling zopepy.
Uninstalling backup.
Uninstalling repozo.
Uninstalling instance.
Installing instance.
/opt/plone/zinstance/local/lib/python2.7/site-packages/pkg_resources/__init__.py:193: 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 'Plone==5.1.0'.
While:
  Installing instance.
  Getting distribution for 'Plone==5.1.0'.
Error: Couldn't find a distribution for 'Plone==5.1.0'

You can probably ignore all the warnings. However the syntax error is something that cannot be ignored:

sudo bin/plonectl start
instance: Traceback (most recent call last):
  File "bin/plonectl", line 13, in <module>
    sys.exit(plone.recipe.unifiedinstaller.ctl.main(server=None, clients=['instance'], location=r'/opt/plone/zinstance', binDirectory=r'/opt/plone/zinstance/bin', fileStorage=r'/opt/plone/zinstance/var/filestorage/Data.fs'))
  File "/opt/plone/buildout-cache/eggs/plone.recipe.unifiedinstaller-4.3.2-py2.7.egg/plone/recipe/unifiedinstaller/ctl.py", line 120, in main
    returncode = controller.runCommand(component, command)
  File "/opt/plone/buildout-cache/eggs/plone.recipe.unifiedinstaller-4.3.2-py2.7.egg/plone/recipe/unifiedinstaller/ctl.py", line 83, in runCommand
    po = subprocess.Popen(args)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

So, how to proceed from here?

Btw: what is this deprecated Trollius project and how to handle that?

your buildout.cfg is old and includes references to http URL that don't work anymore (nothing to do with the Plone project it's a general move). Current configuration files have https instead of http everywhere bur the (very oldish) reference to PIL's creator web site. Do these changes and it should work better. Since there already lots of posts about this problem on this forum you could have got this information by a search.
Trollius is a backport to Python 2 of a Python 3 library. The project was left as is a few years ago because the author switched to Python 3. Plone itself is scheduled to switch to Python 3 next year/

hi schoelje

i had a similar problem. After changing the buildout.cfg it worked for me to solve Error: Couldn't find a distribution for 'Plone==5.1.0

[buildout]

index = https://pypi.python.org/simple

Thanks for your quick reply.

I adapted buildout.cfg:

and ran:
sudo -u plone_buildout bin/buildout

I got a lot of these errors:

  File "/opt/plone/buildout-cache/eggs/tmptNRHyt/Products.CMFCore-2.2.12-py2.7.egg/Products/CMFCore/tests/fake_skins/fake_skin/test_unix.py", line 2
return 'unix'
SyntaxError: 'return' outside function

And finished with:

/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
An error occurred when trying to install lxml 4.1.1. Look above this message for any errors that were output by easy_install.
While:
  Installing instance.
  Getting distribution for 'lxml==4.1.1'.
Error: Couldn't install: lxml 4.1.1

Any ideas?

You are missing the dependencies to build lxml (it looks libz-dev is missing, or whatever it is called on your system), check https://docs.plone.org/manage/deploying/preparing.html

Running bn/buildout a second time:

Installing instance.
/opt/plone/zinstance/local/lib/python2.7/site-packages/pkg_resources/__init__.py:193: 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 'lxml==4.1.1'.
Building lxml version 4.1.1.
Building without Cython.
Using build configuration of libxslt 1.1.29
warning: no files found matching '*.html' under directory 'doc'
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
An error occurred when trying to install lxml 4.1.1. Look above this message for any errors that were output by easy_install.
While:
  Installing instance.
  Getting distribution for 'lxml==4.1.1'.
Error: Couldn't install: lxml 4.1.1

According to: https://docs.plone.org/manage/troubleshooting/buildout.html
I had to run this command:

sudo apt-get install libxml2-dev libxslt-dev

but these packages were already installed

sudo apt-get install zlib1g-dev ?

apt build-dep python-lxml

Now we're getting somewhere!

First I installed all packages:

apt-get install python2.7 python2.7-dev build-essential libssl-dev libxml2-dev libz-dev libjpeg-dev libreadline-dev libxslt-dev python-dev

libz-dev was missing!

Then I ran sudo -u plone_buildout bin/buildout again:

Updating instance.
Updating repozo.
Updating backup.
Updating zopepy.
Updating unifiedinstaller.
Updating precompiler.
Compiling Python files.
  File "/opt/plone/buildout-cache/eggs/zodbpickle-0.7.0-py2.7-linux-x86_64.egg/zodbpickle/pickletools_3.py", line 2049
    print("%5d:" % pos, end=' ', file=out)
                           ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/zodbpickle-0.7.0-py2.7-linux-x86_64.egg/zodbpickle/pickle_3.py", line 178
    def __init__(self, file, protocol=None, *, fix_imports=True):
                                             ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/zodbpickle-0.7.0-py2.7-linux-x86_64.egg/zodbpickle/tests/pickletester_3.py", line 145
    class use_metaclass(object, metaclass=metaclass):
                                         ^
SyntaxError: invalid syntax

Compiling locale files.
Error while compiling /opt/plone/buildout-cache/eggs/python_gettext-3.0-py2.7.egg/pythongettext/tests/test_escape.po
Error while compiling /opt/plone/buildout-cache/eggs/python_gettext-3.0-py2.7.egg/pythongettext/tests/test5.po
Updating setpermissions.
setpermissions: Running # Dummy references to force this to execute after referenced parts
echo /opt/plone/zinstance/var/backups yes > /dev/null
chmod 600 .installed.cfg
# Make sure anything we've created in var is r/w by our group
find /opt/plone/zinstance/var -type d -exec chmod 770 {} \; 2> /dev/null
find /opt/plone/zinstance/var -type f -exec chmod 660 {} \; 2> /dev/null
find /opt/plone/zinstance/var -type d -exec chmod 770 {} \; 2> /dev/null
find /opt/plone/zinstance/var -type f -exec chmod 660 {} \; 2> /dev/null
chmod 754 /opt/plone/zinstance/bin/*
Versions had to be automatically picked.
The following part definition lists the versions picked:
[versions]
plone.recipe.command = 1.1
plone.recipe.precompiler = 0.6

I had these SyntaxErrors as well when I started the upgrade. However, the site seems to function. So, can I ignore those errors?

1 Like

The syntaxerrors can be ignored. Usually they are for python scripts in a skins directory, which have a slightly different syntax that buildout complains about. Here they seem some files with python 3 syntax that fail on python 2. They are very likely not used, but buildout cannot know this.
Summary: ignore them.

1 Like

Thank you everybody for your help!

Development and production environment are equal now which will make my job a lot easier :smiley:

Hmmm, I celebrated a bit too early...

I checked whether I had to upgrade something and went to:
http://my_domain.com:8080/Plone/@@plone-upgrade

Upgrades were needed and the output repeated the same errors. From /opt/plone/zinstance/var/log/instance.log:

2018-04-09T17:02:40 ERROR GenericSetup Step plone.app.contenttypes--plone-content has an invalid import handler
2018-04-09T17:02:40 ERROR GenericSetup Step plone.app.contenttypes has an invalid import handler
2018-04-09T17:09:44 ERROR portlets Error while rendering <plone.app.portlets.manager.ColumnPortletManagerRenderer object at 0x7f551f87cf90>
2018-04-09T17:09:44 ERROR Zope.SiteErrorLog 1523286584.740.382116446658 http://localhost:1967/SolydXK/nl/login_form
2018-04-09T17:10:08 ERROR portlets Error while rendering <plone.app.portlets.manager.ColumnPortletManagerRenderer object at 0x7f551f899d50>
2018-04-09T17:10:08 ERROR Zope.SiteErrorLog 1523286608.250.552038902585 http://localhost:1967/SolydXK/nl/front-page/document_view

When I now login to the site I see that all text and images I had aligned in the center are now aligned to the left. Even when I manually align the text and images, the manually added css code is removed and everything is aligned to the left again.

I searched this forum and Googled for the messages but found nothing relevant.

Has anybody ever seen this behavior?

I think this traceback explains more about the portlets error:

Traceback (innermost last):
  Module plone.app.portlets.manager, line 54, in safe_render
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 137, in pt_render
  Module five.pt.engine, line 98, in __call__
  Module z3c.pt.pagetemplate, line 163, in render
  Module chameleon.zpt.template, line 261, in render
  Module chameleon.template, line 191, in render
  Module chameleon.template, line 171, in render
  Module 741063bf918cca552e7d50cece7df524.py, line 131, in render
  Module five.pt.expressions, line 161, in __call__
  Module plone.portlet.static.static, line 185, in transformed
  Module Products.PortalTransforms.TransformEngine, line 171, in convertTo
  Module Products.PortalTransforms.chain, line 48, in convert
  Module Products.PortalTransforms.Transform, line 199, in convert
  Module plone.outputfilters.transforms.html_to_plone_outputfilters_html, line 33, in convert
  Module plone.outputfilters, line 7, in apply_filters
  Module plone.outputfilters.filters.resolveuid_and_caption, line 118, in __call__
  Module sgmllib, line 104, in feed
  Module sgmllib, line 138, in goahead
  Module sgmllib, line 296, in parse_starttag
  Module sgmllib, line 338, in finish_starttag
  Module plone.outputfilters.filters.resolveuid_and_caption, line 343, in unknown_starttag
AttributeError: 'FormFolder' object has no attribute 'absolute_url'

 - Expression: "view/transformed"
 - Filename:   ... et.static-3.1.2-py2.7.egg/plone/portlet/static/static.pt
 - Location:   (line 3: col 28)
 - Source:     tal:content="structure view/transformed" />
                                      ^^^^^^^^^^^^^^^^
 - Arguments:  repeat: {...} (0)
               template: <ViewPageTemplateFile - at 0x7fe1316dc550>
               views: <ViewMapper - at 0x7fe12f5c0b50>
               modules: <instance - at 0x7fe13b389518>
               args: <tuple - at 0x7fe143e27050>
               here: <ImplicitAcquisitionWrapper nl at 0x7fe1330dc1e0>
               user: <ImplicitAcquisitionWrapper - at 0x7fe1333f1d20>
               nothing: <NoneType - at 0x5570cfb2c4d0>
               container: <ImplicitAcquisitionWrapper nl at 0x7fe1330dc1e0>
               request: <instance - at 0x7fe131c7b440>
               wrapped_repeat: <SafeMapping - at 0x7fe12f388b50>
               traverse_subpath: <list - at 0x7fe12ef154d0>
               default: <object - at 0x7fe143d43540>
               loop: {...} (0)
               context: <ImplicitAcquisitionWrapper nl at 0x7fe1330dc1e0>
               view: <Renderer - at 0x7fe12f5c0110>
               translate: <function translate at 0x7fe12f3259b0>
               root: <ImplicitAcquisitionWrapper Zope at 0x7fe133ca2910>
               options: {...} (0)
               target_language: <NoneType - at 0x5570cfb2c4d0>

The contenttypes errors might have something to do with this issue: https://github.com/plone/Products.CMFPlone/issues/2359

Still haven't found a solution to these errors yet: cannot align text or images.

I doubt that CMFPlone issue 2359 could be the culprit. If you updated to 5.1.0 exactly it can't be, although maybe it could if you aimed for 5.1-latest. Even if true it seems a long shot, I don't see any relation. Maybe you could try to pin plone.portlet.static to 3.1 - I don't see an obvious reason but at least it would be vaguely related to your trace. I have search a bit for FormFolder it seems to be related to PloneFormGen. Probably a more fruitful research than plone.portlet.static but I have no better idea about PloneFormGen, also many people use this add-on I'd think there would have been more noise if 5.1 has broken it.

I started again from 5.07 and upgraded to 5.1.1 (latest).

At the end I still had these errors:

2018-04-09T17:02:40 ERROR GenericSetup Step plone.app.contenttypes--plone-content has an invalid import handler
2018-04-09T17:02:40 ERROR GenericSetup Step plone.app.contenttypes has an invalid import handler

and aligning of text and images is still not possible. I'm afraid that I have to rebuild the site from scratch on Plone 5.1.1 :frowning_face:

Plone Foundation Code of Conduct