Plone 5.1.2 crash after upgrade from 5.1.1

File "/opt/plone/buildout-cache/eggs/plone.app.upgrade-2.0.14.1-py2.7.egg/plone/app/upgrade/v41/betas.py", line 13, in from plone.app.upgrade.v40.betas import fix_cataloged_interface_names
File "/opt/plone/buildout-cache/eggs/plone.app.upgrade-2.0.14.1-py2.7.egg/plone/app/upgrade/v40/init.py", line 1, in import alphas
File "/opt/plone/buildout-cache/eggs/plone.app.upgrade-2.0.14.1-py2.7.egg/plone/app/upgrade/v40/alphas.py", line 14, in from Products.CMFPlone.setuphandlers import addCacheHandlers
File "/opt/plone/buildout-cache/eggs/Products.CMFPlone-5.1.2.1-py2.7.egg/Products/CMFPlone/setuphandlers.py", line 10, in from borg.localrole.utils import replace_local_role_manager
File "/opt/plone/buildout-cache/eggs/borg.localrole-3.1.5-py2.7.egg/borg/localrole/init.py", line 3, in from borg.localrole import workspace
File "/opt/plone/buildout-cache/eggs/borg.localrole-3.1.5-py2.7.egg/borg/localrole/workspace.py", line 14, in from Products.PlonePAS.interfaces.plugins import ILocalRolesPlugin
File "/opt/plone/buildout-cache/eggs/Products.PlonePAS-5.0.15-py2.7.egg/Products/PlonePAS/init.py", line 18, in from Products.PlonePAS.tools.membership import MembershipTool
File "/opt/plone/buildout-cache/eggs/Products.PlonePAS-5.0.15-py2.7.egg/Products/PlonePAS/tools/membership.py", line 34, in
from plone.protect.interfaces import IDisableCSRFProtection
File "/opt/plone/buildout-cache/eggs/plone.protect-3.1.3-py2.7.egg/plone/protect/init.py", line 6, in
from plone.protect.utils import protect
File "/opt/plone/buildout-cache/eggs/plone.protect-3.1.3-py2.7.egg/plone/protect/utils.py", line 63
exec(_buildFacade(name, spec, callable.doc), facade_globs)
SyntaxError: unqualified exec is not allowed in function 'call' it contains a nested function with free variables

if you are using a Python version < 2.7.9 upgrade to a newer version.
if you can't pin plone.protect to 3.1.2.
Upgrading python is better since a very old python is not very secure anyway.

1 Like

Thanks

My I know what is the best way to upgrade the python inside plone since it is download and built by the plone installer.

If you have used the 5.1.1 installer it downloads Python 2.7.14, that is new enough.
So it's unlikely the installer has downloaded Python. Check it in the install.log, or you should be able to get it with something like
zinstance/bin/python2.7 -V
if your version is > 2.7.8 that's another problem.

My plone is from an old installer and upgrade till now... I now manual build a Python 2.7.15 and copy them to replace the plone one hope it work without issue.

don't copy a new python in place of the old.
You have to backup your old Plone, build a new installation with new Python and restore there.

you can always use enother Python, you don't have to reinstall Plone for this.
All you need to setup Plone is setuptools in a virtualenv and zc.buildout package installed in it.
So you can create a vritualenv with what ever Python you want.

virtualenv -p /opt/python2.7.14/bin/python . --clear
./bin/pip install zc.buildout
./bin/buildout
2 Likes

You can also create the virtualenv somewhere else and work with an activated virtualenv if you want:

viritualenv venv
. venv/bin/activate
pip install zc.buildout
buildout bootstrap
./bin/buildout