[mythtv-users] Sudden seemingly-random database issues

Brian S inanimatecrbnrod at hotmail.com
Sun Sep 21 23:05:37 UTC 2014


Hi all - I am running mythbuntu 12.04 and myth .25. My system has two BE's and a FE and has been up and running for a over a year now in its current state. I starting getting odd connectivity issues off and on a few weeks back, e.g. I would start the master BE and all would work on both primary/slave BE as well as FE-only machines, however the MBE would lose the database at some point (log at bottom shows an example). Since it was the end of summer and there was nothing on TV and I was busy with work, I shut everything off for a while, to debug at a later point. Upon booting MBE machine today, I can't connect to the database (system boots to the "pick a language" screen - which I realize is the FE, however if I try to enter the BE setup I also get the "pick a language" screen). Upon booting I got the following in the BE log:
Sep 21 14:55:26 myth-master mythbackend[3149]: C thread_unknown mythcommandlineparser.cpp:2534 (ConfigureLogging) mythbackend version: fixes/0.25 [v0.25.1-39-geffb32b] www.mythtv.orgSep 21 14:55:26 myth-master mythbackend[3149]: C thread_unknown mythcommandlineparser.cpp:2536 (ConfigureLogging) Qt version: compile: 4.8.1, runtime: 4.8.1Sep 21 14:55:26 myth-master mythbackend[3149]: N thread_unknown mythcommandlineparser.cpp:2538 (ConfigureLogging) Enabled verbose msgs:  generalSep 21 14:55:26 myth-master mythbackend[3149]: N thread_unknown logging.cpp:1176 (logStart) Setting Log Level to LOG_INFOSep 21 14:55:26 myth-master mythbackend[3149]: I thread_unknown logging.cpp:229 (FileLogger) Added logging to the consoleSep 21 14:55:26 myth-master mythbackend[3149]: I thread_unknown logging.cpp:369 (SyslogLogger) Added syslogging to facility local7Sep 21 14:55:26 myth-master mythbackend[3149]: I thread_unknown logging.cpp:425 (DatabaseLogger) Added database logging to table loggingSep 21 14:55:26 myth-master mythbackend[3149]: N thread_unknown logging.cpp:1215 (logStart) Setting up SIGHUP handlerSep 21 14:55:26 myth-master mythbackend[3149]: N thread_unknown mythdirs.cpp:51 (InitializeMythDirs) Using runtime prefix = /usrSep 21 14:55:26 myth-master mythbackend[3149]: N thread_unknown mythdirs.cpp:64 (InitializeMythDirs) Using configuration directory = /home/mythtv/.mythtvSep 21 14:55:26 myth-master mythbackend[3149]: I CoreContext mythcorecontext.cpp:227 (Init) Assumed character encoding: en_US.UTF-8Sep 21 14:55:26 myth-master mythbackend[3149]: E CoreContext configuration.cpp:64 (Load) Error parsing: /home/mythtv/.mythtv/config.xml at line: 1  column: 1Sep 21 14:55:26 myth-master mythbackend[3149]: E CoreContext configuration.cpp:66 (Load) Error Msg: unexpected end of fileSep 21 14:55:26 myth-master mythbackend[3149]: N CoreContext mythcontext.cpp:477 (LoadDatabaseSettings) Empty LocalHostName.Sep 21 14:55:26 myth-master mythbackend[3149]: I CoreContext mythcontext.cpp:481 (LoadDatabaseSettings) Using localhost value of myth-masterSep 21 14:55:26 myth-master mythbackend[3149]: E CoreContext configuration.cpp:64 (Load) Error parsing: /home/mythtv/.mythtv/config.xml at line: 1  column: 1Sep 21 14:55:26 myth-master mythbackend[3149]: E CoreContext configuration.cpp:66 (Load) Error Msg: unexpected end of fileSep 21 14:55:26 myth-master mythbackend[3149]: I CoreContext mythcontext.cpp:608 (TestDBconnection) Testing network connectivity to '192.168.0.2'Sep 21 14:55:26 myth-master mythbackend[3149]: I SystemIOHandlerW system-unix.cpp:90 (run) Starting IO manager (write)Sep 21 14:55:26 myth-master mythbackend[3149]: I SystemSignalManager system-unix.cpp:485 (run) Starting process signal handlerSep 21 14:55:26 myth-master mythbackend[3149]: I SystemIOHandlerR system-unix.cpp:90 (run) Starting IO manager (read)Sep 21 14:55:26 myth-master mythbackend[3149]: I SystemManager system-unix.cpp:263 (run) Starting process managerSep 21 14:55:26 myth-master mythbackend[3149]: E CoreContext mythdbcon.cpp:213 (OpenDatabase) Unable to connect to database!Sep 21 14:55:26 myth-master mythbackend[3149]: E CoreContext mythdbcon.cpp:214 (OpenDatabase) Driver error was [1/2003]:#012QMYSQL: Unable to connect#012Database error was:#012Can't connect to MySQL server on '192.168.0.2' (111)Sep 21 14:55:26 myth-master mythbackend[3149]: A CoreContext mythcontext.cpp:414 (FindDatabase) Cannot login to database?Sep 21 14:55:26 myth-master mythbackend[3149]: C CoreContext main.cpp:108 (main) Failed to init MythContext.
After some poking around, it seemed to me basically it was looking for a blank config.xml file instead of the one in the mythtv user's home folder, so I updated the symlinking of the config.xml file so it linked to the one in my /home/(username) folder. Crossed my fingers and rebooted and seemed to have fixed the config.xml problem, but still not able to find the DB:
Sep 21 15:26:51 myth-master mythbackend[2129]: C thread_unknown mythcommandlineparser.cpp:2534 (ConfigureLogging) mythbackend version: fixes/0.25 [v0.25.1-39-geffb32b] www.mythtv.orgSep 21 15:26:51 myth-master mythbackend[2129]: C thread_unknown mythcommandlineparser.cpp:2536 (ConfigureLogging) Qt version: compile: 4.8.1, runtime: 4.8.1Sep 21 15:26:51 myth-master mythbackend[2129]: N thread_unknown mythcommandlineparser.cpp:2538 (ConfigureLogging) Enabled verbose msgs:  generalSep 21 15:26:51 myth-master mythbackend[2129]: N thread_unknown logging.cpp:1176 (logStart) Setting Log Level to LOG_INFOSep 21 15:26:51 myth-master mythbackend[2129]: I thread_unknown logging.cpp:229 (FileLogger) Added logging to the consoleSep 21 15:26:51 myth-master mythbackend[2129]: I thread_unknown logging.cpp:369 (SyslogLogger) Added syslogging to facility local7Sep 21 15:26:51 myth-master mythbackend[2129]: I thread_unknown logging.cpp:425 (DatabaseLogger) Added database logging to table loggingSep 21 15:26:51 myth-master mythbackend[2129]: N thread_unknown logging.cpp:1215 (logStart) Setting up SIGHUP handlerSep 21 15:26:51 myth-master mythbackend[2129]: N thread_unknown mythdirs.cpp:51 (InitializeMythDirs) Using runtime prefix = /usrSep 21 15:26:51 myth-master mythbackend[2129]: N thread_unknown mythdirs.cpp:64 (InitializeMythDirs) Using configuration directory = /home/mythtv/.mythtvSep 21 15:26:51 myth-master mythbackend[2129]: I CoreContext mythcorecontext.cpp:227 (Init) Assumed character encoding: en_US.UTF-8Sep 21 15:26:51 myth-master mythbackend[2129]: N CoreContext mythcontext.cpp:477 (LoadDatabaseSettings) Empty LocalHostName.Sep 21 15:26:51 myth-master mythbackend[2129]: I CoreContext mythcontext.cpp:481 (LoadDatabaseSettings) Using localhost value of myth-masterSep 21 15:26:51 myth-master mythbackend[2129]: I CoreContext mythcontext.cpp:608 (TestDBconnection) Testing network connectivity to '192.168.0.2'Sep 21 15:26:51 myth-master mythbackend[2129]: I SystemIOHandlerR system-unix.cpp:90 (run) Starting IO manager (read)Sep 21 15:26:51 myth-master mythbackend[2129]: I SystemIOHandlerW system-unix.cpp:90 (run) Starting IO manager (write)Sep 21 15:26:51 myth-master mythbackend[2129]: I SystemSignalManager system-unix.cpp:485 (run) Starting process signal handlerSep 21 15:26:51 myth-master mythbackend[2129]: I SystemManager system-unix.cpp:263 (run) Starting process managerSep 21 15:26:51 myth-master mythbackend[2129]: E CoreContext mythdbcon.cpp:213 (OpenDatabase) Unable to connect to database!Sep 21 15:26:51 myth-master mythbackend[2129]: E CoreContext mythdbcon.cpp:214 (OpenDatabase) Driver error was [1/2003]:#012QMYSQL: Unable to connect#012Database error was:#012Can't connect to MySQL server on '192.168.0.2' (111)Sep 21 15:26:51 myth-master mythbackend[2129]: A CoreContext mythcontext.cpp:414 (FindDatabase) Cannot login to database?Sep 21 15:26:51 myth-master mythbackend[2129]: C CoreContext main.cpp:108 (main) Failed to init MythContext.
So I don't think the config.xml problem was the culprit here (or if it was even actually a problem). Of course, I'm not really sure where to go from here. I'm not able to enter mythbackend setup, and from what I can see all values for the address of the BE as well as the name of the DB and password are correct (and unchanged from when they were in a working state) in config.xml and mysql.txt. Anyone able to get me pointed in the right direction? I do have logs of when the DB was still able to be reached, etc., if those would be of any help.
For posterity's sake, here's a log of the BE going from a running state to losing the database:Sep  6 22:17:23 myth-master mythbackend[1907]: N Expire autoexpire.cpp:263 (CalcParams) AutoExpire: CalcParams(): Max required Free Space: 1.0 GB w/freq: 15 minSep  6 22:21:05 myth-master mythbackend[1907]: I HouseKeeping housekeeper.cpp:225 (RunHouseKeeping) Running housekeeping threadSep  6 22:26:08 myth-master mythbackend[1907]: I HouseKeeping housekeeper.cpp:225 (RunHouseKeeping) Running housekeeping threadSep  6 22:31:11 myth-master mythbackend[1907]: I HouseKeeping housekeeper.cpp:225 (RunHouseKeeping) Running housekeeping threadSep  6 22:32:23 myth-master mythbackend[1907]: N Expire autoexpire.cpp:263 (CalcParams) AutoExpire: CalcParams(): Max required Free Space: 1.0 GB w/freq: 15 minSep  6 22:36:13 myth-master mythbackend[1907]: I HouseKeeping housekeeper.cpp:225 (RunHouseKeeping) Running housekeeping threadSep  6 22:41:16 myth-master mythbackend[1907]: I HouseKeeping housekeeper.cpp:225 (RunHouseKeeping) Running housekeeping threadSep  6 22:42:05 myth-master mythbackend[1907]: E FreeSpaceUpdater mythdbcon.cpp:823 (prepare) Error preparing query: SELECT MIN(id),dirname FROM storagegroup WHERE hostname = :HOSTNAME AND groupname NOT IN ( 'DB Backups', 'Videos', 'Trailers', 'Coverart', 'Fanart', 'Screenshots', 'Banners' ) GROUP BY dirname;Sep  6 22:42:05 myth-master mythbackend[1907]: E FreeSpaceUpdater mythdbcon.cpp:825 (prepare) Driver error was [2/2006]:#012QMYSQL3: Unable to prepare statement#012Database error was:#012MySQL server has gone awaySep  6 22:42:05 myth-master mythbackend[1907]: I FreeSpaceUpdater mythdbcon.cpp:611 (exec) MySQL server disconnectedSep  6 22:42:05 myth-master mythbackend[1907]: E DBLogger mythdb.cpp:192 (DBError) DB Error (DBLogging):#012Query was:#012INSERT INTO logging     (host, application, pid, tid, thread, filename,      line, function, msgtime, level, message) VALUES (?, ?, ?, ?, ?, ?,         ?, ?, ?, ?, ?)#012Bindings were:#012:APP="mythbackend", :FILENAME="mythdbcon.cpp", :FUNCTION="prepare",#012:HOST="myth-master", :LEVEL=3, :LINE=823,#012:MESSAGE="Error preparing query: SELECT MIN(id),dirname FROM storagegroup WHERE hostname = :HOSTNAME AND groupname NOT IN ( 'DB Backups', 'Videos', 'Trailers', 'Coverart', 'Fanart', 'Screenshots', 'Banners' ) GROUP BY dirname;",#012:MSGTIME="2014-09-06 22:42:05", :PID=1907, :THREAD="FreeSpaceUpdater", :TID=2307#012Driver error was [2/2006]:#012QMYSQL3: Unable to reset statement#012Database error was:#012MySQL server has gone awaySep  6 22:42:05 myth-master mythbackend[1907]: E DBLogger mythdbcon.cpp:213 (OpenDatabase) Unable to connect to database!Sep  6 22:42:05 myth-master mythbackend[1907]: E DBLogger mythdbcon.cpp:214 (OpenDatabase) Driver error was [1/2003]:#012QMYSQL: Unable to connect#012Database error was:#012Can't connect to MySQL server on '192.168.0.2' (111)Sep  6 22:42:05 myth-master mythbackend[1907]: I DBLogger mythdbcon.cpp:808 (prepare) MySQL server disconnectedSep  6 22:42:05 myth-master mythbackend[1907]: I DBLogger mythdbcon.cpp:611 (exec) MySQL server disconnectedSep  6 22:42:06 myth-master mythbackend[1907]: E DBLogger mythdbcon.cpp:213 (OpenDatabase) Unable to connect to database!
Last 5 lines will repeat about 10 times a second until the BE is shut down or the logfile rolls over (makes looking through the logs not so fun!). 
Thanks for any help you can provide!


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20140921/5833a91a/attachment.html>


More information about the mythtv-users mailing list