Closed truenicoco closed 4 months ago
Can you paste a full trace of the installation using the --debug opton?
Apologies, I didn't see your reply. I don't really want to mess everything up now that I got it working. However, I can tell that this was on a vanilla bookworm-preinstalled Hetzner VPS, so it might be easy to reproduce…
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have an idea as to why this might be happening @truenicoco @tonioo
I've updated my server to Bookworm from Bullseye only yesterday and the only problem I had is all my python-dependent hosted applications started giving me this same error. I've managed to fix 2 out of 3 (the final one being Modoboa), after doing some research and finding out Python as a project has some issues when system administration is concerned. For the 2 apps I fixed, the problem was their virtual environments being broken/not being recognized (when I tried to install pip or other python plugins, the error I was getting is "externally-managed-environment"). So what I did was run the commands to create the virtual environment again and, in one case, changed the command for installing plugins from "python" to "python3.11". Pretty damn annoying change for Python if you ask me.
Still didn't get around to fixing Modoboa, as it seems a bit more complicated when not doing it step-by-step, but by installer. My best guess is some of the install scripts have to be edited to change lines concerning python and then sudo ./run.py --upgrade example.com
would fix it (recreate the virtual environment). I'm going to try to figure it out soon and I'll keep you posted if I do manage to fix it.
Finally got around to it today. There was no need for any editing of the installation scripts even. All I did was this:
sudo -u modoboa -i bash
(log in as the modoboa user)
python3.11 -m venv ./env
(create a new virtual environment with the updated version of Python)
exit
(back to your standard user)
cd .../modoboa-installer
(replace "..." with the path to where you cloned the modoboa-installer repository)
git pull
(update the installer)
sudo ./run.py --upgrade example.com
(replace "example.com" with your domain)
After the update completes, your Modoboa installation should now be up and running again!
Impacted versions
Steps to reproduce
Launch
./run.py example.com
, wait, it looks good… But then openingmail.example.com
in a browser shows a 500 error. Inspecting/var/log/uwsgi/app/modoboa_instance.log
shows:Following the advice here, I commented the line in 83 in
/srv/modoboa/env/lib/python3.11/site-packages/django/apps/registry.py
which revealed:I then attempted
/srv/modoboa/env/bin/pip install psycopg
, thensystemctl restart uwsgi
and now the uwsgi logs look OK, but in the browser I just see "Sorry, an internal error occured" (in French).In the end, I uninstalled postgresql, installed sqlite3 and relaunched the process, which seemed to work.