MythTv, Can't connect to DB

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

MythTv, Can't connect to DB

Postby anp66 » Oct 7th, '19, 16:25

Hi
I use MythTv but after upgrading I can't connect to the database.

I can connect to the database from the command prompt:
Code: Select all
[anders@localhost mythtv]$ pwd
/var/log/mythtv
[anders@localhost mythtv]$ mysql --user=mythtv -p
Enter password: ????????
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 19
Server version: 10.1.41-MariaDB Mageia MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mythconverg ;
Database changed
MariaDB [mythconverg]> select count(*) from videometadata ;
+----------+
| count(*) |
+----------+
|      525 |
+----------+
1 row in set (0.00 sec)

MariaDB [mythconverg]> exit;
Bye


When I run the mythtv-setup from the command prompt, the following is in the log:

Code: Select all
anders@localhost mythtv]$ pwd
/var/log/mythtv
[anders@localhost mythtv]$ date
Mon Oct  7 15:38:42 CEST 2019
[anders@localhost mythtv]$ mythtv-setup

[anders@localhost mythtv]$ cat mythbackend.20191006120744.15498.log
2019-10-06 14:07:44.584664 C [15498/15498] thread_unknown mythcommandlineparser.cpp:2607 (ConfigureLogging) - mythbackend version: fixes/30.0 [30.0-20190121.1.mga6.tainted (aka v30.0-3-g44fee)] www.mythtv.org
2019-10-06 14:07:44.584674 C [15498/15498] thread_unknown mythcommandlineparser.cpp:2609 (ConfigureLogging) - Qt version: compile: 5.9.4, runtime: 5.9.4
2019-10-06 14:07:44.584675 N [15498/15498] thread_unknown mythcommandlineparser.cpp:2611 (ConfigureLogging) - Enabled verbose msgs:  general
2019-10-06 14:07:44.584713 N [15498/15498] thread_unknown logging.cpp:702 (logStart) - Setting Log Level to LOG_INFO
2019-10-06 14:07:44.595029 I [15498/15508] Logger logging.cpp:296 (run) - Added logging to the console
2019-10-06 14:07:44.595242 I [15498/15507] LogForward loggingserver.cpp:129 (FileLogger) - Added logging to /var/log/mythtv/mythbackend.20191006120744.15498.log
2019-10-06 14:07:44.595248 I [15498/15498] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Interrupt handler
2019-10-06 14:07:44.595252 I [15498/15498] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Terminated handler
2019-10-06 14:07:44.595256 I [15498/15498] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Segmentation fault handler
2019-10-06 14:07:44.595259 I [15498/15498] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Aborted handler
2019-10-06 14:07:44.595263 I [15498/15498] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Bus error handler
2019-10-06 14:07:44.595266 I [15498/15498] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Floating point exception handler
2019-10-06 14:07:44.595269 I [15498/15498] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Illegal instruction handler
2019-10-06 14:07:44.595274 I [15498/15498] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Real-time signal 0 handler
2019-10-06 14:07:44.595278 I [15498/15498] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Hangup handler
2019-10-06 14:07:44.595304 N [15498/15498] thread_unknown mythdirs.cpp:37 (InitializeMythDirs) - Read conf dir = /var/lib/mythtv
2019-10-06 14:07:44.595342 N [15498/15498] thread_unknown mythdirs.cpp:203 (InitializeMythDirs) - Using runtime prefix = /usr
2019-10-06 14:07:44.595344 N [15498/15498] thread_unknown mythdirs.cpp:205 (InitializeMythDirs) - Using configuration directory = /var/lib/mythtv
2019-10-06 14:07:44.595377 I [15498/15498] CoreContext mythcorecontext.cpp:272 (Init) - Assumed character encoding: en_DK.UTF-8
2019-10-06 14:07:44.595530 I [15498/15498] CoreContext mythcontext.cpp:641 (LoadDatabaseSettings) - Empty LocalHostName. This is typical.
2019-10-06 14:07:44.595532 I [15498/15498] CoreContext mythcontext.cpp:650 (LoadDatabaseSettings) - Using a profile name of: 'localhost' (Usually the same as this host's name.)
2019-10-06 14:07:44.595556 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
2019-10-06 14:07:45.596356 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 1, status dbAwake, Delay: 2000
2019-10-06 14:07:50.599422 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 2, status dbAwake, Delay: 2000
2019-10-06 14:07:55.602357 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 3, status dbAwake, Delay: 2000
2019-10-06 14:08:00.605723 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 4, status dbAwake, Delay: 2000
2019-10-06 14:08:05.609089 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 5, status dbAwake, Delay: 2000
2019-10-06 14:08:10.612414 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 6, status dbAwake, Delay: 2000
2019-10-06 14:08:15.615608 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 7, status dbAwake, Delay: 2000
2019-10-06 14:08:20.618896 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 8, status dbAwake, Delay: 2000
2019-10-06 14:08:25.621849 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 9, status dbAwake, Delay: 2000
2019-10-06 14:08:30.624835 I [15498/15498] CoreContext mythcontext.cpp:900 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 10, status dbAwake, Delay: 2000
2019-10-06 14:08:35.627773 I [15498/15498] CoreContext mythcontext.cpp:1023 (TestDBconnection) - [b]Start up failure. host localhost, status dbAwakeFail[/b]
2019-10-06 14:08:36.627999 C [15498/15498] CoreContext main.cpp:138 (main) - Failed to init MythContext.


The Config file that is changed from the mythtv-setup looks like this:

Code: Select all
[anders@localhost mythtv]$ cat /home/anders/.mythtv/config.xml
<Configuration>
  <LocalHostName>my-unique-identifier-goes-here</LocalHostName>
  <Database>
    <PingHost>1</PingHost>
    <Host>localhost</Host>
    <DBHostName>localhost</DBHostName>
    <UserName>mythtv</UserName>
    <Password>????????</Password>
    <DatabaseName>mythconverg</DatabaseName>
    <Port>3306</Port>
  </Database>
  <WakeOnLAN>
    <Enabled>0</Enabled>
    <SQLReconnectWaitTime>0</SQLReconnectWaitTime>
    <SQLConnectRetry>5</SQLConnectRetry>
    <Command>echo 'WOLsqlServerCommand not set'</Command>
  </WakeOnLAN>
  <UPnP>
    <UDN>
      <MediaRenderer>a699d0ee-f939-4743-8c5a-d08ef5d21ee3</MediaRenderer>
    </UDN>
  </UPnP>
</Configuration>


If I change the host name from the mythtv-setup program, the <Host> field is changed.
I've changed the field to: ip address on server, 127.0.0.1 it makes no difference.
From mythtv-setup I've changed port to 6543, 6544 but it doesn't help either.

A db backup was made and it provided additional information:

Code: Select all
[anders@localhost mythtv]$ ./mythconverg_backup.pl --verbose

Configuring environment:
  -    username: anders
  -        HOME: /home/anders
  - MYTHCONFDIR: /home/anders/.mythtv

Parsing configuration files:
  - checking: /home/anders/.mythtv/config.xml
     parsing: /home/anders/.mythtv/config.xml
  - checking: /home/anders/.mythtv/backuprc
     parsing: /home/anders/.mythtv/backuprc

Applying command-line arguments.

Checking configuration.

No DBSchemaVer specified, querying database.
Found DBSchemaVer: 1344.

Database Information:
         DBHostName: localhost
             DBPort: 3306
         DBUserName: mythtv
         DBPassword: XXX
             DBName: mythconverg
        DBSchemaVer: 1344
  DBBackupDirectory: /home/anders/Documents
   DBBackupFilename: mythconverg-1344-20191008085349.sql

Executables:
          mysqldump: mysqldump
           compress: gzip

Attempting to use supplied password for mysqldump.
Any [client] or [mysqldump] password specified in the MySQL options file will
take precedence.

Executing command:
'/usr/bin/mysqldump' --defaults-extra-file='/tmp/veryAuQJ3H' --host='localhost' --port='3306' --user='mythtv' --add-drop-table --add-locks --allow-keywords --complete-insert --extended-insert --lock-tables --no-create-db --quick --add-drop-table 'mythconverg' 2>&1 1>'/home/anders/Documents/mythconverg-1344-20191008085349.sql'

mysqldump exited with status: 0

Attempting to compress backup file.
 - Compressing backup file with IO::Compress::Gzip.

Successfully compressed backup to file:
/home/anders/Documents/mythconverg-1344-20191008085349.sql.gz

Rotating backups.

Searching for files matching pattern:
/home/anders/Documents/mythconverg-????-??????????????.sql*
 - Found 1 matching files.

Deleting 0 and keeping (up to) 5 backup files.
 - Keeping backup file: /home/anders/Documents/mythconverg-1344-20191008085349.sql.gz


Looks like backup went well:

Code: Select all
[anders@localhost mythtv]$ ls -l /home/anders/Documents/mythconverg-1344-20191008085349.sql*
-rw-r--r-- 1 anders anders 638234 Oct  8 08:53 /home/anders/Documents/mythconverg-1344-20191008085349.sql.gz


Where / how can I look up which values to use ?

Thank you in advance for your help.

Best regards
Anders
anp66
 
Posts: 19
Joined: Jul 18th, '17, 23:49

Re: MythTv, Can't connect to DB

Postby doktor5000 » Oct 8th, '19, 20:06

anp66 wrote:after upgrading I can't connect to the database.

[anders@localhost mythtv]$ cat mythbackend.20191006120744.15498.log
2019-10-06 14:07:44.584664 C [15498/15498] thread_unknown mythcommandlineparser.cpp:2607 (ConfigureLogging) - mythbackend version: fixes/30.0 [30.0-20190121.1.mga6.tainted (aka v30.0-3-g44fee)] http://www.mythtv.org

Did you skip some packages for the upgrade, or maybe you didn't enable the tainted repositories for the upgrade? Seems you're still using the mga6 version according to the log excerpt

Could you please post the output of
Code: Select all
rpm -qa|grep -i myth|sort
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 15165
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: MythTv, Can't connect to DB

Postby anp66 » Oct 8th, '19, 23:09

Hi doktor5000

Thanks for your reply.
Below is the result of the rpm command:

Code: Select all
[root@localhost anders]# rpm -qa|grep -i myth|sort
lib64myth0.28-0.28.1-20170528.6.mga6.tainted
lib64myth30-30.0-20190121.1.mga6.tainted
mythes-1.2.4-4.mga6
mythes-en-3.0-15.mga6
mythtv-backend-30.0-20190121.1.mga6.tainted
mythtv-common-30.0-20190121.1.mga6.tainted
mythtv-doc-30.0-20190121.1.mga6.tainted
mythtv-frontend-30.0-20190121.1.mga6.tainted
mythtv-plugin-archive-30.0-20190121.1.mga6.tainted
mythtv-setup-30.0-20190121.1.mga6.tainted
mythtv-themes-base-30.0-20190121.1.mga6.tainted
perl-MythTV-30.0-20190121.1.mga6.tainted
python2-mythtv-30.0-20190121.1.mga6.tainted


Best regards
Anders
anp66
 
Posts: 19
Joined: Jul 18th, '17, 23:49

Re: MythTv, Can't connect to DB

Postby doktor5000 » Oct 9th, '19, 01:04

As you can see all of those are mga6 versions, so no seems your upgrade is not complete. Please post the output of
Code: Select all
urpmq --list-media active --list-url
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 15165
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: MythTv, Can't connect to DB

Postby anp66 » Oct 9th, '19, 01:26

Code: Select all
[root@localhost anders]# urpmq --list-media active --list-url
Core Release http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/x86_64/media/core/release
Core Updates http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/x86_64/media/core/updates
Nonfree Release http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/x86_64/media/nonfree/release
Nonfree Updates http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/x86_64/media/nonfree/updates
Tainted Release http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/x86_64/media/tainted/release
Tainted Updates http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/x86_64/media/tainted/updates
Core 32bit Release http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/i586/media/core/release
Core 32bit Updates http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/i586/media/core/updates
Nonfree 32bit Release http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/i586/media/nonfree/release
Nonfree 32bit Updates http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/i586/media/nonfree/updates
Tainted 32bit Release http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/i586/media/tainted/release
Tainted 32bit Updates http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/6.1/i586/media/tainted/updates
anp66
 
Posts: 19
Joined: Jul 18th, '17, 23:49

Re: MythTv, Can't connect to DB

Postby doktor5000 » Oct 9th, '19, 17:43

What upgrade were you referring to in your original post in particular ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 15165
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: MythTv, Can't connect to DB

Postby anp66 » Oct 9th, '19, 22:44

Hi doktor5000

I was running Mageia 6 and I think it was Mythtv 0.28.

Is it a problem that both packages are installed ?:
lib64myth0.28-0.28.1-20170528.6.mga6.tainted
lib64myth30-30.0-20190121.1.mga6.tainted

Best regards
Anders
anp66
 
Posts: 19
Joined: Jul 18th, '17, 23:49

Re: MythTv, Can't connect to DB

Postby anp66 » Oct 9th, '19, 23:09

Can we use this for something, it is only possible to log in as localhost:

Code: Select all
[anders@localhost ~]$ mysql -h192.168.87.33 -umythtv -p mythconverg
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.87.33' (111 "Connection refused")

[anders@localhost ~]$ mysql -h127.0.0.1 -umythtv -p mythconverg
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused")

[anders@localhost ~]$ mysql -hlocalhost -umythtv -p mythconverg
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.1.41-MariaDB Mageia MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [mythconverg]> exit
Bye
anp66
 
Posts: 19
Joined: Jul 18th, '17, 23:49

Re: MythTv, Can't connect to DB

Postby anp66 » Oct 16th, '19, 19:11

This is now really frustrating :-(.
I can't get the mythtv setup to connect to the database, but can't figure out why. People come (and I'm glad) with all sorts of guesses, but I miss a structured way to solve the problems one at a time.
I miss a log file that specifically tells me why there is no contact with the database.

The only way I can connect to the database is as follows (i.e. not with an ip address or 127.0.0.1):
Code: Select all
[anders@localhost ~]$ mysql -hlocalhost -umythtv -p???????? mythconverg
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.1.41-MariaDB Mageia MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [mythconverg]>


I can also access the database when a backup is made and it provides the following information:
Code: Select all
[anders@localhost mythtv]$ ./mythconverg_backup.pl --verbose

Configuring environment:
  -    username: anders
  -        HOME: /home/anders
  - MYTHCONFDIR: /home/anders/.mythtv

Parsing configuration files:
  - checking: /home/anders/.mythtv/config.xml
     parsing: /home/anders/.mythtv/config.xml
  - checking: /home/anders/.mythtv/backuprc
     parsing: /home/anders/.mythtv/backuprc

Applying command-line arguments.

Checking configuration.

No DBSchemaVer specified, querying database.
Found DBSchemaVer: 1344.

Database Information:
         DBHostName: localhost
             DBPort: 3306
         DBUserName: mythtv
         DBPassword: XXX
             DBName: mythconverg
        DBSchemaVer: 1344
  DBBackupDirectory: /home/anders/Documents
   DBBackupFilename: mythconverg-1344-20191008085349.sql

Executables:
          mysqldump: mysqldump
           compress: gzip

Attempting to use supplied password for mysqldump.
Any [client] or [mysqldump] password specified in the MySQL options file will
take precedence.

Executing command:
'/usr/bin/mysqldump' --defaults-extra-file='/tmp/veryAuQJ3H' --host='localhost' --port='3306' --user='mythtv' --add-drop-table --add-locks --allow-keywords --complete-insert --extended-insert --lock-tables --no-create-db --quick --add-drop-table 'mythconverg' 2>&1 1>'/home/anders/Documents/mythconverg-1344-20191008085349.sql'

mysqldump exited with status: 0

Attempting to compress backup file.
 - Compressing backup file with IO::Compress::Gzip.

Successfully compressed backup to file:
/home/anders/Documents/mythconverg-1344-20191008085349.sql.gz

Rotating backups.

Searching for files matching pattern:
/home/anders/Documents/mythconverg-????-??????????????.sql*
 - Found 1 matching files.

Deleting 0 and keeping (up to) 5 backup files.
 - Keeping backup file: /home/anders/Documents/mythconverg-1344-20191008085349.sql.gz


Looks like backup went well:
Code: Select all
[anders@localhost mythtv]$ ls -l /home/anders/Documents/mythconverg-1344-20191008085349.sql*
-rw-r--r-- 1 anders anders 638234 Oct  8 08:53 /home/anders/Documents/mythconverg-1344-20191008085349.sql.gz


I've convinced myself that mythtv-setup should be able to run before it makes sense to look at why mythbackend won't start.
I also hope that mythbackend will run when the mythtv-setup works.

Below is the entire log that comes when running the mythtv-setup program:
Code: Select all
[anders@localhost ~]$ mythtv-setup --verbose database:debug,file:debug
2019-10-16 17:58:50.383751 I  Setup Interrupt handler
2019-10-16 17:58:50.383762 I  Setup Terminated handler
2019-10-16 17:58:50.383766 I  Setup Segmentation fault handler
2019-10-16 17:58:50.383769 I  Setup Aborted handler
2019-10-16 17:58:50.383772 I  Setup Bus error handler
2019-10-16 17:58:50.383775 I  Setup Floating point exception handler
2019-10-16 17:58:50.383778 I  Setup Illegal instruction handler
2019-10-16 17:58:50.383783 I  Setup Real-time signal 0 handler
2019-10-16 17:58:50.383787 I  Setup Hangup handler
2019-10-16 17:58:50.383851 C  mythtv-setup version: fixes/30.0 [30.0-20190121.1.mga6.tainted (aka v30.0-3-g44fee)] www.mythtv.org
2019-10-16 17:58:50.383854 C  Qt version: compile: 5.9.4, runtime: 5.9.4
2019-10-16 17:58:50.383855 N  Enabled verbose msgs:  general database file
2019-10-16 17:58:50.383862 N  Setting Log Level to LOG_INFO
2019-10-16 17:58:50.394188 I  Added logging to the console
2019-10-16 17:58:50.394359 D  New Logging Client: ID:  (#1)
2019-10-16 17:58:50.449268 N  Using runtime prefix = /usr
2019-10-16 17:58:50.449271 N  Using configuration directory = /home/anders/.mythtv
2019-10-16 17:58:50.449316 I  Assumed character encoding: en_DK.UTF-8
2019-10-16 17:58:50.449416 I  Loading en_us translation for module mythfrontend
2019-10-16 17:58:50.449582 I  Empty LocalHostName. This is typical.
2019-10-16 17:58:50.449585 I  Using a profile name of: 'localhost' (Usually the same as this host's name.)
2019-10-16 17:58:50.449589 I  Clearing Settings Cache.
2019-10-16 17:58:50.449608 I  Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
2019-10-16 17:58:51.451127 I  Start up testing connections. DB localhost, BE , attempt 1, status dbAwake, Delay: 2000
2019-10-16 17:58:56.454663 I  Start up testing connections. DB localhost, BE , attempt 2, status dbAwake, Delay: 2000
2019-10-16 17:58:56.456839 I  ScreenSaverDBus: Created for DBus service: org.freedesktop.ScreenSaver
2019-10-16 17:58:56.458626 I  ScreenSaverDBus: Created for DBus service: org.gnome.SessionManager
2019-10-16 17:58:56.458888 I  Starting process manager
2019-10-16 17:58:56.459907 I  Starting IO manager (read)
2019-10-16 17:58:56.459937 I  Starting process signal handler
2019-10-16 17:58:56.460013 I  Starting IO manager (write)
2019-10-16 17:58:56.510737 I  ScreenSaverX11Private: DPMS is active.
2019-10-16 17:58:56.522863 N  Desktop video mode: 1920x1080 60.000 Hz
libcec.so.4: cannot open shared object file: No such file or directory
2019-10-16 17:58:56.608882 I  Database object created: DBManager0
2019-10-16 17:58:56.608889 I  New DB connection, total: 1
2019-10-16 17:58:56.608924 E  DB Error (StorageGroup::StorageGroup()):
Query was:

Driver error was [1/]:
Driver not loaded
Database error was:
Driver not loaded

2019-10-16 17:58:56.609305 E  LIRC: Failed to connect to Unix socket '/var/run/lirc/lircd'
         eno: No such file or directory (2)
2019-10-16 17:58:56.609316 I  No joystick configuration found, not enabling joystick control
2019-10-16 17:58:56.609403 E  CECAdapter: Failed to load libcec.
2019-10-16 17:58:56.609429 I  UDPListener: Enabling
2019-10-16 17:58:56.609506 I  Binding to UDP 0.0.0.0:0
2019-10-16 17:58:56.609543 I  Binding to UDP [::]:0
2019-10-16 17:58:56.619998 I  Using Frameless Window
2019-10-16 17:58:56.620000 I  Using Full Screen Window
2019-10-16 17:58:56.630068 I  UI Screen Resolution: 1920 x 1080
2019-10-16 17:58:56.634471 W  OpenGL: Could not determine whether Sync to VBlank is enabled.
2019-10-16 17:58:56.726201 I  Trying the OpenGL 2.0 render
2019-10-16 17:58:56.726249 I  OpenGL painter using existing OpenGL context.
2019-10-16 17:58:56.837971 I  OpenGL2: GLSL supported
2019-10-16 17:58:56.838012 I  OpenGL: OpenGL vendor  : NVIDIA Corporation
2019-10-16 17:58:56.838015 I  OpenGL: OpenGL renderer: GeForce GTX 1050/PCIe/SSE2
2019-10-16 17:58:56.838016 I  OpenGL: OpenGL version : 4.6.0 NVIDIA 390.129
2019-10-16 17:58:56.838019 I  OpenGL: Max texture size: 32768 x 32768
2019-10-16 17:58:56.838020 I  OpenGL: Max texture units: 4
2019-10-16 17:58:56.838022 I  OpenGL: Direct rendering: Yes
2019-10-16 17:58:56.838025 I  OpenGL: Extensions Supported: 3e3b
2019-10-16 17:58:56.838026 I  OpenGL: PixelBufferObject support available
2019-10-16 17:58:56.839674 I  OpenGL: Initialised MythRenderOpenGL
2019-10-16 17:58:56.842923 I  MythUIHelper: Pruning cache directory: /home/anders/.mythtv/cache/remotecache
2019-10-16 17:58:56.842947 I  MythUIHelper: Kept 0 files, deleted 0 files, stat error on 0 files
2019-10-16 17:58:56.842949 I  MythUIHelper: Pruning cache directory: /home/anders/.mythtv/cache/thumbnails
2019-10-16 17:58:56.842961 I  MythUIHelper: Kept 0 files, deleted 0 files, stat error on 0 files
2019-10-16 17:58:56.842981 D  MythFontManager: Scanning directory '/usr/share/mythtv/fonts/' for font files.
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
2019-10-16 17:58:56.943130 D  MythFontManager: Scanning directory '/usr/share/mythtv/themes/MythCenter/' for font files.
2019-10-16 17:58:56.943256 D  MythFontManager: Scanning directory '/usr/share/mythtv/themes/MythCenter/htmls' for font files.
2019-10-16 17:58:56.943294 D  MythFontManager: Scanning directory '/usr/share/mythtv/themes/MythCenter/osd' for font files.
2019-10-16 17:58:56.943396 D  MythFontManager: Scanning directory '/usr/share/mythtv/themes/MythCenter/title' for font files.
2019-10-16 17:58:56.943504 D  MythFontManager: Scanning directory '/usr/share/mythtv/themes/MythCenter/ui' for font files.
2019-10-16 17:58:56.943595 D  MythFontManager: Scanning directory '/usr/share/mythtv/themes/MythCenter/watermark' for font files.
2019-10-16 17:58:57.031994 D  DownloadManager: items downloading 0
2019-10-16 17:58:57.031997 D  DownloadManager: items queued 0
2019-10-16 17:58:57.031999 D  DownloadManager: waiting for more items to download
2019-10-16 17:58:57.046070 I  MythUIWebBrowser: Loading css from - file:///usr/share/mythtv/themes/default/htmls/mythbrowser.css
2019-10-16 17:58:57.048629 I  MythUIWebBrowser: enabling plugins
2019-10-16 17:58:57.087488 E  XMLParseBase: No theme file /usr/share/mythtv/themes/MythCenter/config-ui.xml
2019-10-16 17:59:02.151863 I  Start up testing connections. DB localhost, BE , attempt 3, status dbAwake, Delay: 2000
2019-10-16 17:59:07.161684 I  Start up testing connections. DB localhost, BE , attempt 4, status dbAwake, Delay: 2000
2019-10-16 17:59:12.168603 I  Start up testing connections. DB localhost, BE , attempt 5, status dbAwake, Delay: 2000
2019-10-16 17:59:17.175436 I  Start up testing connections. DB localhost, BE , attempt 6, status dbAwake, Delay: 2000
2019-10-16 17:59:22.182392 I  Start up testing connections. DB localhost, BE , attempt 7, status dbAwake, Delay: 2000
2019-10-16 17:59:27.189287 I  Start up testing connections. DB localhost, BE , attempt 8, status dbAwake, Delay: 2000
2019-10-16 17:59:32.203087 I  Start up testing connections. DB localhost, BE , attempt 9, status dbAwake, Delay: 2000
2019-10-16 17:59:37.209923 I  Start up testing connections. DB localhost, BE , attempt 10, status dbAwake, Delay: 2000
2019-10-16 17:59:42.216861 I  Start up failure. host localhost, status dbAwakeFail
2019-10-16 17:59:51.547825 E  Failed to init MythContext, exiting.    <---- Here I stop mythtv-setup with the exit button.


Here are my questions for the log.

This is the config folder ?:
Code: Select all
2019-10-16 17:58:50.449271 N  Using configuration directory = /home/anders/.mythtv


Here is the config folder with the config file:
Code: Select all
[anders@localhost .mythtv]$ ls -alrt
total 80
drwxr-xr-x  2 anders anders  4096 Oct 20  2017 MythBrowser/
drwxr-xr-x  2 anders anders  4096 Nov  4  2017 channels/
drwxr-xr-x  2 anders anders  4096 Nov  4  2017 3rdParty/
drwxr-xr-x  3 anders anders  4096 Nov  4  2017 tmp/
drwxr-xr-x  2 anders anders  4096 Nov  4  2017 themes/
drwxr-xr-x  2 anders anders  4096 Nov  4  2017 HardwareProfile/
drwxr-xr-x 10 anders anders  4096 Oct  6 12:44 cache/
-rw-r--r--  1 anders anders    41 Oct  8 08:50 backuprc
drwxr-xr-x  9 anders anders  4096 Oct  8 08:50 ./
-rw-r--r--  1 anders anders   554 Oct  8 11:03 config.xml
drwxrwxr-x 48 anders anders 36864 Oct 15 23:10 ../
[anders@localhost .mythtv]$ cat config.xml
<Configuration>
  <LocalHostName>my-unique-identifier-goes-here</LocalHostName>
  <Database>
    <PingHost>1</PingHost>
    <Host>localhost</Host>
    <DBHostName>localhost</DBHostName>
    <UserName>mythtv</UserName>
    <Password>????????</Password>
    <DatabaseName>mythconverg</DatabaseName>
    <Port>3306</Port>
  </Database>
  <WakeOnLAN>
    <Enabled>0</Enabled>
    <SQLReconnectWaitTime>0</SQLReconnectWaitTime>
    <SQLConnectRetry>5</SQLConnectRetry>
    <Command>echo 'WOLsqlServerCommand not set'</Command>
  </WakeOnLAN>
</Configuration>


(Incidentally the same config file that is located /var/lib/mythtv/, used by mythbackend)

Does the following mean that no backend (BE) is defined ?
Code: Select all
2019-10-16 17:58:50.449608 I  Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000


Is there a database connection at this time ?
Code: Select all
2019-10-16 17:58:56.608882 I  Database object created: DBManager0
2019-10-16 17:58:56.608889 I  New DB connection, total: 1


This error is probably not because there is something wrong with my storage group definition, but because there is no connection to the database ?
Code: Select all
2019-10-16 17:58:56.608924 E  DB Error (StorageGroup::StorageGroup()):
Query was:

Driver error was [1/]:
Driver not loaded
Database error was:
Driver not loaded


This is how storage group is defined in db
Code: Select all
MariaDB [mythconverg]> SELECT * FROM storagegroup;
+----+-------------+-----------+--------------------------------+
| id | groupname   | hostname  | dirname                        |
+----+-------------+-----------+--------------------------------+
|  1 | Default     | localhost | /home/anders/Videos/Recording/ |
|  2 | Videos      | localhost | /home/anders/Videos/           |
|  3 | Fanart      | localhost | /home/anders/Videos/Picture/   |
|  4 | Coverart    | localhost | /home/anders/Videos/Picture/   |
|  5 | Screenshots | localhost | /home/anders/Videos/Picture/   |
|  6 | Banners     | localhost | /home/anders/Videos/Picture/   |
|  7 | Photographs | localhost | /home/anders/Videos/Picture/   |
+----+-------------+-----------+--------------------------------+
7 rows in set (0.00 sec)


Here are some values from settings. Can see that it is a mess, could it be the reason for the lack of db connection from mythtv?
Code: Select all
MariaDB [mythconverg]> SELECT * FROM settings WHERE value IN ('MasterServerName', 'MasterServerIP', 'BackendServerIP', 'BackendServerIP6');
+------------------+---------------+-----------+
| value            | data          | hostname  |
+------------------+---------------+-----------+
| BackendServerIP  | 192.168.1.15  | 127.0.0.1 |
| BackendServerIP  | 127.0.0.1     | localhost |
| BackendServerIP6 | ::1           | 127.0.0.1 |
| BackendServerIP6 | ::1           | localhost |
| MasterServerIP   | 192.168.87.33 | NULL      |
+------------------+---------------+-----------+
5 rows in set (0.01 sec)


I only have 1 mythtv backend and 1 mythtv frontend and they run on the same machine.

This is the hosts file:
Code: Select all
[anders@localhost etc]$ cat hosts
127.0.0.1 localhost.localdomain localhost
::1         localhost


And here's the awesome mistake!
Code: Select all
2019-10-16 17:59:42.216861 I  Start up failure. host localhost, status dbAwakeFail


From the above, I can't figure out if I missed to define a backend (BE) ?.
Something is missing which means that mythtv cannot connect to the database ?.
Is there anything wrong with the mythtv setup in the database ?
Port 3306 against the database is not open (works, as said, in backup script.) ?.

My firewall is shut down to avoid problems.
Below is port info:
Code: Select all
[anders@localhost ~]$ nmap -p3306 --reason localhost

Starting Nmap 7.40 ( https://nmap.org ) at 2019-10-16 18:57 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up, received conn-refused (0.000044s latency).
Other addresses for localhost (not scanned): ::1
rDNS record for 127.0.0.1: localhost.localdomain
PORT     STATE  SERVICE REASON
3306/tcp closed mysql   conn-refused

Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds

 
[anders@localhost ~]$ netstat --tcp

Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State     
tcp        0      0 linux.local:39216       arn09s20-in-f14.1:https ESTABLISHED
tcp        0      0 linux.local:32976       lt-in-f189.1e100.:https ESTABLISHED
tcp        0      0 linux.local:59894       lh-in-f189.1e100.:https ESTABLISHED
tcp        0      0 linux.local:936         192.168.87.35:nfs       ESTABLISHED
tcp        0      0 linux.local:37784       arn11s04-in-f14.1:https ESTABLISHED


[anders@localhost ~]$ netstat -alnp | grep 3306

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
unix  3      [ ]         STREAM     CONNECTED     33064    3760/gsd-keyboard   
unix  3      [ ]         STREAM     CONNECTED     33061    -                    @/tmp/.X11-unix/X1
unix  3      [ ]         STREAM     CONNECTED     33060    3760/gsd-keyboard   
unix  3      [ ]         STREAM     CONNECTED     33063    3758/gsd-housekeepi 
unix  3      [ ]         STREAM     CONNECTED     33066    3525/dbus-daemon     @/tmp/dbus-IbcCKl6GdJ
anp66
 
Posts: 19
Joined: Jul 18th, '17, 23:49

Re: MythTv, Can't connect to DB

Postby arnesp » Oct 17th, '19, 15:31

Do you have skip-networking enabled in /etc/my.cnf?
mythtv-setup doesn't seem to work with this setting.
If yes, try commenting it out and restart mysqld
arnesp
 
Posts: 52
Joined: Aug 6th, '15, 00:41


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest

cron