Jump to content
linuxserver.io

[Support] Linuxserver.io - MariaDB

335 posts in this topic Last Reply

Recommended Posts

I have had Nextcloud running for a good 8 months.  The other day it stopped working, the apps wouldnt connect.  I cannot bring up the web-gui either.

I started looking at the logs withing the dockers of unraid and the maria db is full of these:

 

190802 07:57:50 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:57:51 mysqld_safe Logging to syslog.
190802 07:57:51 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:57:56 mysqld_safe Logging to syslog.
190802 07:57:56 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:57:57 mysqld_safe Logging to syslog.
190802 07:57:57 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:57:58 mysqld_safe Logging to syslog.
190802 07:57:58 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:58:03 mysqld_safe Logging to syslog.
190802 07:58:03 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:58:04 mysqld_safe Logging to syslog.
190802 07:58:04 mysqld_safe Starting mysqld daemon with databases from /config/databases

 

over and over, and the nextcloud log has this:

 

 

-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid: 99
User gid: 100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 40-config: executing...
[cont-init.d] 40-config: exited 0.
[cont-init.d] 50-install: executing...
[cont-init.d] 50-install: exited 0.
[cont-init.d] 60-memcache: executing...
[cont-init.d] 60-memcache: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2006] MySQL server has gone away in /config/www/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /config/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver in /config/www/nextcloud/lib/private/DB/Connection.php on line 64
PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2006] MySQL server has gone away in /config/www/nextcloud/lib/private/DB/Connection.php:64

over and over......

 

I restarted the containers, no improvement.

I did notice that my 256 Gb SSD cache drive was mostly full and had 410Mb free.. so I invoked the Move Now and now have 215Gb free

but stopping and restarting the containers still yields still doesnt help and the log files look the same.

 

The system has a fair amount of data on it and I'd like to get it going without having to start over.

Any help is greatly appreciated,

 

Thanks, 

 

George

Share this post


Link to post
On 8/2/2019 at 8:08 AM, GTM said:

I have had Nextcloud running for a good 8 months.  The other day it stopped working, the apps wouldnt connect.  I cannot bring up the web-gui either.

I started looking at the logs withing the dockers of unraid and the maria db is full of these:

 

190802 07:57:50 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:57:51 mysqld_safe Logging to syslog.
190802 07:57:51 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:57:56 mysqld_safe Logging to syslog.
190802 07:57:56 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:57:57 mysqld_safe Logging to syslog.
190802 07:57:57 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:57:58 mysqld_safe Logging to syslog.
190802 07:57:58 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:58:03 mysqld_safe Logging to syslog.
190802 07:58:03 mysqld_safe Starting mysqld daemon with databases from /config/databases
190802 07:58:04 mysqld_safe Logging to syslog.
190802 07:58:04 mysqld_safe Starting mysqld daemon with databases from /config/databases

 

over and over, and the nextcloud log has this:

 

 

-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid: 99
User gid: 100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 40-config: executing...
[cont-init.d] 40-config: exited 0.
[cont-init.d] 50-install: executing...
[cont-init.d] 50-install: exited 0.
[cont-init.d] 60-memcache: executing...
[cont-init.d] 60-memcache: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2006] MySQL server has gone away in /config/www/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /config/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver in /config/www/nextcloud/lib/private/DB/Connection.php on line 64
PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2006] MySQL server has gone away in /config/www/nextcloud/lib/private/DB/Connection.php:64

over and over......

 

I restarted the containers, no improvement.

I did notice that my 256 Gb SSD cache drive was mostly full and had 410Mb free.. so I invoked the Move Now and now have 215Gb free

but stopping and restarting the containers still yields still doesnt help and the log files look the same.

 

The system has a fair amount of data on it and I'd like to get it going without having to start over.

Any help is greatly appreciated,

 

Thanks, 

 

George

Bumping this topic cause I'm having this issue. 

 

Updated Nextcloud and when I went to run the update, mariadb has "gone away" while trying to update the db.

 

Restarting the docker does nothing. 

 

I logged into the docker via command line and noticed mariadb was stopped.  Trying to start the docker produces a fail. 

 

Any idea what could be wrong?

 

Thanks, 

EDS

 

 

 

Share this post


Link to post

Hey Ed,

 

No idea what is going on with your particular situation, but even though different, it has a similarity. I think the problem is the upkeep of the docker containers. I gave up on the PHP problem with nextcloud docker, and installed nextcloud onto a  virtual machine within unraid via an Ubuntu server dedicated to serving nextcloud. I used the chris titus nextcloud video on youtube which uses a snap install, along with mapped a share on the unraid aray where the nextcloud-ubuntu could store the files. its working great and I don't have to worry about unraid bumping the PHP up to high out of reach of my current docker container any more.   THAT SUCKED and who ever is in charge of the containers (keeping things compatible) should have put a PHP version in the container or something like that to prevent incompatibilities like that.

 

if you need any pointers on how to do what I was able to accomplish, let me know.  george dot t dot miller at preventionit dot com is my email addy.

 

keep smiling and good luck,

 

George

Share this post


Link to post
1 hour ago, GTM said:

Hey Ed,

 

No idea what is going on with your particular situation, but even though different, it has a similarity. I think the problem is the upkeep of the docker containers. I gave up on the PHP problem with nextcloud docker, and installed nextcloud onto a  virtual machine within unraid via an Ubuntu server dedicated to serving nextcloud. I used the chris titus nextcloud video on youtube which uses a snap install, along with mapped a share on the unraid aray where the nextcloud-ubuntu could store the files. its working great and I don't have to worry about unraid bumping the PHP up to high out of reach of my current docker container any more.   THAT SUCKED and who ever is in charge of the containers (keeping things compatible) should have put a PHP version in the container or something like that to prevent incompatibilities like that.

 

if you need any pointers on how to do what I was able to accomplish, let me know.  george dot t dot miller at preventionit dot com is my email addy.

 

keep smiling and good luck,

 

George

George. 

 

Thanks for your reply. 

 

After a good 24 hours of messing with the docker I was finally able to figure it out.  Basically the nextcloud update "broke" one of the nextcloud tables which then caused mysql to run a mysql_safe boot loop.  

 

The fix was to backup the nextcloud db, delete the old db and then create it anew from the backup. 

 

Regards, 

EDS

Share this post


Link to post
18 hours ago, GTM said:

Hey Ed,

 

No idea what is going on with your particular situation, but even though different, it has a similarity. I think the problem is the upkeep of the docker containers. I gave up on the PHP problem with nextcloud docker, and installed nextcloud onto a  virtual machine within unraid via an Ubuntu server dedicated to serving nextcloud. I used the chris titus nextcloud video on youtube which uses a snap install, along with mapped a share on the unraid aray where the nextcloud-ubuntu could store the files. its working great and I don't have to worry about unraid bumping the PHP up to high out of reach of my current docker container any more.   THAT SUCKED and who ever is in charge of the containers (keeping things compatible) should have put a PHP version in the container or something like that to prevent incompatibilities like that.

 

if you need any pointers on how to do what I was able to accomplish, let me know.  george dot t dot miller at preventionit dot com is my email addy.

 

keep smiling and good luck,

 

George

I'm not sure what you are talking about regarding nextcloud, php and unraid version of php. If you are talking of our nextcloud container, php is built in to the container, but if you don't keep nextcloud updated, you will get a problem when the php version in the container is too new for the Nextcloud version you are using.

 

Updating nextcloud is a manually process, either through the Webui or command line.

 

Share this post


Link to post

Hi

I would like to change the mysql container by mariadb container.

I have two databases : nextcloud and ttrss

Is there a tutorial to backup, install the new container et import the data ?

Thanks

Share this post


Link to post
52 minutes ago, deadnote said:

Hi

I would like to change the mysql container by mariadb container.

I have two databases : nextcloud and ttrss

Is there a tutorial to backup, install the new container et import the data ?

Thanks

Sorry, but we don't have any guides for how to migrate from mysql to mariadb.

Your best bet is to find something using Google and be careful when following the guide in case they don't mention anything docker related.

Share this post


Link to post

Ok, I exported databases with phpmyadmin.

Can I restore them in mariadb in command line ? Can't do it with Phpmyadmin, files are more than 2Mb.

Thanks for you help

Share this post


Link to post

Well, it's my turn to ask for help... Sigh...😞. Real pain for me so far. All of a sudden, my mariadb used for Nextcloud stopped working. I don't know that caused this. I managed to find in the .err log that a pending transaction needed to commit or rollback. I commited it. Now, I see this in the unRAID docker logs and Nextcloud don't work:

[services.d] starting services
[services.d] done.
191103 18:21:44 mysqld_safe Logging to syslog.
191103 18:21:44 mysqld_safe Starting mysqld daemon with databases from /config/databases

It's been a week or so that I'm working to fix this and I'm a the cross roads to start from scratch or still trying to fix this s**t.

I have the data files that goes in Nextcloud, but I'm wondering: Do I have to both start mariadb AND Nextcloud with fresh instances?

 

Note at the moment, I do not have any backups as I'm waiting new gear to complete my setup.

 

If you think this can be an easy fix, it would be appreciated. Otherwise, new instances will be deployed.

 

Thank you.

 

EDIT:

Did some "Docker Safe Permission" with the CA Plugin. Don't know if because of this, but I'm able to connect to Nextcloud. But, mariadb still have the mysqld_safe status in the log.

Edited by Yanos!

Share this post


Link to post

Noob here:

1.) What commands can be used in the Shell version of the _Console?

2.) After creating a new database or two, what is the best way to check if they were created correctly? Is there a SHOW ALL DATABASES command or something or a way to look at the properties of the databases?

 

Share this post


Link to post
28 minutes ago, Bugman1400 said:

Noob here:

1.) What commands can be used in the Shell version of the _Console?

2.) After creating a new database or two, what is the best way to check if they were created correctly? Is there a SHOW ALL DATABASES command or something or a way to look at the properties of the databases?

 

 

You need to check the MariaDB documentation for how to connect to the database. You can do this through the console or remotely.

Share this post


Link to post

Are you saying there is an SQL client built into the Shell part of the _Console? Or, would I use the Bash part of the _Console to invoke a third party SQL client?

Share this post


Link to post
1 hour ago, Bugman1400 said:

Are you saying there is an SQL client built into the Shell part of the _Console? Or, would I use the Bash part of the _Console to invoke a third party SQL client?

Using the console entry in the menu takes you inside the container. Same as docker exec using SSH to unraid.

MariaDB has a built in client, but refer to the MariaDB documentation for how to use it.

Share this post


Link to post

Hi,  I'm hoping someone can point me in the right direction.

 

I've been using MariaDB for my Kodi DB for quite a while.  It has been working flawlessly.

 

I was previously on unraid 6.6.7.  I decided to try 6.8.0 and I am having significant delays.  The database still seems to work but navigation is painfully slow.

 

The Kodi debug log has a heap of:

08:37:48 T:12968   ERROR: XFILE::CDirectory::GetDirectory - Error getting
08:37:48 T:12968   DEBUG: Mysql execute: update path set strHash='32F3B34619D467170987912917379272' where idPath=1043
08:37:48 T:12968   DEBUG: VideoInfoScanner: Rescanning dir 'smb://CHENBRO-SVR/Videos/TV/Alias/Alias - Season 1/' due to change (424AAB591D987498C8742162F38DEE51 != 25119B5BB14B23D4E08A3978AC75E267)

 

and delays like this:

09:09:35 T:10360   DEBUG: CVideoDatabase::RunQuery took 2453 ms for 469 items query: SELECT * FROM tvshow_view

 

I'm also getting:

09:08:52 T:10360   ERROR: C:\Users\Lucifer\AppData\Roaming\Kodi\addons\script.module.requests\lib\requests\packages\urllib3\util\ssl_.py:133: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning

 

Rolling back to 6.6.7 fixes everything.  So i'm not sure if my problem is with the way I have setup kodi, unraid or the MariaDB docker.

 

Thanks for your help.

Share this post


Link to post

Hi!

 

I have a project where I need to access the database from another host. ie not the same IP but I am not able to do that... I get an error saying i do not have permission to acess. Even though I have set the database to not only allow the same ip...

 

Could someone help me with this?

 

BR Alfred

Share this post


Link to post

I can't log in to mariadb using mysql -uroot -p.  I seem to have made an error during setup, as the password in my password manager (which matches what I have set for MYSQL_ROOT_PASSWORD) doesn't work.

 

Is there a way to reset the root mysql password?  Alternatively, can I just nuke my existing mariadb install but maintain my nextcloud database by backing up /mnt/user/appdata/mariadb/databases/nextcloud/ and replacing it after setting up a new mariadb container?

Edited by deepthought

Share this post


Link to post
14 hours ago, deepthought said:

I can't log in to mariadb using mysql -uroot -p.  I seem to have made an error during setup, as the password in my password manager (which matches what I have set for MYSQL_ROOT_PASSWORD) doesn't work.

 

Is there a way to reset the root mysql password?  Alternatively, can I just nuke my existing mariadb install but maintain my nextcloud database by backing up /mnt/user/appdata/mariadb/databases/nextcloud/ and replacing it after setting up a new mariadb container?

Not sure if this thread is monitored anymore.  

Share this post


Link to post
2 hours ago, ZosoPage1963 said:

Not sure if this thread is monitored anymore.  

I'm sure NSA is still monitoring this thread.

  • Like 1
  • Haha 1

Share this post


Link to post

Had multiple linuxserver containers fail to start following their latest updates, including mariadb, jackett, and airsonic with no changes in configuration or environment. All print the same:

standard_init_linux.go:190: exec user process caused "exec format error"

This is usually caused by running a container with an incompatible architecture; however, even when the correct architecture is specified the container fails to start. Same result is observed no matter what architecture is specified. Running amd64.

 

Rolling back to mariadb 110.4.12mariabionic-ls50 works, likewise with airsonic v10.5.0-ls48 and jackett v0.12.1638-ls51.

Share this post


Link to post
1 hour ago, kyle1 said:

Had multiple linuxserver containers fail to start following their latest updates, including mariadb, jackett, and airsonic with no changes in configuration or environment. All print the same:


standard_init_linux.go:190: exec user process caused "exec format error"

This is usually caused by running a container with an incompatible architecture; however, even when the correct architecture is specified the container fails to start. Same result is observed no matter what architecture is specified. Running amd64.

 

Rolling back to mariadb 110.4.12mariabionic-ls50 works, likewise with airsonic v10.5.0-ls48 and jackett v0.12.1638-ls51.

 

I have no issues here updating airsonic. So this might be a issue related to your configuration.

What is your docker run commands for them?

Edited by saarg

Share this post


Link to post
7 hours ago, saarg said:

What is your docker run commands for them?

Glad to hear it seems to be somewhat isolated!

 

Nothing stands out to me in my config; it is the same one I've been using for over a year. Given that older versions still work correctly I'm thrown for a bit of a loop on this one. Let me know if you see anything there.

 

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='airsonic' --net='br0.50' --ip='XX.XX.XX.XX' -e TZ="XX/XX" -e HOST_OS="Unraid" -e 'PUID'='99' -e 'PGID'='100' -e 'CONTEXT_PATH'='music' -e 'JAVA_OPTS'='-Xms256m -Xmx512m' -e 'TCP_PORT_4040'='4040' -v '/mnt/user/Music/':'/music':'rw' -v '/mnt/user/Music/Playlists/':'/playlists':'rw' -v '/mnt/user/Music/Podcasts/':'/podcasts':'rw' -v '/mnt/user/Music/':'/media':'rw' -v '/mnt/user/appdata/airsonic':'/config':'rw' 'linuxserver/airsonic' 

 

Do you have any insight into what changed in the most recent update?

Share this post


Link to post
46 minutes ago, kyle1 said:

Glad to hear it seems to be somewhat isolated!

 

Nothing stands out to me in my config; it is the same one I've been using for over a year. Given that older versions still work correctly I'm thrown for a bit of a loop on this one. Let me know if you see anything there.

 


root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='airsonic' --net='br0.50' --ip='XX.XX.XX.XX' -e TZ="XX/XX" -e HOST_OS="Unraid" -e 'PUID'='99' -e 'PGID'='100' -e 'CONTEXT_PATH'='music' -e 'JAVA_OPTS'='-Xms256m -Xmx512m' -e 'TCP_PORT_4040'='4040' -v '/mnt/user/Music/':'/music':'rw' -v '/mnt/user/Music/Playlists/':'/playlists':'rw' -v '/mnt/user/Music/Podcasts/':'/podcasts':'rw' -v '/mnt/user/Music/':'/media':'rw' -v '/mnt/user/appdata/airsonic':'/config':'rw' 'linuxserver/airsonic' 

 

Do you have any insight into what changed in the most recent update?

 

The older version probably works as it might have been on your system still.

Nothing have changed in the build system recently as far as I know.

Have you tried rebooting your server and then update again?

Share this post


Link to post

Maybe I missed the recommendation but if we install several dockers that require a database, should we install a new instance of this docker? i.e. If I have Nextcloud and Piwigo installed should I have two instances of the mariadb docker running each with a single database, or is it better to run multiple databases within a single mariadb docker?

Share this post


Link to post
17 hours ago, thunderclap said:

Maybe I missed the recommendation but if we install several dockers that require a database, should we install a new instance of this docker? i.e. If I have Nextcloud and Piwigo installed should I have two instances of the mariadb docker running each with a single database, or is it better to run multiple databases within a single mariadb docker?

No need to run two instances, one instance works just fine with multiple databases.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.