Hey guys, I have been using Nextcloud on Ubuntu for quite a while. I have had few issues, but this time when I went to do the upgrade, I am getting a database error. I have scoured the boards looking for anything that I could use, but I have not been successful.
Here is the error that I get:
When upgrade run from the CLI
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘SELECT id FROM oc_jobs WHERE (class = ?) AND (argument = ?) LIMIT 1’ with params [“OC\Preview\BackgroundCleanupJob”, “null”]:
In the browser:
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘SELECT id FROM oc_jobs WHERE (class = ?) AND (argument = ?) LIMIT 1’ with params [“OC\Preview\BackgroundCleanupJob”, “null”]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Repair warning: Unable to clear the frontend cache
I have made sure that the MariaDB was in fact online and connected, but the error persists.
this is nearly equal (I think) to my error updating from Version 15 to 16.0.7:
Doctrine\DBAL\Exception\NotNullConstraintViolationException: An exception occurred while executing ‘INSERT INTO oc_jobs (class, argument, last_run, last_checked) VALUES(?, ?, ?, ?)’ with params [“OCA\DAV\BackgroundJob\RegisterRegenerateBirthdayCalendars”, “null”, 0, 1577979126]: SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value
I corrected the issue with a workaround. I never figured out what caused the issue, but moved the config.php to a backup and recreated the INSTALL_NOW file in the config directory. Then I hit the web interface and I was able to get the server up and running by adding the database information.
I thought that would still fail as it was a DB error, but apparently not…
In either case, if this happens to anyone, this should work for you!
Can you please describe more detailed what exactly you have done?
I`m running nextcloud on a shared webspace and with every single update I have massive DB errors, which could only be fixed by repairing all tables in PhpMyAdmin, waiting for the next error, repairing all tables in PhpMyAdmin, waiting, and so on. This took endless time…
Sure, I went to the nextcloud install directory, in my case /var/www/nextcloud and then I renamed the config.php file to something else and I restarted the apache service. Then I went to the web interface, and I was prompted for all the configuration settings/parameters (DB name, Admin name, etc). I used the same DB but I had to create a new admin account (The other still exists and you can clean it up after), then the server ran through the config and it came back up.
Then I disabled the new admin account that I had created.
This didn’t address the initial DB issues I was having, but it did workaround them, and correct any configuration issue that had existed.