Can't get Plone to run after Ubuntu upgrade

So this is a test server, but is a copy of my live server. I updated Ubuntu from 20.04 to 22.04 LTS. Afterwards, my site was down. When I tried to run “plonectl start” it said “Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding”

Chatgpt says I must rebuild Plone using the correct Python for 22.04. So this is what I did, with a little help for chatgpt:

sudo apt update
sudo apt install python3.10 python3.10-venv python3.10-dev build-essential libffi-dev libssl-dev
cd /opt/plone/zeocluster
rm -rf bin parts develop-eggs
python3.10 bootstrap.py

All good until the last command, then I get this response: python3.10: can't open file '/opt/plone/zeocluster/bootstrap.py': [Errno 2] No such file or directory

No problem, chatgpt tells me that Plone Unified Installer setup does not have bootstrap.py, because newer Plone 5 installs use virtualenv + buildout directly

So then I did this (as advised by chatgpt):

python3.10 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install zc.buildout==2.13.3
buildout

Whereupon I get this error message: “ModuleNotFoundError: No module named 'setuptools.package_index'“

Chatgpt tells me it’s just a Python/buildout compatibility issue. Whereupon I do the following:

source /opt/plone/zeocluster/.venv/bin/activate
pip install "setuptools<65" --upgrade
buildout

Whereupon I get a really long output, but ultimately an error: ImportError: cannot import name 'main' from 'setuptools.command.easy_install'
ValueError: not enough values to unpack

Back to chatgpt, and more commands…

rm -rf parts develop-eggs eggs .installed.cfg
source /opt/plone/zeocluster/.venv/bin/activate
pip install --upgrade "setuptools<65" "wheel<1.0" "zc.buildout==2.13.3"
python3.10 -m buildout

Whereupon it gives me “/opt/plone/zeocluster/.venv/bin/python3.10: No module named buildout”

When I ask chatgpt again, it gives me a variation of the same answer pretty much… so I’m not sure where to go from here. Maybe I’m missing something simple. Any help will be much appreciated!

PS, I am running:

Plone 5.2.2 (5209)
CMF 2.4.8
Zope 4.5.1
Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
PIL 6.2.2 (Pillow)
WSGI: On
Server: waitress 1.4.4

Plone 5.2 does not work with Python 3.10. Python 3.8 is the highest support Python version for Plone 5.2 afaik. Likely you need to install Python 3.8 manually from the Python sources and setup your virtualenv manually, and re-run the universal installer from that..and ChatGPT should have told you about the version incompatibility in the first place.

What you can do is to install python 3.8 (for example with pyenv) and then link the buildout python executable to it instead to non existing python 3.8 or default python.

Thank you @zopyx and @yurj ! I’ll try that

1 Like