Nasty error while migrating to Ubuntu 22.04 - Fixed

I went through the migration process from v57a on Ubuntu 18.04 to v62 on Ubuntu 22.04.

Everything seems to work, except at the last step in Mail-in-a-Box Maintenance Guide

sudo mailinabox

I get this nasty error (see 4th last line).

Updating system packages...
Installing system packages...
Initializing system random number generator...
Firewall is active and enabled on system startup
Synchronizing state of fail2ban.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable fail2ban
Installing nsd (DNS server)...
Installing Postfix (SMTP server)...
Installing Dovecot (IMAP server)...
Installing OpenDKIM/OpenDMARC...
Installing SpamAssassin...
Installing Nginx (web server)...
Installing Roundcube (webmail)...
wal
Installing Nextcloud (contacts/calendar)...
Upgrading Nextcloud --- backing up existing installation, configuration, and database to directory to /home/user-data/owncloud-backup/2023-05-20-22:09:30...

Upgrading to Nextcloud version 21.0.7

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Doctrine\DBAL\Exception\NotNullConstraintViolationException: An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: oc_calendar_appt_configs.visibility
Update failed
Maintenance mode is kept active
Resetting log level

Right now, the admin panel is working, but mail, contacts and calendar web interfaces are not working with a “502 Bad Gateway nginx” error.

Have repeated the steps twice and both times got the same outcome. Any ideas?

What happens if you run mailinabox again?

The same thing. I have actually repeated this with a new installation of Ubuntu 22.04 twice. Running mailinabox two or even three times at the end results in the same error every time.

The error is not happening on the first run of mailinabox (when its installed on a new server). Only after I restore backup files, then running mailinabox results in this error.

Okay, I have avoided this issue by starting from a fresh Ubuntu 22.04 and installing v61.1.

Instructions for this are on github. Basically clone repo, checkout v61.1 and run the install script.

In the last step of the guide, I wasn’t sure if running mailinabox would automatically try to upgrade to v62, so I set the environment variable $TAG=“v61.1” (see notes inside https://mailinabox.email/setup.sh). I have no idea if this helped, but I am still on v61.1.

I still have the DANE TLSA record and MTA-STS policy errors, but I will refer to other threads for them.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.