docker icon indicating copy to clipboard operation
docker copied to clipboard

mariaDB errors: “Aborted connection 5 to db: ‘unconnected’ user: ‘unauthenticated’ host: ‘172.21.0.3’ (This connection closed normally without authentication)”

Open lhoupert opened this issue 1 year ago • 11 comments

Since the recent update or MariaDb (11.3.2) the connectivity broke down between nextcloud and mariadb.

This can be fixed by adding addition flag to the mariadb command --character-set-server=utf8

A solution would be to update the example docker compose file with these arguments

    image: mariadb:11.3.2
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW --character-set-server=utf8

All credits for this solution go to Gypertena's reply on the nextcloud discourse .

lhoupert avatar Feb 21 '24 12:02 lhoupert

I just raised a PR to edit the docker-compose files given as example. Let me know if I missed something.

lhoupert avatar Feb 21 '24 12:02 lhoupert

Thx helped me also is in another docker container with the same problem

zackmuc avatar Feb 21 '24 13:02 zackmuc

Thanks, helped me. Can confirm that it works with your changes.

Kitt3120 avatar Feb 21 '24 17:02 Kitt3120

Thanks a lo! Fixed also my issue with nextcloud that after update was just showing Internal Server Error in the browser.

sloniupl avatar Feb 21 '24 18:02 sloniupl

Thank you so much, you've just saved me hours of headaches! Well done

CooperBarrett avatar Feb 21 '24 22:02 CooperBarrett

It took me a couple of hours to understand what was happening until I found a post on a discourse (unfortunately I don't have the link anymore). The author of the post is the one to thank :-)

Edit: I found the orginal post, I just updated the description of the issue

lhoupert avatar Feb 21 '24 23:02 lhoupert

thank you very much!

i add the nextcloud log error message so that more people can find this solution through google:

Doctrine\DBAL\Exception: 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 in /var/www/html/lib/private/DB/Connection.php:140

celevra avatar Feb 22 '24 06:02 celevra

Glad you all found a solution but:

  • 11.3.x is a short-term release series
  • good practice is to stick with LTS release trees of MariaDB unless you have a good reason not to
  • Nextcloud Server has specific DB version requirements already, and 11.3 is definitely not on that list: https://docs.nextcloud.com/server/latest/admin_manual/installation/system_requirements.html#server

In other words, this shouldn't occur if you stick with supported DB versions. :-)

joshtrichards avatar Feb 26 '24 12:02 joshtrichards

FYI: MariaDB reverted the change in their image so new pulls already have it fixed there: https://github.com/MariaDB/mariadb-docker/pull/565

joshtrichards avatar Feb 26 '24 13:02 joshtrichards

Glad you all found a solution but:

  • 11.3.x is a short-term release series
  • good practice is to stick with LTS release trees of MariaDB unless you have a good reason not to
  • Nextcloud Server has specific DB version requirements already, and 11.3 is definitely not on that list: https://docs.nextcloud.com/server/latest/admin_manual/installation/system_requirements.html#server

In other words, this shouldn't occur if you stick with supported DB versions. :-)

unfortunately the default docker-compose solutions (that I use for more than 3 years) had mariadb:latest in them. So now I'm already on 11.3 and there is no easy way back to LTS...

:-(

logopk avatar Feb 26 '24 14:02 logopk

https://mariadb.org/post-mortem-php-and-mariadb-docker-issue/

joshtrichards avatar Feb 27 '24 19:02 joshtrichards

So now I'm already on 11.3 and there is no easy way back to LTS...

You can just dump the Nextcloud DB and import it on an LTS version, can't you?

J0WI avatar Mar 04 '24 21:03 J0WI

Closing since there's nothing to be done here in the Docker image. Also, all references to mariadb in our example Composer files are tagged with a specific version (10.6.) presently.

joshtrichards avatar May 06 '24 15:05 joshtrichards

In other words, this shouldn't occur if you stick with supported DB versions. :-)

Is should be also noted that MariaDB latest was by default in this repo until July 2021 https://github.com/nextcloud/docker/commit/1a432d98fa98563182a56bdeab2b00d446a33e75

mr-flibble avatar May 07 '24 08:05 mr-flibble