[Support] Linuxserver.io - MariaDB


Recommended Posts

Hi! I upgraded my MariaDBs on Unraid, and now none of them will start. Apparently, just Clicking "Update" on the docker, does not gracefully shut-down Mariadb, but terminate it? So after the Update, the MariaDB now says "Upgrade after crash not supported" and then InnoDB wont start. This seems to be a quite common issue, but any way to firstly get this up and running?

 

Secondly, apparently just using the "Upgrade/Update" button on the MariaDB Docker in the Unraid WebGUI, isn't a good idea since it hard-kills the docker and then upgrades it, leaving perhaps un-applied redo-logs / unstartable docker? The mariadb will probably start if I just Delete the redo-logs, but I'd rather not? Hope one of you experts here can help me out. I'm no MariaDB expert, I usually stick to Oracle DB :)


Thanks :)

mariadb04_docker_log.txt

Link to comment

I am starting to hate MariaDB on Unraid (or I am just an idiot)...

 

Now after every MariaDB somehow my Databases are not working anymore.

 

Upraded today to the latest version:

 

Quote

220130 08:27:41 mysqld_safe Logging to '/config/databases/d6db1815057e.err'.
220130 08:27:41 mysqld_safe Starting mariadbd daemon with databases from /config/databases
UMASK must be a 3-digit mode with an additional leading 0 to indicate octal.
The first digit will be corrected to 6, the others may be 0, 2, 4, or 6.
UMASK corrected from 022 to 0640 ...
220130 08:27:42 mysqld_safe Logging to '/config/databases/d6db1815057e.err'.
220130 08:27:42 mysqld_safe Starting mariadbd daemon with dat

 

220130 08:31:57 mysqld_safe Starting mariadbd daemon with databases from /config/databases
2022-01-30  8:31:57 0 [Note] /usr/bin/mariadbd (mysqld 10.5.13-MariaDB-log) starting as process 30017 ...
2022-01-30  8:31:57 0 [Note] InnoDB: Uses event mutexes
2022-01-30  8:31:57 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-01-30  8:31:57 0 [Note] InnoDB: Number of pools: 1
2022-01-30  8:31:57 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-01-30  8:31:57 0 [Note] InnoDB: Using Linux native AIO
2022-01-30  8:31:57 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728
2022-01-30  8:31:57 0 [Note] InnoDB: Completed initialization of buffer pool
2022-01-30  8:31:57 0 [Note] InnoDB: Transaction 17363023 was in the XA prepared state.
2022-01-30  8:31:57 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 0 row operations to undo
2022-01-30  8:31:57 0 [Note] InnoDB: Trx id counter is 17363024
2022-01-30  8:31:57 0 [Note] InnoDB: 128 rollback segments are active.
2022-01-30  8:31:57 0 [Note] InnoDB: Starting in background the rollback of recovered transactions
2022-01-30  8:31:57 0 [Note] InnoDB: Rollback of non-prepared transactions completed
2022-01-30  8:31:57 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-01-30  8:31:57 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-01-30  8:31:57 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-01-30  8:31:57 0 [Note] InnoDB: 10.5.13 started; log sequence number 29677261474; transaction id 17363025
2022-01-30  8:31:57 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-01-30  8:31:57 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool
2022-01-30  8:31:57 0 [Note] InnoDB: Starting recovery for XA transactions...
2022-01-30  8:31:57 0 [Note] InnoDB: Transaction 17363023 in prepared state after recovery
2022-01-30  8:31:57 0 [Note] InnoDB: Transaction contains changes to 2 rows
2022-01-30  8:31:57 0 [Note] InnoDB: 1 transactions in prepared state after recovery
2022-01-30  8:31:57 0 [Note] Found 1 prepared transaction(s) in InnoDB
2022-01-30  8:31:57 0 [ERROR] Found 1 prepared transactions! It means that mysqld was not shut down properly last time and critical recovery information (last binlog or tc.log file) was manually deleted after a crash. You have to start mysqld with --tc-heuristic-recover switch to commit or rollback pending transactions.
2022-01-30  8:31:57 0 [ERROR] Aborting
220130 08:31:58 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

Link to comment

 

Checking logs today and I came across

Warning: World-writable config file '/etc/my.cnf.d/custom.cnf' is ignored
Warning: World-writable config file '/etc/my.cnf.d/custom.cnf' is ignored

 

Was able to solve it by doing a

cd /mnt/user/appdata/mariadb

 

chmod 0444 custom.cnf

 

Restart the container and warning was gone.

-Hope it helps someone.

 

 

Edited by Tolete
Link to comment
On 2/1/2022 at 6:56 PM, pengrus said:

Have you tried starting with the --tc-heuristic-recover switch?

 

At this point, I'm about ready to migrate everything back to MySQL, all of this weird behavior in the past few months is concerning at best.  Looks like there's an "official" docker from Bungy, relevant XML here.

 

Yes, I have. Also the one with "rollback".

Link to comment

Disclaimer: I am just trying to brainstorm with you on how to fix it, cause that's what I would want in your shoes.  I am by no means anything approaching an expert.

 

I would try dumping the DBs, create a testing VM, and seeing if it imports.  If so, just spin up another instance and mysqldump back. 

Edited by pengrus
Link to comment
  • 2 weeks later...

Hi Guys I have a bit of an issue and hopefully you can point a Newbie in the best direction.

 I am running a self hosted Nextcloud instance on Unraid with a Mariadb database. I want to add Swag so I can resolve an HTTPS error.  Sorry for the long explanation since I set up Nextcloud I have forgotten my Mariadb login’s (like a numpty) both Mariadb “root and Nextcloud”  I was also looking at using Adminer to make access to Mariadb easier for adding other databases. 
 

Any help would be helpful in finding out how to reset both passwords 

 

cheers 

Martin 

Edited by Martintheshred
Link to comment

I get this error trying to run a command from mariadb console. 

 

[email protected]:/# mysql -u root -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)

 

I can't remove and re-install it and hope for the best since I don't know what other stuff is using mariadb and don't want to break it. Just add a new db. 

I get a similar error on postgresql14, totally fresh install which I've never had on the server before.

createdb: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  role "root" does not exist

 

 

Anyone know how to fix without removing mariadb?


edit: installed mysql instead, and that didn't have that issue. So I'll go with mysql instead. 

Edited by tshorts
Link to comment

Got an error with Mariadb since a recent update to Nextcloud 23.0.2. I get the following error in logs....

 

220221 03:39:47 mysqld_safe Logging to '/config/databases/75c70985ee01.err'.
220221 03:39:47 mysqld_safe Starting mariadbd daemon with databases from /config/databases

 

In the corresponding .err file i get the following reoccurring...

 

2022-02-21 21:53:59 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade 

 

running mysql_upgrade in the container console just spits out the following...

 

Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
FATAL ERROR: Upgrade failed

 

EDIT

Ok since this I have managed to login as root on mariadb but mysql_upgrade still has no effect. 

Any help at all would be much appreciated. 

 

Edited by tazire
Link to comment
On 2/21/2022 at 5:15 PM, tazire said:

Got an error with Mariadb since a recent update to Nextcloud 23.0.2. I get the following error in logs....

 

220221 03:39:47 mysqld_safe Logging to '/config/databases/75c70985ee01.err'.
220221 03:39:47 mysqld_safe Starting mariadbd daemon with databases from /config/databases

 

In the corresponding .err file i get the following reoccurring...

 

2022-02-21 21:53:59 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade 

 

running mysql_upgrade in the container console just spits out the following...

 

Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
FATAL ERROR: Upgrade failed

 

EDIT

Ok since this I have managed to login as root on mariadb but mysql_upgrade still has no effect. 

Any help at all would be much appreciated. 

 

I may be the blind leading the blind here but I had the same issue and know just enough to be dangerous. I tried running: 

mysql_upgrade -u root -p --force

After entering my mariadb root password, it seemed to do something with lots of "OK" messages. I restarted the container and then checking the same log mentioned in /config/databases/ now shows what looks like positive things instead of the error about length mismatches over and over. It would seem that resolved the issue. 

Link to comment
8 hours ago, klingon00 said:

I may be the blind leading the blind here but I had the same issue and know just enough to be dangerous. I tried running: 

mysql_upgrade -u root -p --force

After entering my mariadb root password, it seemed to do something with lots of "OK" messages. I restarted the container and then checking the same log mentioned in /config/databases/ now shows what looks like positive things instead of the error about length mismatches over and over. It would seem that resolved the issue. 

Thank you... this has solved the warnings I was getting however my underlying nextcloud issue persists.... I assumed it was a DB issue as my files tab just wont load in at all since a recent update and the only errors/warnings I could see were those mentioned... Looks like im off to the nextcloud support to try solve it... 

 

Link to comment

I use MariaDB for my nextcloud database and received this message (below) in my nextcloud Security & Setup Warnings after an update to 23.0.2 and was wondering if anyone knows how I can run "occ db:add-missing-indices" from the mariadb console, I get unrecognized command response

 

There are some warnings regarding your setup.

The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.

Missing index "properties_pathonly_index" in table "oc_properties".

Missing index "job_lastcheck_reserved" in table "oc_jobs".

Link to comment

Hello all.  I have made a HUGE mistake and I'm hoping for some guidance here.

I installed the Mariadb docker in 2015 and have used it run my Kodi database since then.

In December, I broke the cardinal rule: If it ain't broke don't fix it (especially if you don't understand it)

I updated the docker to Ver 15.1 Distrib 10.5.13-MariaDB.  Immediately, my Fire TV (Android) Kodi clients would crash on entry.  Strangely, my Windows PC Kodi clients worked fine so I did not immediately suspect Mariadb as the cause.

After many blind alleys from advice on the Kodi forums, I found this in one of the logs:

 

2022-02-16 13:43:52.824 T:16591   ERROR: SQL: [MyVideos116] An unknown error occurred
                                            Query: SELECT * FROM streamdetails WHERE idFile = 1191
2022-02-16 13:43:52.824 T:16591   ERROR: GetStreamDetails(1191) failed
2022-02-16 13:43:52.825 T:16591   ERROR: SQL: [MyVideos116] An unknown error occurred
                                            Query: SELECT type,url FROM art WHERE media_id=3458 AND media_type='movie'
2022-02-16 13:43:52.825 T:16591   ERROR: GetArtForItem(3458) failed
2022-02-16 13:43:52.825 T:16591   ERROR: SQL: [MyVideos116] An unknown error occurred
                                            Query: SELECT type,url FROM art WHERE media_id=0 AND media_type='set'
2022-02-16 13:43:52.825 T:16591   ERROR: GetArtForItem(0) failed

 

So I knew it was a database problem but otherwise not very helpful.  After more poking around I ran this query on HeidiSQL:

select routine_name from information_schema.routines where routine_type='FUNCTION' and routine_schema = '%s';

 

SQL Error (1558): Column count of mysql.proc is wrong. Expected 21, found 20. Created with MariaDB 100134, now running 100513.  Please use mariadb-upgrade to fix this error

 

So, I did not realize that an update might actually be incompatible with a current database.

 

Can someone tell me what to do next?

1. Should I just run "mariadb-upgrade"?  If so, how, exactly?

2. Should I attempt to find and re-install the last working version? Unfortunately, I don't actually know what that version was nor how to find out.

3. Should I just dump the database and the re-import it?  Would that fix the problem?

 

Bearing in mind that I really have no experience with this, I originally followed a recipe from the Kodi forums and it has worked for over 6 years without flaw.

 

Thanks for any help for this undeserving wretch 🙂

 

Link to comment

It looks like some entries in the unraid template are not properly processed 

 

I did a fresh (after removal) install of the mariadb container, and named the database nextcloud (cause thats the first I wanted to use there)
When I checked the container with adminer, there was no database "nextcloud", just one USER_DB_NAME, I suppose the appdata folder that is used in the removed install, just gets reused and not overwritten.
I don't think that is expected behaviour?

I also think there's more problems... the users I create aren't found by the nextcloud container... 
 

Edited by wambo
Link to comment

Hi all,

 

I don't know what happened but my log is flooded of this message:

 

220306 19:20:14 mysqld_safe Logging to '/config/databases/2372ce5ce2c1.err'.
220306 19:20:14 mysqld_safe Starting mariadbd daemon with databases from /config/databases

 

and now nexcloud, and db in home assistant doesn't work anymore.

 

I tried the following solution but it didn't work:

 

docker exec -it mariadb bash

mv /config/log/ /config/log-old/

exit

docker restart mariadb

 

Any hint?

Edited by Jokerigno
Link to comment
3 hours ago, Jokerigno said:

Hi all,

 

I don't know what happened but my log is flooded of this message:

 

220306 19:20:14 mysqld_safe Logging to '/config/databases/2372ce5ce2c1.err'.
220306 19:20:14 mysqld_safe Starting mariadbd daemon with databases from /config/databases

 

and now nexcloud, and db in home assistant doesn't work anymore.

 

I tried the following solution but it didn't work:

 

docker exec -it mariadb bash

mv /config/log/ /config/log-old/

exit

docker restart mariadb

 

Any hint?

 

Nothing useful to add but have the same problem but with filerun:

 

220306 21:58:55 mysqld_safe Logging to '/config/databases/9deadb462a43.err'.
220306 21:58:55 mysqld_safe Starting mariadbd daemon with databases from /config/databases

 

Haven't had a change to look into the problem, but glad to know i'm not the only one.

  • Like 1
Link to comment
On 3/6/2022 at 11:05 PM, 1471 said:

 

Nothing useful to add but have the same problem but with filerun:

 

220306 21:58:55 mysqld_safe Logging to '/config/databases/9deadb462a43.err'.
220306 21:58:55 mysqld_safe Starting mariadbd daemon with databases from /config/databases

 

Haven't had a change to look into the problem, but glad to know i'm not the only one.

Hey,

any update?

 

I can't find any working solution.

 

 

Link to comment
  • 1 month later...

Hi,

my mariadb container seems to have a problem which i am not able to locate and solve.

I noticed because Nextcloud shows "internal server error" and Photoprism does not launch. Both containers are the only one using mariadb databases.

 

MariaDB Log window sows:

1277105725_Screenshot2022-05-08232653.png.bc194e810b1a72380b9592130cd5ae54.png

 

I already found and tried to change the repository to linuxserver/mariadb:110.4.21mariabionic-ls31

it diidnt help.

 

i hope you can get me on the right path as it was a lot of work to re setup everything for someone with my knowledge level :)

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.