[SOLVED| Update fails because of database error

Nextcloud version (eg, 10.0.2): 11.0.3
Operating system and version (eg, Ubuntu 16.04): Debian 9
Apache or nginx version (eg, Apache 2.4.25): 2.4.10-10+deb8u7
PHP version (eg, 5.6): PHP 5.6.30-0+deb8u1 (cli) (built: Feb 8 2017 08:50:21
Is this the first time you’ve seen this error?: yes

Can you reliably replicate it? (If so, please outline steps):
I am trying to update from 11.0.3 to 11.0.5 via web-frontend. When I click on update, I get an error. I tried via command line (och upgrade) and obviously, there is a problem with the database, but as I am not that deep into this, I hope that somebody can help me

The issue you are facing:
Error on command line:

Starting code integrity check…
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘UPDATE oc_appconfig SET configvalue = ? WHERE (appid = ?) AND (configkey = ?) AND (configvalue <> ?)’ with params ["{“core”:{“FILE_MISSING”:{“3rdparty\/.drone.yml”:{“expected”:“a6efa0cb783eceafde6177520e8e7cebc9aca6dd389771dd3c62b8f31437d01bfb051cb66d289a2f804cb6b8afd054c9a2bdc45dc8a19d3a0e00c2aa0afe4287”,“current”:""},“3rdparty\/.gitignore”:{“expected”:“91e98724bdd3a1a5284c91d32696e2fc9c847f7ff55a5a644375909f6c6f8ae9442aba2f1f8636f6ca67da0fb7fb0a184462aee026ae054e0916fcc951728384”,“current”:""},“3rdparty\/LICENSE INFO”:{“expected”:“4cc4d56d3b31ac98c6b7183df89e73b48e25c392d1fefabf7eff01fa1d40eceff0d77a67d53b0529d4e69b5bdc49d6948c76e54737e83a414c27379e18fa4d57”,“current”:""},“3rdparty\/README.md”:{“expected”:“3dea4e606292d1c4466912cf3a5897735a9a760522cd33e667b6951ddcc3ff81b781f1d43e1ec63146d3f344af66d57aad9027ead5f33e89a169fdde12c4c068”,“current”:""},“3rdparty\/autoload.php”:{“expected”:“ba4d34ac47d76b42be4a1d0147afe8d805b6891b436c60d13de79a8976fe261f6237623d2dc12e714b3ad0de917296f4132781faad45832c75187fd034672ce9”,“current”:""},“3rdparty\/bantu\/ini-get-wrapper\/.gitignore”:{“expected”:“e4c4021b3dac22d0521301fc6fd2f0d0c8943d68f927368929df0b385e54e7764a768069cde5b0027eb5701324af2f6a7a5c175009f10e5a25742195eb3f1dce”,“current”:""},“3rdparty\/bantu\/ini-get-wrapper\/.scrutinizer.yml”
[…some many lines heres…]
{“expected”:“0240befbdeb79e9208aba654fd01546f03ce40cdcaebd8dc06f035aedecaf8a518995d1fb4106537a42f904939fb573715bcdcda8b98f9bb461a08e1a1867445”,“current”:""},“3rdparty\/symfony\/routing\/RouterInterface.php”:{“expected”:“50bc1872c2ecfa4253d4d38454a0df845c2dfae4ba16e443f6930fe1fe2cae0da95a04eec38479b5baf52c8ea99910ad6f5615df37f00efc89597e47a3671e4b”,“current”:""}}}}"]:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Update failed

Is there anything I can do about this?

The output of your Nextcloud log in Admin > Logging:
Cannot log in anymore

I searched quite around and found a possible solution: Setting the “max_allowed_packet” in my database solved the problem.

I am using a mariadb and to change this I used the following line in sql:

set global max_allowed_packet=33554432;

To set it back to the initial value I had:

set global max_allowed_packet= 1048576;

Also, I changed the following values:

memory_limit to 512M
max_execution_time to 180
upload_max_size to 64M
max_input_time to 300

I order to find these values on your system, you may use on command line:

$ grep -r “” /etc/*

And then change it back. I recommend to copy the initial line and comment it out so that you have stored the initial value.