Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by kmdewaal »

There is a problem reported with MariaDB version 10.4.x and MythTV:
https://jira.mariadb.org/browse/MDEV-20261
Maybe this is the cause of the problems reported in this thread.
hamelg
Newcomer
Posts: 10
Joined: Fri Jan 03, 2020 8:57 pm
France

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by hamelg »

I did a network capture and I see the same thing.
The crash happens only when i watch a program with no information on the grid TV (program unknown). Another clue is when mariadb crashes, mythbackend lets a empty ts file in its home directory, not in the storage group directory. I tried to debug, but it's too hard. I give up.
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by kmdewaal »

If you are using MariaDB version 10.4.x then I suggest to change to an older, 10.3.x, version of MariaDB, or to change to MySQL.
MythTV does rely on a correctly working database and when the database crashes on its own this is not something that can be fixed in MythTV.
When the MariaDB bug is fixed this will be noted in the Jira ticket referenced above and then also MariaDB version in which the fix will be implemented will be known.
You might also consider changing to a less bleeding-edge distribution such as Fedora or Ubuntu.
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by kmdewaal »

The problem in MariaDB version 10.4.x is also still present in 10.5.x as mentioned in the MariaDB Jira ticket
https://jira.mariadb.org/browse/MDEV-20261
So for the time being any MariaDB version 10.4.x or higher should be avoided with MythTV.
The good news is that they can now reproduce it and are now working on it.
Louis
Newcomer
Posts: 7
Joined: Fri May 23, 2014 1:05 pm
Denmark

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by Louis »

Lately I started having issues with some channels - but this Friday I couldn't play any livetv at all - only recordings - if i restarted mythbackend I was sometimes able to much the channels.

The backend is on Arch too.

Luckily downgrading mariadb to 10.3 helped.

Thanks a lot for the fix. I'll keep an eye on whatever they bug will be fixed or I'll have to switch to Percona to stay up-to-date.
Louis
Newcomer
Posts: 7
Joined: Fri May 23, 2014 1:05 pm
Denmark

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by Louis »

I've pushed MariaDB 10.3 to the AUR and updated the Arch wiki regarding this: https://wiki.archlinux.org/index.php/My ... e_database
tjbron
Newcomer
Posts: 3
Joined: Thu Jun 30, 2016 9:17 pm
United States of America

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by tjbron »

Louis wrote:
Thu Mar 19, 2020 5:09 pm
I've pushed MariaDB 10.3 to the AUR and updated the Arch wiki regarding this: https://wiki.archlinux.org/index.php/My ... e_database
Thanks Louis, this is great!

I tried doing the rollback, but now I can't start mariadb.
I'm getting this. What am I forgetting to do?

Code: Select all

[ERROR] Fatal error: Can't open and lock privilege tables: 'mysql.user' is not of type 'TABLE'
mariadb.service: Main process exited, code=exited, status=1/FAILURE
mariadb.service: Failed with result 'exit-code'.
edit: found this tidbit in the Arch Wiki, but I get mariadb-install-db: command not found...
Install mariadb, afterwards run the following command before starting the mariadb.service:
# mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Louis
Newcomer
Posts: 7
Joined: Fri May 23, 2014 1:05 pm
Denmark

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by Louis »

tjbron wrote:
Sun Mar 29, 2020 9:31 pm
I tried doing the rollback, but now I can't start mariadb.
I'm getting this. What am I forgetting to do?

Code: Select all

[ERROR] Fatal error: Can't open and lock privilege tables: 'mysql.user' is not of type 'TABLE'
mariadb.service: Main process exited, code=exited, status=1/FAILURE
mariadb.service: Failed with result 'exit-code'.
edit: found this tidbit in the Arch Wiki, but I get mariadb-install-db: command not found...
Install mariadb, afterwards run the following command before starting the mariadb.service:
# mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
In MariaDB the command is still called "mysql_install_db". I did some debugging and included that somehow I managed to downgrade from MariaDB 10.4 -> 10.3 on one Arch Linux install while it fails on all other Arch Linux installations.

I suggest you try to upgrade to MariaDB 10.4.13 and see if your issues have been fixed. It bug should have been fixed upstream, however I still have issues viewing live tv from at least one channel.

If you still have problems with 10.4.13 the easiest to downgrade to 10.3 is to dump all your databases, completely delete all MariaDB with all data, install 10.3 and restore databases. This is because configuration files have changed from 10.3 to 10.4. Remember to stop mythbackend while trying this and take care and remember to backup!
Louis
Newcomer
Posts: 7
Joined: Fri May 23, 2014 1:05 pm
Denmark

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by Louis »

I still have issues with viewing live tv after upgradig to mariadb 10.4.13.

I have a single channel with no signal when viewing from Kodi on my Pi.

Does other have similar issues with MariaDB 10.4.13 and MythTV?

Log snippet:
2020-05-21 21:36:16.563343 I [470269/470497] ProcessRequest mainserver.cpp:1768 (HandleAnnounce) - MainServer: MainServer::ANN Monitor
2020-05-21 21:36:16.563370 I [470269/470497] ProcessRequest mainserver.cpp:1770 (HandleAnnounce) - MainServer: adding: louis-hostname(56237e52be50) as a client (events: 0)
2020-05-21 21:36:16.592530 I [470269/470513] MythSocketThread(40) mainserver.cpp:7856 (connectionClosed) - Monitor sock(56237e52be50) 'louis-pi' disconnected
I tried to downgrade to MariaDB 10.3 and have no issues viewing that channel using that MariaDB version.
bitspiel
Junior
Posts: 36
Joined: Sat Mar 15, 2014 8:23 am
United States of America

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by bitspiel »

Release notes for 10.4.13
https://mariadb.com/kb/en/mariadb-10413-release-notes/

does NOT reference the bug Myth needs fixed https://jira.mariadb.org/browse/MDEV-20261
StefanJ
Junior
Posts: 27
Joined: Wed Oct 08, 2014 11:38 pm
United States of America

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by StefanJ »

I seem to be running into this when running mythfilldatabase:

Code: Select all

QMYSQLResult::cleanup: unable to free statement handle
2021-03-25 15:52:39.781031 E [22695/22695] CoreContext mythdb.cpp:181:DBError  DB Error (Marking first showings by id):
Query was:
UPDATE program JOIN (SELECT MIN(p.starttime) AS starttime, p.programid       FROM program p, channel c       WHERE p.programid <> ''             AND p.chanid = c.chanid             AND c.deleted IS NULL             AND c.visible > 0       GROUP BY p.programid      ) AS firsts ON program.programid = firsts.programid   AND program.starttime = firsts.starttime SET program.first=1;
Driver error was [2/2013]:
QMYSQL3: Unable to execute statement
Database error was:
Lost connection to MySQL server during query

2021-03-25 15:52:39.781620 I [22695/22695] CoreContext mythdbcon.cpp:260:Reconnect  MySQL reconnected successfully
I will look into a downgrade to 10.3.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Mythbackend crashes when attempt to run LiveTV [Arch installation with MariaDB errors]

Post by paulh »

MariaDB 10.4.14 or above should be OK you don't have to downgrade 10.3 anymore.
Post Reply