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
@Bernie_O That link was unfortunately not helpful. Do you have any other suggestions?
After looking at the error, it almost looks like one of the database maintenance jobs didnât run BackgroundCleanupjob. Is there a way to run that manually?
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!
@sunstar:
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.