NextCloud Broken on Docker Zimaboard

Iā€™m not good with Linux so please explain what clearly what you need me to provide. Nextcloud in docker on a zimaboard running ubuntu fine for several months then today Iā€™m getting Internal Server Error messages if I try and open Nextcloud.

I can see mariaDB errors: ā€œAborted connection 5 to db: ā€˜unconnectedā€™ user: ā€˜unauthenticatedā€™ host: ā€˜172.21.0.3ā€™ (This connection closed normally without authentication)ā€

I have deleted these Nextcloud & MariaDB containers, I have deleted these images I have downloaded and redeployed the stack and then it wants me to create a Nextcloud admin account I get: "Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2054] Server sent charset (0) unknown to the client. Please, report to the developers "

So here I am wondering what its is Iā€™m supposed to do to fix this and why did it just suddenly break. This is frustrating me to no end I iā€™m not good with Linux but there is no other option but then its breaks and is a nightmare to fix.

I have the same problem, it seems to be linked to an update.
Nextcloud canā€™t connect to the database anymore

{"reqId":"<REDACTED>"
"level":3
"time":"2024-02-21T09:39:14+00:00"
"remoteAddr":"<REDACTED>"
"user":"--"
"app":"remote"
"method":"GET"
"url":"/status.php"
"message":"Exception thrown: Doctrine\\DBAL\\Exception"
"userAgent":"Mozilla/5.0 (Windows) mirall/3.4.0stable-Win64 (build 20211129) (Nextcloud
 windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)"
"version":"28.0.2.5"
"exception":{"Exception":"Doctrine\\DBAL\\Exception"
"Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2054] Server sent charset (0) unknown to the client. Please
 report to the developers"
"Code":2054
"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php"
"line":1654
"function":"connect"
"class":"OC\\DB\\Connection"
"type":"->"
"args":[]}
{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php"
"line":1081
"function":"getWrappedConnection"
"class":"Doctrine\\DBAL\\Connection"
"type":"->"
"args":[]}
{"file":"/var/www/html/lib/private/DB/Connection.php"
"line":261
"function":"executeQuery"
"class":"Doctrine\\DBAL\\Connection"
"type":"->"
"args":["SELECT * FROM `oc_appconfig`"
[]
[]
null]}
{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php"
"line":337
"function":"executeQuery"
"class":"OC\\DB\\Connection"
"type":"->"
"args":["SELECT * FROM `oc_appconfig`"
[]
[]
null]}
{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php"
"line":377
"function":"executeQuery"
"class":"Doctrine\\DBAL\\Query\\QueryBuilder"
"type":"->"
"args":[]}
{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php"
"line":280
"function":"execute"
"class":"Doctrine\\DBAL\\Query\\QueryBuilder"
"type":"->"
"args":[]}
{"file":"/var/www/html/lib/private/AppConfig.php"
"line":421
"function":"execute"
"class":"OC\\DB\\QueryBuilder\\QueryBuilder"
"type":"->"
"args":[]}
{"file":"/var/www/html/lib/private/AppConfig.php"
"line":187
"function":"loadConfigValues"
"class":"OC\\AppConfig"
"type":"->"
"args":[]}
{"file":"/var/www/html/lib/private/AppConfig.php"
"line":377
"function":"getApps"
"class":"OC\\AppConfig"
"type":"->"
"args":[]}
{"file":"/var/www/html/lib/private/App/AppManager.php"
"line":128
"function":"getValues"
"class":"OC\\AppConfig"
"type":"->"
"args":[false
"enabled"]}
{"file":"/var/www/html/lib/private/App/AppManager.php"
"line":149
"function":"getInstalledAppsValues"
"class":"OC\\App\\AppManager"
"type":"->"
"args":[]}
{"file":"/var/www/html/lib/private/legacy/OC_App.php"
"line":231
"function":"getInstalledApps"
"class":"OC\\App\\AppManager"
"type":"->"
"args":[]}
{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php"
"line":90
"function":"getEnabledApps"
"class":"OC_App"
"type":"::"
"args":[]}
{"file":"/var/www/html/lib/base.php"
"line":700
"function":"runInitialRegistration"
"class":"OC\\AppFramework\\Bootstrap\\Coordinator"
"type":"->"
"args":[]}
{"file":"/var/www/html/lib/base.php"
"line":1200
"function":"init"
"class":"OC"
"type":"::"
"args":[]}
{"file":"/var/www/html/status.php"
"line":37
"args":["/var/www/html/lib/base.php"]
"function":"require_once"}]
"File":"/var/www/html/lib/private/DB/Connection.php"
"Line":139
"CustomMessage":"Exception thrown: Doctrine\\DBAL\\Exception"}}

I think this is related to upgrade of mariadb image(in my case). I fixed it by changing this line in compose file(added --character-set-server=utf8)

command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW ā€“character-set-server=utf8

4 Likes

Thankyou very much gyterpena you saved me hours and likely was going to dump the zimaboard for Windows running a VMWARE Linux/docker image with Nextcloud as at least VMware can make snapshots to restore, just didnā€™t want my PC running 24/7/365 or deal with the hassle of Windows updates forcing and unexpected restart potential corrupting mariadb.

I entered : --character-set-server=utf8 at the end of my command, made a new stack in the web editor with your fix added and it all worked again, my command was:
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed --character-set-server=utf8

fixid it for me too, thanks a lot !

Its just a pity that an update to mariadb can break nextcloud, surely the solution is for nextcloud to have its own database rather than rely on a third party app.

Sorry for the noob question, to what compose file are you referring to?
Thanks

1 Like

found the answer on my question: the docker compose file

Its a yaml file that docker compose can run or in Portainer you can go to stack, add stack, name it nextcloud and in the web editor just paste in the contents of the yaml file then deploy. It will download the files and configure them.

thank you very much :pray: