[Support] Linuxserver.io - MariaDB


Recommended Posts

I have the exact same issue as ScotlandThomas.  One more thing.  Reading through the thread i saw where you advised someone to rename their err files. So i tried to do that.  I went into the container and this is what I got.  It looks like the databases folder doesn't exist in the config folder, but when I browse to it from outside the container it is there with some files. 

 

root@1d4faab77f3a:/# ps -ef | grep mysql
root        18     1  0 23:40 ?        00:00:00 grep --color=auto mysql
root@1d4faab77f3a:/# cd /config
root@1d4faab77f3a:/config# ls
root@1d4faab77f3a:/config# cd /config/databases
bash: cd: /config/databases: No such file or directory
root@1d4faab77f3a:/config# mysql -u root -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
root@1d4faab77f3a:/config# 

 

It looks like for some reason the docker isnt seeing the database folder?  It exists in the appdata folder where it is supposed to be.  I'm pulling my hair out.  My appdata is cache only. 

 

EDIT: So, I tried the linuxserver mysql docker and Needo's MariaDB docker and they both behave the exact same way with the exact same error message.  And all of the log files stop at this line:

 

Starting MariaDB...
151226 20:13:26 mysqld_safe Logging to '/db/mysql_safe.log'.
151226 20:13:26 mysqld_safe Starting mysqld daemon with databases from /db

 

EDIT2:  Ok, so after much head scratching and experimenting, I finally have something working.  So apparently you cant run the mysql -u root -p command from inside the docker.  I had to download MySql Workbench to my desktop, create the xbmc user, give it the permissions and then things started working with the MySql docker. 

58aad7bf87942_Screenshot_from_2015-12-26_190401.jpg.56ba65a9daeef0ba0aaa4199a3067f40.jpg

58aad7bf8c69b_Screenshot_from_2015-12-26_190712.jpg.95b69bf122cde4c0b07c2411068ed385.jpg

Link to comment

Take a look at https://github.com/owncloud/core/issues/16008#issuecomment-98844031.

Not a db expert myself, but it seems the better setting depends on the usage scenario.

BTW - is there a guide to replication between mariadb containers on different servers?

 

Sparklyballs and I have talked about this at length, the long and the short of it is this.  Owncloud have broken their database interface requiring a change to the MariaDB/MySQL setup, unfortunately the change that is required will affect every other database on the system.  Changing MariaDB to be compatible with a fault within Owncloud just seems fundamentally wrong and is not something we will be doing, as this may have deleterious effects on other programs which use MariaDB.

 

At the present time, you could use an older version of MariaDB like Sparklyballs version with webmin built in, which is what I'm currently doing, and if you want you could still run the up to date LS.io version on a different port for every other application.  Sparklyballs is also I know looking at another possible solution which we are still testing....

Link to comment

Take a look at https://github.com/owncloud/core/issues/16008#issuecomment-98844031.

Not a db expert myself, but it seems the better setting depends on the usage scenario.

BTW - is there a guide to replication between mariadb containers on different servers?

 

Sparklyballs and I have talked about this at length, the long and the short of it is this.  Owncloud have broken their database interface requiring a change to the MariaDB/MySQL setup, unfortunately the change that is required will affect every other database on the system.  Changing MariaDB to be compatible with a fault within Owncloud just seems fundamentally wrong and is not something we will be doing, as this may have deleterious effects on other programs which use MariaDB.

 

At the present time, you could use an older version of MariaDB like Sparklyballs version with webmin built in, which is what I'm currently doing, and if you want you could still run the up to date LS.io version on a different port for every other application.  Sparklyballs is also I know looking at another possible solution which we are still testing....

 

Are you suggesting running multiple instances of the container, one for each application?

Haven't thought of this option, actually...

 

Link to comment
  • 3 weeks later...

Recently had a bit of a strange issue with the mariadb container.

 

It's had been running fine for weeks, ever since migrating to it from a container from another author.

 

Yesterday I did the upgrade to unRAID 6.1.7, so during the course of stopping the array to reboot the dockers were stopper. The upgrade went to plan, rebooted the server, started the array again and all of my docker containers came back up - or so I thought.

 

It was only some hours later that I noticed something was wrong with the mariadb container. Looking in the logs (which I don't have to hand unfortunately) I saw continuous, repeated, failed attempts to start mariadb.

 

There was a log message about it having not been shutdown cleanly (sorry I don't have the exact text), with messages about recovering from a crash, and then each attempt to start was followed by a message saying that the table mysql.users didn't exist (again sorry for not having the exact text).

 

Looking at the /config/databases folder I saw that the owner of the mysql directory had been changed from 'nobody' to '103' - 103 seems to be the uid of the mysql user inside the container. "chown -R nobody:users mysql" fixed the complaint about the mysql.users table. But then there was a similar message about another mysql.*something* table, and when I looked the owner of the mysql folder had changed to 103 again.

 

Changing the owner back to nobody this time fixed things and mariadb started up correctly.

 

I suspect that what happened was that there was an unclean shutdown (of mariab) and when starting up again it attempted to recover and during that process tries to ensure that it has correct access so changes the owner of the folder to the mysql user. Which then leads to access problems and stops it accessing those mysql.* tables.

 

I wonder if the mariadb startup script "/usr/bin/mysqld_safe" (I think!) should be changed to take into account the uid that has been specified for the container to run as, instead of just using the mysql user?

 

Hope that makes sense!

Link to comment

Recently had a bit of a strange issue with the mariadb container.

 

It's had been running fine for weeks, ever since migrating to it from a container from another author.

 

Yesterday I did the upgrade to unRAID 6.1.7, so during the course of stopping the array to reboot the dockers were stopper. The upgrade went to plan, rebooted the server, started the array again and all of my docker containers came back up - or so I thought.

 

It was only some hours later that I noticed something was wrong with the mariadb container. Looking in the logs (which I don't have to hand unfortunately) I saw continuous, repeated, failed attempts to start mariadb.

 

There was a log message about it having not been shutdown cleanly (sorry I don't have the exact text), with messages about recovering from a crash, and then each attempt to start was followed by a message saying that the table mysql.users didn't exist (again sorry for not having the exact text).

 

Looking at the /config/databases folder I saw that the owner of the mysql directory had been changed from 'nobody' to '103' - 103 seems to be the uid of the mysql user inside the container. "chown -R nobody:users mysql" fixed the complaint about the mysql.users table. But then there was a similar message about another mysql.*something* table, and when I looked the owner of the mysql folder had changed to 103 again.

 

Changing the owner back to nobody this time fixed things and mariadb started up correctly.

 

I suspect that what happened was that there was an unclean shutdown (of mariab) and when starting up again it attempted to recover and during that process tries to ensure that it has correct access so changes the owner of the folder to the mysql user. Which then leads to access problems and stops it accessing those mysql.* tables.

 

I wonder if the mariadb startup script "/usr/bin/mysqld_safe" (I think!) should be changed to take into account the uid that has been specified for the container to run as, instead of just using the mysql user?

 

Hope that makes sense!

 

Sparklyballs has pushed an update to hopefully fix this...

Link to comment
  • 1 month later...

I get error while setting up linuxserver/mariadb in the 'create admin account' page for owncloud.

 

The error is:

Error

Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'owncloud'@'172.17.42.1' (using password: YES)

 

But the tower IP is 192.168.1.101. Not sure where 172.17.42.1 comes from.

 

The database 'owncloud' is present in MariaDB, and user 'owncloud' with permissions.

 

Any thoughts? Thanks.

Link to comment

What host are you specifying in the Owncloud setup?  It won't work with localhost as within a docker container that will be taken as within the docker container itself not the host...  172.17.42.1 is a docker ip...

 

In the owncloud setup put 192.168.1.101 as host.

 

I'm lost. Where do I specify this though? I went back to 'edit' page of ownCloud, and don't see anything to specify host even in the advanced view. Do I have to reinstall ownCloud docker?

 

On the other hand, if this is in the 'WebUI' of ownCloud, yes I had it as 192.168.1.101, not localhost.

Link to comment

What host are you specifying in the Owncloud setup?  It won't work with localhost as within a docker container that will be taken as within the docker container itself not the host...  172.17.42.1 is a docker ip...

 

In the owncloud setup put 192.168.1.101 as host.

 

I'm lost. Where do I specify this though? I went back to 'edit' page of ownCloud, and don't see anything to specify host even in the advanced view. Do I have to reinstall ownCloud docker?

 

On the other hand, if this is in the 'WebUI' of ownCloud, yes I had it as 192.168.1.101, not localhost.

 

When you install Owncloud it gives you a setup page for the database settings....

Link to comment

 

When you install Owncloud it gives you a setup page for the database settings....

 

I removed and installing it again.. The section I see are:

Add container

Volume Mappings

Port Mappings

Environment Variables

Extra Parameters

Additional Fields.

 

This is with 'advanced option' enabled. But don't see a place to specify HOST :-(

 

Link to comment

I'm using gfjardim/owncloud.. does that make any difference?

 

If this is a fresh install of Owncloud then this is an issue with you not knowing how to setup Owncloud not an issue with MariaDB.  After you pull the docker container you go to the OC webui and there is a setup page for the database.  This is what I'm referring to.

 

Incidentally you need to change the binlogging in MariaDB due to a fairly longstanding bug in Owncloud to do with binary logging in MariaDB/MySQL This is not something I've had to do myself as my setup is very different. (Not something I can offer as a solution though)

 

Sequence of install

 

1.  Install MariaDB

2.  Change Binlogging

3.  Install Owncloud and configure via the webui.

Link to comment

I'm using gfjardim/owncloud.. does that make any difference?

 

If this is a fresh install of Owncloud then this is an issue with you not knowing how to setup Owncloud not an issue with MariaDB.  After you pull the docker container you go to the OC webui and there is a setup page for the database.  This is what I'm referring to.

 

Incidentally you need to change the binlogging in MariaDB due to a fairly longstanding bug in Owncloud to do with binary logging in MariaDB/MySQL This is not something I've had to do myself as my setup is very different. (Not something I can offer as a solution though)

 

Sequence of install

 

1.  Install MariaDB

2.  Change Binlogging

3.  Install Owncloud and configure via the webui.

 

Thanks. If you are referring the first page https://<IP>:8000 that pops up when 'webui' is launched right after ownCloud is installed (after installing MariaDB and creating DB and user), then yes, I specified my IP and did not leave it as 'localhost'.

 

Let me post in owncloud thread and see if anyone can give me a hand.

Link to comment
  • 2 weeks later...

Hi,

 

What version of MariaDB is in this docker?

 

I think I'm seeing this issue...

 

https://mariadb.atlassian.net/browse/MDEV-9181

 

Which is fixed in 10.1.11 forward.  If it isn't already could this be moved up versions please?

 

this docker is currently using the 10.0 repository, so whatever you're seeing it seems it's not that, that seems to affect 10.1 versions.

 

currently (as in literally right at this very moment, working on moving over to 10.1)

Link to comment

Hi,

 

What version of MariaDB is in this docker?

 

I think I'm seeing this issue...

 

https://mariadb.atlassian.net/browse/MDEV-9181

 

Which is fixed in 10.1.11 forward.  If it isn't already could this be moved up versions please?

 

this docker is currently using the 10.0 repository, so whatever you're seeing it seems it's not that, that seems to affect 10.1 versions.

 

currently (as in literally right at this very moment, working on moving over to 10.1)

 

OK, thanks!

Link to comment

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.