Can't connect to backend after upgrade from 0.27 to 30

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

Moderator: Forum Moderators

Post Reply
terminus
Newcomer
Posts: 1
Joined: Tue Oct 29, 2019 10:08 pm
Australia

Can't connect to backend after upgrade from 0.27 to 30

Post by terminus »

I am running MythTV 30 backend on Debian Linux 10 using the latest .deb packages compiled using the script from the wiki, which was an upgrade over my existing 0.27 Debian packages. Additionally I am running a frontend on a Raspberry Pi, using the prebuilt MythTV-light packages, also for version 30. When I start the backend using systemd or the init script, it works, showing "running" when I do "service mythtv-backend status".

I can also connect to the mythconverg database using MySQL both locally (on the Debian box) and also remotely (using a remote MySQL admin tool on the Raspberry Pi). So the database is correct.

However when I try running mythtv-setup on the Debian box I get "Waiting for database to start... Database failed to start" and when I try to run the frontend on the Raspberry Pi, I get "Attempting to connect to master backend.. Unable to connect to master backend." The database connection details are triple-checked and correct.

In mythtv-setup.log on the Debian box I see this:

Code: Select all

Oct 29 16:04:40 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 3, status dbAwake, Delay: 2000
Oct 29 16:04:45 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 4, status dbAwake, Delay: 2000
Oct 29 16:04:50 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 5, status dbAwake, Delay: 2000
Oct 29 16:04:55 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 6, status dbAwake, Delay: 2000
Oct 29 16:05:00 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 7, status dbAwake, Delay: 2000
Oct 29 16:05:05 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 8, status dbAwake, Delay: 2000
Oct 29 16:05:10 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 9, status dbAwake, Delay: 2000
Oct 29 16:05:15 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 10, status dbAwake, Delay: 2000
Oct 29 16:05:20 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:1023 (TestDBconnection) Start up failure. host localhost, status dbAwakeFail
Oct 29 16:06:16 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:1186 (UPnPautoconf) UPNP Search 2 secs
Oct 29 16:06:17 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:1201 (UPnPautoconf) UPNP Search 1 secs
Oct 29 16:06:17 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:1201 (UPnPautoconf) UPNP Search 1 secs
Oct 29 16:06:19 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:1211 (UPnPautoconf) No UPnP backends found
Oct 29 16:06:19 servalan mythtv-setup.real: mythtv-setup[8690]: E CoreContext mythcontext.cpp:1163 (ChooseBackend) Error: No UPnP backends found
Oct 29 16:06:19 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:1167 (ChooseBackend) Putting up the UPnP backend chooser
Oct 29 16:07:29 servalan mythtv-setup.real: mythtv-setup[8690]: E CoreContext main.cpp:416 (main) Failed to init MythContext, exiting.
Oct 29 16:07:29 servalan mythtv-setup.real: mythtv-setup[8690]: I CoreContext mythcontext.cpp:1672 (~MythContext) Waiting for threads to exit.
~                                                                    
In mythbackend.log I see this:

Code: Select all

Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: C thread_unknown mythcommandlineparser.cpp:2607 (ConfigureLogging) mythbackend version: fixes/30 [v30.0-72-g2855e29672-dirty] www dot mythtv dot org
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: C thread_unknown mythcommandlineparser.cpp:2609 (ConfigureLogging) Qt version: compile: 5.11.3, runtime: 5.11.3
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: N thread_unknown mythcommandlineparser.cpp:2611 (ConfigureLogging) Enabled verbose msgs:  general
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: N thread_unknown logging.cpp:734 (logStart) Setting Log Level to LOG_INFO
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I Logger logging.cpp:296 (run) Added logging to the console
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Interrupt handler
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Terminated handler
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Segmentation fault handler
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I LogForward loggingserver.cpp:246 (SyslogLogger) Added syslogging
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Aborted handler
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Bus error handler
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Floating point exception handler
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Illegal instruction handler
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Real-time signal 0 handler
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Hangup handler
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: N thread_unknown mythdirs.cpp:203 (InitializeMythDirs) Using runtime prefix = /usr
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: N thread_unknown mythdirs.cpp:205 (InitializeMythDirs) Using configuration directory = /var/lib/mythtv/.mythtv
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I CoreContext mythcorecontext.cpp:272 (Init) Assumed character encoding: en_US.UTF-8
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:641 (LoadDatabaseSettings) Empty LocalHostName. This is typical.
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:650 (LoadDatabaseSettings) Using a profile name of: 'servalan' (Usually the same as this host's name.)
Oct 29 16:09:48 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
Oct 29 16:09:49 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 1, status dbAwake, Delay: 2000
Oct 29 16:09:55 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 2, status dbAwake, Delay: 2000
Oct 29 16:10:00 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 3, status dbAwake, Delay: 2000
Oct 29 16:10:05 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 4, status dbAwake, Delay: 2000
Oct 29 16:10:10 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 5, status dbAwake, Delay: 2000
Oct 29 16:10:15 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 6, status dbAwake, Delay: 2000
Oct 29 16:10:20 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 7, status dbAwake, Delay: 2000
Oct 29 16:10:25 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 8, status dbAwake, Delay: 2000
Oct 29 16:10:30 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 9, status dbAwake, Delay: 2000
Oct 29 16:10:35 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:900 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 10, status dbAwake, Delay: 2000
Oct 29 16:10:40 servalan mythbackend: mythbackend[9022]: I CoreContext mythcontext.cpp:1023 (TestDBconnection) Start up failure. host localhost, status dbAwakeFail
Oct 29 16:10:40 servalan mythbackend: mythbackend[9022]: C CoreContext main.cpp:138 (main) Failed to init MythContext.
This was all working prior to my backend upgrade from 0.27 to 30. I could use some help troubleshooting!
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Can't connect to backend after upgrade from 0.27 to 30

Post by blm-ubunet »

As you use a remote FE & can access the DB server remotely.. you need & have the DB server listening on an IP address.

The default MythTV install has FE & BE configured to use localhost (no net socket).
If your DB server is using IP address then there is a problem.

Your logs show that BE & mythtv-setup attempting to connect to DB server on localhost.

The curse of FOSS is that everything changes.. & I believe the DB server config bind-address sematics have changed BUT that might not be the problem.
I think "localhost" is not exactly == 127.0.0.1 ??

I think you need to ensure the master BE has a static IP & that is used in ~/.mythtv/config.xml or /etc/mythtv/config.xml so these programs can find the DB server.
Then need make sure that mythtv-setup run on master BE has the correct IP address & tick "is master".
I believe a hostname can be used as long as it is locally resolvable.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Can't connect to backend after upgrade from 0.27 to 30

Post by bill6502 »

Just some ideas:

Using configuration directory = /var/lib/mythtv/.mythtv is in use in the backend log snippet above.
Since you've triple checked, I'll assume the same file appears in the backend log when it's started
(OK) by systemd. [Don't know why there's also an init script, but that shouldn't be used and just confuses
the issue] systemctl status will show what's in use. systemctl cat mythtv-backend will show any HOME or
MYTHCONFDIR environmental variables in any .service AND .conf files.

The BE file above correctly has <Host> set to localhost and that was probably used in your command line test
for access to mysql. I'd see if that name resolves to both IPv4 and IPv6, just in case one isn't setup. Try
nmap -p 3306 --reason {-4|-6} localhost. Try 4 and 6 separately.

Check /etc/mysql/mariadb.conf.d/mythtv.cnf or /etc/mysql/mysql.conf.d/mythtv.cnf just in case bind-address
got stomped on. It can be other names like /etc/my.cnf.d... Never ever change the .cnf files from the system
maintainer as they can/will get overwritten. bind-address=:: allows both IPv4 and IPv6 access, but you may
choose a more secure address.
Post Reply