Skip to content

debian package restarts mariadb during schema upgrade #241

Description

@white-haired-uncle

First let me point out I may be doing something a little weird here. I probably am. This is MX Linux 25, no systemd, package built using pbuilder (per process at https://wiki.mythtv.org/wiki/Installing_MythTV_on_Debian -- but I wrote that so it's not like I'm just following directions). And because I'm looking to automate the install process (skip the "will other machines connect to this" question), I install like this:

sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mythtv

That said...

To test another issue, I'm uninstalling (drop mythconverg, apt remove mythtv-common, mythtv user access remains configured in mariadb, mythtv user/config.xml remains) and reinstalling repeatedly. The schema update keeps failing on me, and I only get about 20 tables (not always the same number). This last time I noticed the package add did something like:

stopping mariadb...
starting mariadb...

right near the end. My first thought was, of course, "and just who gave you permission to do that???" [perhaps I did with DEBIAN_FRONTEND=noninteractive?]. But it also gave me a clue.

2026-06-30T19:51:56.637687-04:00 mx25 mythbackend: mythbackend[49869]: C CoreContext dbcheckcommon.cpp:113 (performActualUpdate) Upgrading to MythTV schema version 1382
2026-06-30T19:52:33.972588-04:00 mx25 mythbackend: mythbackend[49869]: D CoreContext mythdbcon.cpp:975 (lostConnectionCheck) SQL Native Error Code: 2013
2026-06-30T19:52:33.972640-04:00 mx25 mythbackend: mythbackend[49869]: E CoreContext dbcheckcommon.cpp:89 (performUpdateSeries) DB Error (Performing MythTV database upgrade): #012Query was: CREATE TABLE `gallery_directories` (  `dir_id` int NOT NULL AUTO_INCREMENT,  `filename` varchar(255) NOT NULL,  `name` varchar(255) NOT NULL,  `path` varchar(255) NOT NULL,  `parent_id` int NOT NULL,  `dir_count` int NOT NULL DEFAULT '0',  `file_count` int NOT NULL DEFAULT '0',  `hidden` tinyint(1) NOT NULL DEFAULT '0',  PRIMARY KEY (`dir_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8; #012Error was: Driver error was [2/2013]:#012QMYSQL: Unable to execute query#012Database error was:#012Lost connection to server during query
2026-06-30T19:52:33.972656-04:00 mx25 mythbackend: mythbackend[49869]: E CoreContext dbcheck.cpp:449 (tryUpgradeTVDatabaseSchema) Database schema upgrade failed
2026-06-30T19:52:33.972706-04:00 mx25 mythbackend: mythbackend[49869]: I CoreContext mythdbcon.cpp:850 (prepare) MySQL server disconnected
2026-06-30T19:52:33.972720-04:00 mx25 mythbackend: mythbackend[49869]: I CoreContext mythdbcon.cpp:647 (exec) MySQL server disconnected

And look what happens at the same time over in syslog:

2026-06-30T19:52:33.904288-04:00 mx25 mysqld: 2026-06-30 19:52:33 0 [Note] /usr/sbin/mariadbd (initiated by: root[root] @ localhost []): Normal shutdown
2026-06-30T19:52:34.347080-04:00 mx25 mysqld: 2026-06-30 19:52:34 0 [Note] InnoDB: FTS optimize thread exiting.
2026-06-30T19:52:35.023458-04:00 mx25 mysqld: 2026-06-30 19:52:35 0 [Note] InnoDB: Starting shutdown...

It appears that the install process starts mythbackend and then restarts mariadb while the schema update is in progress.

2:36.0+fixes.20260620.a833aecd84-0debian0

P.S. Also noted that this happened shortly before mariadb got restarted. I guess that would explain why rsyslogd's pid changed. Doesn't explain where it got permission to restart syslog (a HUP I can live with, bouncing processes is no bueno).

2026-06-30T19:52:14.698061-04:00 mx25 rsyslogd: [origin software="rsyslogd" swVersion="8.2504.0" x-pid="49993" x-info="https://www.rsyslog.com"] start

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions