Navigatie overslaan.
Start

Restores

Daarnet wilde ik TV gaan kijken, maar kreeg ik een melding dat mijn MythTV database geupgrade moest worden, want ik stond 1299 versies achter.
Hmmz. Vreemd. Zeer vreemd.

Wat zeggen de MythTV logs?

Aug 10 20:52:55 mythtv-master mythbackend[3252]: N CoreContext mythcontext.cpp:477 (LoadDatabaseSettings) Empty LocalHostName.
Aug 10 20:52:55 mythtv-master mythbackend[3252]: I CoreContext mythcontext.cpp:481 (LoadDatabaseSettings) Using localhost value of mythtv-master
Aug 10 20:53:00 mythtv-master mythbackend[3252]: A CoreContext mythcontext.cpp:354 (FindDatabase) Cannot find default UPnP backend
Aug 10 20:53:00 mythtv-master mythbackend[3252]: I CoreContext mythcontext.cpp:608 (TestDBconnection) Testing network connectivity to '192.168.1.1'
Aug 10 20:53:00 mythtv-master mythbackend[3252]: I SystemSignalManager system-unix.cpp:485 (run) Starting process signal handler
Aug 10 20:53:00 mythtv-master mythbackend[3252]: I SystemIOHandlerR system-unix.cpp:90 (run) Starting IO manager (read)
Aug 10 20:53:00 mythtv-master mythbackend[3252]: I SystemManager system-unix.cpp:263 (run) Starting process manager
Aug 10 20:53:00 mythtv-master mythbackend[3252]: I SystemIOHandlerW system-unix.cpp:90 (run) Starting IO manager (write)
Aug 10 20:53:01 mythtv-master mythbackend[3252]: E CoreContext configuration.cpp:112
(Save) Could not open settings file /home/mythtv/.mythtv/config.xml for writing
Aug 10 20:53:01 mythtv-master mythbackend[3252]: N CoreContext mythcorecontext.cpp:1270 (InitLocale) Setting QT default locale to en_BE
Aug 10 20:53:01 mythtv-master mythbackend[3252]: I CoreContext mythcorecontext.cpp:1303 (SaveLocaleDefaults) Current locale en_BE
Aug 10 20:53:01 mythtv-master mythbackend[3252]: E CoreContext mythlocale.cpp:108
(LoadDefaultsFromXML) No locale defaults file for en_BE, skipping
Aug 10 20:53:01 mythtv-master mythbackend[3252]: I CoreContext schemawizard.cpp:106 (Compare) No current database version?
Aug 10 20:53:01 mythtv-master mythbackend[3252]: C CoreContext schemawizard.cpp:135
(CompareAndWait) MythTV database schema is old. Waiting to see if DB is being upgraded.
Aug 10 20:53:02 mythtv-master mythbackend[3252]: I CoreContext schemawizard.cpp:106 (Compare) No current database version?
Aug 10 20:53:06  mythbackend[3252]: last message repeated 4 times
Aug 10 20:53:06 mythtv-master mythbackend[3252]: C CoreContext schemawizard.cpp:179 (CompareAndWait) Timed out waiting.
Aug 10 20:53:06 mythtv-master mythbackend[3252]: E CoreContext dbcheck.cpp:469
(UpgradeTVDatabaseSchema) Not allowed to upgrade the database.
Aug 10 20:53:06 mythtv-master mythbackend[3252]: I CoreContext schemawizard.cpp:316
(PromptForUpgrade) Console is non-interactive, can't prompt user...
Aug 10 20:53:06 mythtv-master mythbackend[3252]: E CoreContext main_helpers.cpp:529
(run_backend) Couldn't upgrade database to new schema
Aug 10 20:53:07 mythtv-master mythbackend[3270]: C thread_unknown mythcommandlineparser.cpp:2534
(ConfigureLogging) mythbackend version: fixes/0.25 [v0.25.2-11-g1c496c8] www.mythtv.org
Aug 10 20:53:07 mythtv-master mythbackend[3270]: C thread_unknown mythcommandlineparser.cpp:2536
(ConfigureLogging) Qt version: compile: 4.8.1, runtime: 4.8.1
Aug 10 20:53:07 mythtv-master mythbackend[3270]: N thread_unknown mythcommandlineparser.cpp:2538 (ConfigureLogging) Enabled verbose msgs:  general

Een restart van de MythTV service?
Hielp niet.

Zou er iets mis zijn met de DB?

mysqlcheck -Aer --auto-repair -u mysqladmin -p

...
mythconverg.recordmatch                            OK
mythconverg.romdb                                  OK
mythconverg.schemalock                             OK
mythconverg.settings                               OK
mythconverg.storagegroup                           OK
mythconverg.tvchain                                OK
mythconverg.tvosdmenu                              OK
...

Neen, alles lijkt OK.
Dan maar voor de veiligheid een herstart van het volledige systeem en hopen dat er ergens een bug in de software zat.

Nope, dat was het ook niet.

Waarom kan MythTV mijn settings niet vinden? Die staan toch gewoon in de "settings" table?
Laten we eens kijken wat daar in staat...

mysql> desc settings;
+----------+----------------+------+-----+---------+-------+
| Field    | Type           | Null | Key | Default | Extra |
+----------+----------------+------+-----+---------+-------+
| value    | varchar(128)   | NO   | MUL |         |       |
| data     | varchar(16000) | NO   |     |         |       |
| hostname | varchar(64)    | YES  |     | NULL    |       |
+----------+----------------+------+-----+---------+-------+
3 rows in set (0.01 sec)

mysql> select * from settings;

...
| AllowTagWriting                                    | 1                                                       | minimyth        |
| MusicPlaylistEditorView                            | tree                                                    | minimyth        |
| MusicTreeLastActive                                | Root Music Node
Albums
$O$
All Tracks
Beat Boy          | minimyth        |
| VideoDefaultPlayer                                 | Internal                                                | minimyth        |
| mythdvd.DVDPlayerCommand                           | Internal                                                | minimyth        |
| DVDDeviceLocation                                  | default                                                 | minimyth        |
| BluRayMountpoint                                   | /media/cdrom                                            | minimyth        |
...

Hmz, dat ziet er zeer vreemd uit. (Op twee plaatsen zelfs.)

Table corruptie die Mysqlcheck niet ziet?
Dat heb ik nog nooit meegemaakt, en hier is dus mijn eerste keer. :-)

Dan maar een backupje terugzetten.
Gelukkig zijn die nooit oud.

mysql> source /var/lib/automysqlbackup/daily/mythconverg/mythconverg_2012-08-10_07h59m.Friday.sql
Query OK, 0 rows affected (0.00 sec)

Query OK, 21144 rows affected (1.07 sec)
Records: 21144  Duplicates: 0  Warnings: 0

Query OK, 21301 rows affected (1.13 sec)
Records: 21301  Duplicates: 0  Warnings: 0

Query OK, 21264 rows affected (1.23 sec)
Records: 21264  Duplicates: 0  Warnings: 0

Query OK, 21348 rows affected (1.12 sec)
Records: 21348  Duplicates: 0  Warnings: 0

Query OK, 21366 rows affected (1.35 sec)
Records: 21366  Duplicates: 0  Warnings: 0

Query OK, 21363 rows affected (1.44 sec)
Records: 21363  Duplicates: 0  Warnings: 0

...

Zei ik "nooit oud"?
Ik bedoelde eigenlijk "quasi realtime". :-)

mysqlbinlog --database mythconverg /var/log/mysql/mysql-bin.* | mysql -u mysqladmin -p

Zou het nu wel werken?

Aug 10 21:14:19 mythtv-master mythbackend[2879]: N CoreContext mythcorecontext.cpp:1270 (InitLocale) Setting QT default locale to en_BE
Aug 10 21:14:19 mythtv-master mythbackend[2879]: I CoreContext mythcorecontext.cpp:1303 (SaveLocaleDefaults) Current locale en_BE
Aug 10 21:14:19 mythtv-master mythbackend[2879]: E CoreContext mythlocale.cpp:108 (LoadDefaultsFromXML) No locale defaults file for en_BE, skipping
Aug 10 21:14:19 mythtv-master mythbackend[2879]: I CoreContext schemawizard.cpp:117 (Compare) Current MythTV Schema Version (DBSchemaVer): 1299
Aug 10 21:14:19 mythtv-master mythbackend[2879]: I CoreContext mythtranslation.cpp:66 (load) Loading en_us translation for module mythfrontend
Aug 10 21:14:19 mythtv-master mythbackend[2879]: N CoreContext main_helpers.cpp:556 (run_backend) MythBackend: Starting up as the master server.
Aug 10 21:14:19 mythtv-master mythbackend[2879]: I CoreContext programinfo.cpp:2052 (CheckProgramIDAuthorities) Found 1 distinct programid authorities
Aug 10 21:14:19 mythtv-master mythbackend[2879]: I Scheduler mythdbcon.cpp:422 (getStaticCon) New static DB connectionSchedCon
Aug 10 21:14:20 mythtv-master mythbackend[2879]: I CoreContext serverpool.cpp:395 (listen) Listening on TCP 127.0.0.1:6544

Succes!
Van probleemvaststelling, via een restore van de MythTV database backup, tot succes in een dik half uur.
Nu is het tijd voor een pint! ;-)

(En morgen nadenken over hoe dit kon voorvallen en in het vervolg voorkomen kan worden.)