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