[Solved] mythtv-setup freezes upon launching

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

Moderator: Forum Moderators

ulmus-scott
Junior
Posts: 41
Joined: Sat Jun 05, 2021 12:50 am
United States of America

Re: mythtv-setup freezes upon launching

Post by ulmus-scott »

I reformatted and reinstalled Xubuntu 21.04 and did some minor, mostly cosmetic OS setup.

Code: Select all

sudo apt-get install ntp

sudo apt-get install gparted gnome-system-monitor libreoffice libreoffice-help-en-us vlc ffmpeg gimp qbittorent asunder 

sudo apt-get update && sudo apt-get upgrade

sudo apt-get install openssh-server
set up ssh

sudo apt-get install lm-sensors && sudo sensors-detect && sensors
sudo apt-get install psensor


sudo apt-get install hdhomerun-config-gui hdhomerun-config
set up hdhomerun systemd service to delay startup of mythtv-backend

sudo add-apt-repository ppa:mythbuntu/31
sudo apt-get update
sudo apt-get install mythtv
answered no to other computers accessing mythtv

added override to mythtv-backend.service to delay its startup (not sure if necessary since it completes on iteration 1, but it makes me feel better)

Code: Select all

sudo usermod -a -G mythtv htpc

sudo shutdown -r now
Xubuntu wanted to install the other Englishes from around the world, so I let it. Also, Software updater wanted to update 2 Ubuntu components (ubuntu-advantage or something and another one), which I let it.

Code: Select all

htpc@htpc-HP:~$ sudo systemctl stop mythtv-backend
[sudo] password for htpc: 
htpc@htpc-HP:~$ sudo systemctl status mythtv-backend
● mythtv-backend.service - MythTV Backend
     Loaded: loaded (/lib/systemd/system/mythtv-backend.service; enabled; vendor preset: enable>
    Drop-In: /etc/systemd/system/mythtv-backend.service.d
             └─override.conf
     Active: failed (Result: exit-code) since Sun 2021-06-06 21:45:08 EDT; 4min 52s ago
       Docs: https://www.mythtv.org/wiki/Mythbackend
   Main PID: 1518 (code=exited, status=138)

Jun 06 21:45:08 htpc-HP systemd[1]: mythtv-backend.service: Scheduled restart job, restart coun>
Jun 06 21:45:08 htpc-HP systemd[1]: Stopped MythTV Backend.
Jun 06 21:45:09 htpc-HP systemd[1]: mythtv-backend.service: Start request repeated too quickly.
Jun 06 21:45:09 htpc-HP systemd[1]: mythtv-backend.service: Failed with result 'exit-code'.
Jun 06 21:45:09 htpc-HP systemd[1]: Failed to start MythTV Backend.
I wasn’t expecting that to say failed, but looking at the backend log from the previous attempt I see that is what it did as well.

This is actually why I reinstalled the OS. After apt purge mythtv* libmyth and mysql DROP DATABASE mythconverg; and reinstalling mythtv, I thought I had done something wrong when systemd said failed before setting up the backend.

Setup other programs while waiting for other backend to finish recording, so I can scan the tuner.

Code: Select all

mythtv-setup.real -v most,norefcount --loglevel=debug > mythtv-setup-1.log 2>&1
Error: could not connect to database.
Packaging bug?: did not ask me for a mythconverg password and failed to propagate the random one generated (This didn’t happen before with the ppa when installing new. It did propagate properly before. Also, I could log into mysql with the password in /home/mythtv/.mythtv/config.xml, which symlinks to /etc/mythtv/config.xml, but it was trying to use the default mythtv password.) On second thought, maybe this is because I’m not running it as user mythtv?

Code: Select all

sudo dpkg-reconfigure mythtv-common
set a password
sudo dpkg-reconfigure mythtv-database
answer no

echo "DBBackupDirectory=/var/lib/mythtv/db_backups" > ~/.mythtv/backuprc

/usr/share/mythtv/mythconverg_backup.pl --rotate -1 --verbose

sudo systemctl start mythtv-backend
mythbackend -v most,norefcount --loglevel=debug

I though that worked?  But I guess not.

sudo systemctl stop mythtv-backend
mythbackend -v most,norefcount --loglevel=debug > mythtv-backend-1.log 2>&1

mythfrontend -v most,norefcount --loglevel=debug > mythtv-frontend-1.log 2>&1
Did some frontend setup. Not sure if the log is relevant, but I made it anyways.

Stupid metadata lookup on title (test). I should disable that, but I’m not sure how.

Ctrl C on backend

after a short 10 minute recording:

Code: Select all

/usr/share/mythtv/mythconverg_backup.pl --rotate -1 --verbose


mythtv-setup.real -v most,norefcount --loglevel=debug > mythtv-setup-2.log 2>&1
Unresponsive to input, grayed out menu.

Code: Select all

/usr/share/mythtv/mythconverg_backup.pl --rotate -1 --verbose

htpc@htpc-HP:~$ sudo systemctl disable mythtv-backend.service 
You weren't kidding about the size of the files. I not sure how you're supposed to read a 200 MiB text file. You can peruse the logs and database backups at your leisure here: https://drive.google.com/drive/folders/ ... sp=sharing

I'll try to look in the morning, I've stayed up too late already.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: mythtv-setup freezes upon launching

Post by paulh »

For testing purposes lets get you using the mythcenter-wide theme just to rule out any theme issues. We know that one works since it's a system installed theme and is consider the default theme.

Go to the Theme Chooser and you should see one called MythCenter-wide 1.7 or similar (I'm assuming your TV or monitor is capable of displaying in widescreen if not choose the non wide version MythCenter 1.4?).

Do you have many UPnP devices on your network? If when you start mythtv-setup you leave it for a few minutes does it eventually come to life?
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: mythtv-setup freezes upon launching

Post by wesnewell »

Don't know if it matters, but I always install mysql server before installing mythtv. Is mysql installed and active?
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
ulmus-scott
Junior
Posts: 41
Joined: Sat Jun 05, 2021 12:50 am
United States of America

Re: mythtv-setup freezes upon launching

Post by ulmus-scott »

Wesnewell:
Don't know if it matters, but I always install mysql server before installing mythtv. Is mysql installed and active?
Apt should install mysql before mythtv. mysql is running and I can log in as mythtv using the password I set with dpkg-reconfigure.

Code: Select all

htpc@htpc-HP:~$ mysql -u mythtv -p mythconverg
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.25-0ubuntu0.21.04.1 (Ubuntu)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> exit
Bye

paulh:
For testing purposes lets get you using the mythcenter-wide theme just to rule out any theme issues. We know that one works since it's a system installed theme and is consider the default theme.

Go to the Theme Chooser and you should see one called MythCenter-wide 1.7 or similar (I'm assuming your TV or monitor is capable of displaying in widescreen if not choose the non wide version MythCenter 1.4?).
I didn’t change it this time. I just checked and it is MythCenter-wide 1.7.
Do you have many UPnP devices on your network? If when you start mythtv-setup you leave it for a few minutes does it eventually come to life?
The network consists of: a Netgear R6900P router (192.168.1.1); a printer that is usually off (192.168.1.32); the HDHomeRun tuner (HDHR4-US 192.168.1.48); and up to 3 desktops (htpc 192.168.1.64, htpc-HP now reserved 192.168.1.65 was 15), 4 laptops, <= 5 Android phones, and one iPhone.

I left mythtv-setup open for fifteen minutes and it stayed frozen at a grayed out menu. The log (mythtv-setup-3) just shows some SSDP messages after the initial 3 second or so startup.
ulmus-scott
Junior
Posts: 41
Joined: Sat Jun 05, 2021 12:50 am
United States of America

Re: mythtv-setup freezes upon launching

Post by ulmus-scott »

From mythtv-setup-1.log:

Code: Select all

line 6900
2021-06-06 23:39:06.247495 I  XMLParseBase: Loading window settingssetup from /usr/share/mythtv/themes/MythCenter-wide/standardsetting-ui.xml
2021-06-06 23:39:06.247513 E  XMLParseBase: No theme file /usr/share/mythtv/themes/MythCenter-wide/standardsetting-ui.xml
2021-06-06 23:39:06.247516 I  XMLParseBase: Loading window settingssetup from /usr/share/mythtv/themes/default-wide/standardsetting-ui.xml
2021-06-06 23:39:06.247521 E  XMLParseBase: No theme file /usr/share/mythtv/themes/default-wide/standardsetting-ui.xml
2021-06-06 23:39:06.247523 I  XMLParseBase: Loading window settingssetup from /usr/share/mythtv/themes/default/standardsetting-ui.xml
Again, the standardsetting-ui.xml file is only in themes/default/

Code: Select all

line 8669
2021-06-06 23:39:06.598132 I  OpenGL: Src: API Type: Performance Msg: CPU mapping a busy "buffer" BO stalled and took 3.209 ms.
I only scrolled through the first 12,00 lines. Searching for “ E “ yeilded:

Code: Select all

Line 38228
2021-06-06 23:42:33.102962 I  XMLParseBase: Loading window channelscanner from /usr/share/mythtv/themes/MythCenter-wide/config-ui.xml
2021-06-06 23:42:33.104286 E  XMLParseBase: No theme file /usr/share/mythtv/themes/MythCenter-wide/config-ui.xml
2021-06-06 23:42:33.104297 I  XMLParseBase: Loading window channelscanner from /usr/share/mythtv/themes/default-wide/config-ui.xml
2021-06-06 23:42:33.108057 E  XMLParseBase: No theme file /usr/share/mythtv/themes/default-wide/config-ui.xml
2021-06-06 23:42:33.108060 I  XMLParseBase: Loading window channelscanner from /usr/share/mythtv/themes/default/config-ui.xml
Only windows iconimport and channeloverview are in themes/MythCenter-wide/config-ui.xml

Code: Select all

2021-06-06 23:44:08.503163 I  PESPacket: Failed CRC check 0x81e0b465 != 0xfb4a33b2 for StreamID = 0xc8
2021-06-06 23:44:08.503185 E  MPEGStream[-1](0x561f1ad99f28): Discarding broken PSIP packet
Again, this is during the scanning.

Code: Select all

Empty filename passed to function
...
2021-06-06 23:48:59.971230 E  MythUIFileBrowser: current directory does not exist!
I don’t think its relevant because it works. Is the file browser not supposed to start at the root directory?

paulh:
It's always best to install themes using the Theme Chooser if they are available in there then you know you have a compatible and up to date version for your MythTV version.
I had installed the mythtv-theme-mythbuntu package because the logs show errors if it is not installed:

Code: Select all

2021-06-06 23:38:53.551929 W  MythUIHelper: No theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-06 23:38:53.551934 W  MythUIHelper: No default theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-06 23:38:53.551939 E  MythUIHelper: Could not find theme: Mythbuntu - Switching to MythCenter-wide
Looking at mythtv-setup-2.log:
mythtv-setup-1.log

Code: Select all

2021-06-06 23:38:53.424638 I  ScreenSaverX11Private: DPMS is disabled.
2021-06-06 23:38:53.521090 I  MythUIHelper: MythUI Image Cache size set to 31457280 bytes
2021-06-06 23:38:53.532798 D  PowerDBus: Acquired delay FD: 32
2021-06-06 23:38:53.550895 D  PowerDBus: Max inhibit delay: 30seconds
2021-06-06 23:38:53.551150 I  Power: On AC power
2021-06-06 23:38:53.551165 I  Power: Supported actions: Suspend,Restart,Shutdown
2021-06-06 23:38:53.551181 D  setHttpProxy() - no HTTP_PROXY environment var.
2021-06-06 23:38:53.551217 E  setHttpProxy() - failed to find a network proxy
2021-06-06 23:38:53.551929 W  MythUIHelper: No theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-06 23:38:53.551934 W  MythUIHelper: No default theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-06 23:38:53.551939 E  MythUIHelper: Could not find theme: Mythbuntu - Switching to MythCenter-wide
2021-06-06 23:38:53.552120 I  MythUIHelper: Using theme base resolution of 1280x720
2021-06-06 23:38:53.553391 I  Loading en_us translation for module mythfrontend
2021-06-06 23:38:53.553689 E  LIRC: Failed to connect to Unix socket '/var/run/lirc/lircd'
			eno: No such file or directory (2)
mythtv-setup-2.log

Code: Select all

2021-06-07 00:29:44.690652 I  ScreenSaverX11Private: DPMS is disabled.
2021-06-07 00:29:44.783345 E  DB Error (StorageGroup::StorageGroup()):
Query was:

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

2021-06-07 00:29:44.783427 W  MythUIHelper: No theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-07 00:29:44.783431 W  MythUIHelper: No default theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-07 00:29:44.783435 E  MythUIHelper: Could not find theme: Mythbuntu - Switching to MythCenter-wide
2021-06-07 00:29:44.783607 I  MythUIHelper: Using theme base resolution of 1280x720
2021-06-07 00:29:44.783711 E  LIRC: Failed to connect to Unix socket '/var/run/lirc/lircd'
			eno: No such file or directory (2)
SSDP gets schemas-wifialliance-org:device:WFADevice:1 at port 1990 first in log 1, while it gets upnp:rootdevice at port 5000 in log 2, both at the router’s IP address.

Five seconds later in log 1, SSDP gets 192.168.1.1:8200/rootDesc.xml. Less than a second later in log 2, SSDP also gets 192.168.1.1:8200/rootDesc.xml.

Log 2:

Code: Select all

line 5143
2021-06-07 00:29:45.471099 D  PortChecker::checkPort(): host 192.168.1.1 port 8200 timeLimit 5000 linkLocalOnly 0
2021-06-07 00:29:45.665403 D  PortChecker::checkPort(): socket state 1
2021-06-07 00:29:45.971718 D  PortChecker::checkPort(): socket state 2
2021-06-07 00:29:46.171941 D  PortChecker::checkPort(): socket state 3
2021-06-07 00:29:46.175011 D  PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1
2021-06-07 00:29:46.185538 D  FindDatabase() - Success!
2021-06-07 00:29:46.185659 N  Setting QT default locale to en_US
2021-06-07 00:29:46.185673 I  Current locale en_US
2021-06-07 00:29:46.185755 N  Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
2021-06-07 00:29:46.186353 D  PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1
2021-06-07 00:29:46.201919 D  ScreenSaverDBus: Could not connect to dbus: The name org.freedesktop.ScreenSaver was not provided by any .service files
2021-06-07 00:29:46.203348 D  ScreenSaverDBus: Could not connect to dbus: The name org.freedesktop.PowerManagement.Inhibit was not provided by any .service files
2021-06-07 00:29:46.204563 D  ScreenSaverDBus: Could not connect to dbus: The name org.mate.SessionManager was not provided by any .service files
2021-06-07 00:29:46.205845 D  ScreenSaverDBus: Could not connect to dbus: The name org.gnome.SessionManager was not provided by any .service files
2021-06-07 00:29:46.206715 D  Launching: xscreensaver-command -version >&- 2>&-
2021-06-07 00:29:46.214506 I  Managed child (PID: 6794) has started! * command=xscreensaver-command -version >&- 2>&-, timeout=0
2021-06-07 00:29:46.234874 I  Managed child (PID: 6794) has exited! command=xscreensaver-command -version >&- 2>&-, status=32512, result=127
2021-06-07 00:29:46.245695 I  ScreenSaverX11Private: DPMS is disabled.
2021-06-07 00:29:46.247592 I  MythUIHelper: MythUI Image Cache size set to 31457280 bytes
2021-06-07 00:29:46.282838 D  PowerDBus: Acquired delay FD: 49
2021-06-07 00:29:46.359308 D  PowerDBus: Max inhibit delay: 30seconds
2021-06-07 00:29:46.360145 I  Power: On AC power
2021-06-07 00:29:46.360189 I  Power: Supported actions: Suspend,Restart,Shutdown
2021-06-07 00:29:46.360234 D  setHttpProxy() - no HTTP_PROXY environment var.
2021-06-07 00:29:46.360302 E  setHttpProxy() - failed to find a network proxy
2021-06-07 00:29:46.363133 W  MythUIHelper: No theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-07 00:29:46.363150 W  MythUIHelper: No default theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-07 00:29:46.363169 E  MythUIHelper: Could not find theme: Mythbuntu - Switching to MythCenter-wide
2021-06-07 00:29:46.363641 I  MythUIHelper: Using theme base resolution of 1280x720
2021-06-07 00:29:46.369304 I  Loading en_us translation for module mythfrontend
2021-06-07 00:29:46.372207 I  Using Frameless Window
2021-06-07 00:29:46.372217 I  Using Full Screen Window
2021-06-07 00:29:46.373095 I  Display: Have main widget
2021-06-07 00:29:46.373106 I  Display: Have main window
2021-06-07 00:29:46.373997 I  Display: Found screen 'HDMI-2'
2021-06-07 00:29:46.374026 I  Display: Waiting for new screen
2021-06-07 00:29:46.472179 D  PortChecker::checkPort(): socket state 0
2021-06-07 00:29:46.899813 W  Display: Timed out waiting for new screen
2021-06-07 00:29:46.899885 I  Display: Screen HDMI-2: 1920x1080 (Make: Ancor Communications Inc Model: ASUS VS239-)
2021-06-07 00:29:46.899892 I  Display: Primary screen: HDMI-2.
2021-06-07 00:29:46.899904 I  Display: Total desktop dim: 1920x1080, over 1 screen[s].
2021-06-07 00:29:46.899934 I  Display: Using screen HDMI-2: 1920x1080 at 0+0
2021-06-07 00:29:46.902259 I  UI Screen Resolution: 1920 x 1080
2021-06-07 00:29:46.937334 I  OpenGL: GPU debug logging started (async)
That is all within the first 200 lines of log 1 and is also mostly duplicated in the first 200 lines of log 2.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: mythtv-setup freezes upon launching

Post by paulh »

ulmus-scott wrote:
Mon Jun 07, 2021 4:31 pm
From mythtv-setup-1.log:

Code: Select all

line 6900
2021-06-06 23:39:06.247495 I  XMLParseBase: Loading window settingssetup from /usr/share/mythtv/themes/MythCenter-wide/standardsetting-ui.xml
2021-06-06 23:39:06.247513 E  XMLParseBase: No theme file /usr/share/mythtv/themes/MythCenter-wide/standardsetting-ui.xml
2021-06-06 23:39:06.247516 I  XMLParseBase: Loading window settingssetup from /usr/share/mythtv/themes/default-wide/standardsetting-ui.xml
2021-06-06 23:39:06.247521 E  XMLParseBase: No theme file /usr/share/mythtv/themes/default-wide/standardsetting-ui.xml
2021-06-06 23:39:06.247523 I  XMLParseBase: Loading window settingssetup from /usr/share/mythtv/themes/default/standardsetting-ui.xml
Again, the standardsetting-ui.xml file is only in themes/default/


Line 38228
2021-06-06 23:42:33.102962 I XMLParseBase: Loading window channelscanner from /usr/share/mythtv/themes/MythCenter-wide/config-ui.xml
2021-06-06 23:42:33.104286 E XMLParseBase: No theme file /usr/share/mythtv/themes/MythCenter-wide/config-ui.xml
2021-06-06 23:42:33.104297 I XMLParseBase: Loading window channelscanner from /usr/share/mythtv/themes/default-wide/config-ui.xml
2021-06-06 23:42:33.108057 E XMLParseBase: No theme file /usr/share/mythtv/themes/default-wide/config-ui.xml
2021-06-06 23:42:33.108060 I XMLParseBase: Loading window channelscanner from /usr/share/mythtv/themes/default/config-ui.xml
[/code]
Only windows iconimport and channeloverview are in themes/MythCenter-wide/config-ui.xml
That's normal. The way the screens are found is first look in the current theme (MythCenter-wide), if not found look in the Default-wide theme then finally look in the default theme. Most themes don't bother to theme the settings screens so the fall back to the default themes is expected.

Code: Select all

Empty filename passed to function
...
2021-06-06 23:48:59.971230 E  MythUIFileBrowser: current directory does not exist!
I don’t think its relevant because it works. Is the file browser not supposed to start at the root directory?
It depend on what start directory it's told to use. I don't think it's the problem here though. Probably a bad default path is being used somewhere or a bad location for a storage group perhaps.

Code: Select all

2021-06-06 23:38:53.551929 W  MythUIHelper: No theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-06 23:38:53.551934 W  MythUIHelper: No default theme dir: '/usr/share/mythtv/themes/Mythbuntu'
2021-06-06 23:38:53.551939 E  MythUIHelper: Could not find theme: Mythbuntu - Switching to MythCenter-wide
You usually get something like this if the Theme you have set is missing. So in this case you have the Mythbuntu theme set as your theme in the settings but it isn't installed so the fallback theme MythCenter-wide is being used. Not really a problem.

mythtv-setup-2.log

Code: Select all

2021-06-07 00:29:44.690652 I  ScreenSaverX11Private: DPMS is disabled.
2021-06-07 00:29:44.783345 E  DB Error (StorageGroup::StorageGroup()):
Query was:

Driver error was [1/]:
Driver not loaded
Database error was:
Driver not loaded
This is not good what caused the DB to go away?
ulmus-scott
Junior
Posts: 41
Joined: Sat Jun 05, 2021 12:50 am
United States of America

Re: mythtv-setup freezes upon launching

Post by ulmus-scott »

This is not good what caused the DB to go away?
No idea, since I can log into the database with mysql. Also, mythtv-setup-2.log does say at line 5147:

Code: Select all

2021-06-07 00:29:46.175011 D  PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1

2021-06-07 00:29:46.185538 D  FindDatabase() - Success!
At the beginning of log 1:

Code: Select all

2021-06-06 23:38:52.801762 I  Loading en_us translation for module mythfrontend
2021-06-06 23:38:52.801954 E  DBHostName is not set in config.xml
2021-06-06 23:38:52.801985 E  DBHostName is not set in config.xml
2021-06-06 23:38:52.802012 I  Empty LocalHostName. This is typical.
2021-06-06 23:38:52.802020 I  Using a profile name of: 'htpc-HP' (Usually the same as this host's name.)
2021-06-06 23:38:52.802060 I  DefaultUPnP() - No default UPnP backend
2021-06-06 23:38:52.802105 I  Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
2021-06-06 23:38:52.802125 D  PortChecker::checkPort(): host localhost port 3306 timeLimit 1000 linkLocalOnly 0
2021-06-06 23:38:53.151137 D  PortChecker::checkPort(): socket state 2
2021-06-06 23:38:53.304451 D  PortChecker::checkPort(): socket state 3
2021-06-06 23:38:53.311046 D  PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1

2021-06-06 23:38:53.314080 D  FindDatabase() - Success!

2021-06-06 23:38:53.322401 D  PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1
2021-06-06 23:38:53.327821 N  Setting QT default locale to en_US
2021-06-06 23:38:53.327843 I  Current locale en_US
2021-06-06 23:38:53.327922 N  Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
2021-06-06 23:38:53.342305 I  Display: Defaulting to primary screen (HDMI-2)
and log 2:

Code: Select all

2021-06-07 00:29:44.621766 I  Loading en_us translation for module mythfrontend
2021-06-07 00:29:44.622132 I  Empty LocalHostName. This is typical.
2021-06-07 00:29:44.622143 I  Using a profile name of: 'htpc-HP' (Usually the same as this host's name.)
2021-06-07 00:29:44.622219 I  DefaultUPnP() - No default UPnP backend
2021-06-07 00:29:44.622262 I  Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 0
2021-06-07 00:29:44.623917 I  Display: Defaulting to primary screen (HDMI-2)


I checked the backend and frontend logs (new backend-2 and 3 and frontend-2) and the backend logs have "FindDatabase() - Success!" near the beginning. The frontend-1.log also has "FindDatabase() - Success!" near the beginning, but frontend-2.log has the error and later "FindDatabase() - Success!":

Code: Select all

2021-06-08 12:30:44.048773 E  DB Error (StorageGroup::StorageGroup()):
Query was:

Driver error was [1/]:
Driver not loaded
Database error was:
Driver not loaded
...
line 5115
2021-06-08 12:30:46.015010 D  FindDatabase() - Success!
The error being in the frontend log is a bit strange because the frontend works, so I don't know what to make of it.

Skimming through backend-1.log, nothing stood out to me, but I don't really know what I'm looking for in the backend log.
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: mythtv-setup freezes upon launching

Post by kmdewaal »

About the database error, I do have that also sometimes on my systems. I think this happens when the database does not respond quickly enough. If it is not followed by other database errors it is probably not harmful although it should not happen.

About the log files. I did not see anything wrong in the three mythtv-setup log files.
IIRC you mentioned that you did a new install without dropping the database first and that also caused a non-working mythtv-setup.
This then suggests that a database setting could be of influence.
I did restore your databases here and compared them against each other and against the databases from my own systems.
The difference that showed up is this:

Code: Select all

| XineramaScreen                    | HDMI-2                               | htpc-hp  |
which is HDMI-2 on your database 2 and 3 but 0 on the first database. On my systems it is also 0.
I do not know by heart where this setting is but I suggest for the time being to connect only one screen and to leave this at 0 (or unselected or whatever) and see what happens then.

I do not know if different video settings, e.g. VAAPI or VDPAU or FFmpeg or so does make a difference but maybe you can experiment with this.

I do assume that your mythtv-setup works again if you restore the first database. Is that so?
ulmus-scott
Junior
Posts: 41
Joined: Sat Jun 05, 2021 12:50 am
United States of America

Re: mythtv-setup freezes upon launching

Post by ulmus-scott »

About the database error, I do have that also sometimes on my systems. I think this happens when the database does not respond quickly enough. If it is not followed by other database errors it is probably not harmful although it should not happen.

I do assume that your mythtv-setup works again if you restore the first database. Is that so?

Code: Select all

/usr/share/mythtv/mythconverg_restore.pl --drop_database --create_database --filename mythconverg-1361-20210606235252.sql.gz --verbose
mythtv-setup.real -v most,norefcount --loglevel=debug > mythtv-setup-4.log 2>&1
Yes, after restoring the first database backup, mythtv-setup works fine. The single database error and later "FindDatabase() - Success!" show up in the new mythtv-setup-4.log, so it could be a red herring if you also see that with no functional bugs.

Without the error the log reads:
I Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
D PortChecker::checkPort(): host localhost port 3306 timeLimit 1000 linkLocalOnly 0
D PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1
D FindDatabase() - Success!
D PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1

And with the error:
I Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 0
E DB Error (StorageGroup::StorageGroup()):
Query was:

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

Then, significantly later:
D PortChecker::checkPort(): host localhost port 3306 timeLimit 1000 linkLocalOnly 0
D PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1
D FindDatabase() - Success!
D PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1


IIRC you mentioned that you did a new install without dropping the database first and that also caused a non-working mythtv-setup.
This then suggests that a database setting could be of influence.
Yes, apt purge did not drop the database, and when I reinstalled, mythtv-setup was still broken. Dropping the database before reinstalling did allow mythtv-setup to work correctly until a recording was made.

I tried restoring the other database backups:

Code: Select all

/usr/share/mythtv/mythconverg_restore.pl --drop_database --create_database --filename mythconverg-1361-20210607002840.sql.gz --verbose
mythtv-setup.real -v most,norefcount --loglevel=debug > mythtv-setup-5-2021-06-08T1652.log 2>&1
Back up 2 worked, no freezing.

Code: Select all

/usr/share/mythtv/mythconverg_restore.pl --drop_database --create_database --filename mythconverg-1361-20210607003107.sql.gz --verbose
mythtv-setup.real -v most,norefcount --loglevel=debug > mythtv-setup-6-2021-06-08T1712.log 2>&1
Backup 3 frozen, completely black screen.

I tried restoring backup 2 again, frozen with background only (log 7).
Restored the first backup, works perfectly (log 8).
Restored backup 3, works perfectly (log 9).
Restored backup 3 again, frozen with grayed out menu (log 10).

Dropped database in mysql, restored backup 2, frozen with background only (log 11). (Admittedly the same as previously backup 3 → backup 2.)

I’m baffled. Restoring backup 1 works and so does the next restore over top of it.
I did restore your databases here and compared them against each other and against the databases from my own systems.
Did you try running mythtv-setup with my restored databases?
The difference that showed up is this:

Code: Select all

| XineramaScreen                    | HDMI-2                               | htpc-hp  |
which is HDMI-2 on your database 2 and 3 but 0 on the first database. On my systems it is also 0.
I do not know by heart where this setting is but I suggest for the time being to connect only one screen and to leave this at 0 (or unselected or whatever) and see what happens then.
I only have one monitor connected and I have no idea what that setting is. All the settings I changed should be in the MythTV setup.odt file I uploaded.
I do not know if different video settings, e.g. VAAPI or VDPAU or FFmpeg or so does make a difference but maybe you can experiment with this.
Do you mean the video playback profile setting in the frontend?
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: mythtv-setup freezes upon launching

Post by paulh »

I think you are going to have run mythtv-setup.real under gdb and when it freezes press Ctrl-C and get a backtrace. Maybe that will give us a clue why it's freezing. We can give you more detailed instructions if you have never used gdb.
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: mythtv-setup freezes upon launching

Post by kmdewaal »

Did you try running mythtv-setup with my restored databases?
Yes and mythtv-setup works OK with every restored database. This is however on Fedora 34.

One thing that strikes me is the location of the storage groups:

Code: Select all

MariaDB [mythconverg]> select * from storagegroup;
+----+-------------+----------+------------------------------+
| id | groupname   | hostname | dirname                      |
+----+-------------+----------+------------------------------+
|  1 | Default     | htpc-HP  | /var/lib/mythtv/recordings/  |
|  2 | LiveTV      | htpc-HP  | /var/lib/mythtv/livetv/      |
|  3 | DB Backups  | htpc-HP  | /var/lib/mythtv/db_backups/  |
|  4 | Videos      | htpc-HP  | /var/lib/mythtv/videos/      |
|  5 | Trailers    | htpc-HP  | /var/lib/mythtv/trailers/    |
|  6 | Coverart    | htpc-HP  | /var/lib/mythtv/coverart/    |
|  7 | Fanart      | htpc-HP  | /var/lib/mythtv/fanart/      |
|  8 | Screenshots | htpc-HP  | /var/lib/mythtv/screenshots/ |
|  9 | Banners     | htpc-HP  | /var/lib/mythtv/banners/     |
+----+-------------+----------+------------------------------+
On a Fedora system /var/lib is on the root file system and as such not very suitable for recordings. If /var/lib/mythtv is a mount point for a separate partition or, even better, a separate disk then this is OK. I do not know how this is organized by default in the Ubuntu packages but you might want to check your storage locations and the free space on all disks.
It could be a coincidence but also your DB error is about storage groups.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: mythtv-setup freezes upon launching

Post by paulh »

In order to get MythTV packaged for debian there was some default locations for things like config files, theme fonts and storage groups that had to be changed in order to comply with the Filesystem Hierarchy Standard (FHS) that debian insists on. That's why there are hacks like putting the config.xml file under /etc when MythTV wants it under ~/.mythtv for example.

See https://en.wikipedia.org/wiki/Filesyste ... y_Standard
ulmus-scott
Junior
Posts: 41
Joined: Sat Jun 05, 2021 12:50 am
United States of America

Re: mythtv-setup freezes upon launching

Post by ulmus-scott »

paulh:
I think you are going to have run mythtv-setup.real under gdb and when it freezes press Ctrl-C and get a backtrace. Maybe that will give us a clue why it's freezing. We can give you more detailed instructions if you have never used gdb.
Some instructions would be appreciated, since I have never used gdb.

kmdewaal:
On a Fedora system /var/lib is on the root file system and as such not very suitable for recordings. If /var/lib/mythtv is a mount point for a separate partition or, even better, a separate disk then this is OK. I do not know how this is organized by default in the Ubuntu packages but you might want to check your storage locations and the free space on all disks.
/var/lib is on the root filesystem. I know it is not ideal, but on htpc-HP, the fresh install, I was only using it as a temporary location for testing and it currently has 98 GiB free. It is an SSD.

On htpc, I have an SSD as the root directory and a 4 TB hard drive mounted at /media/data. I copied the folders from /var/lib/mythtv to /media/data/mythtv and set the copies as the storage groups. I am planning on moving the hard drive from htpc to htpc-HP when everything is working.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: mythtv-setup freezes upon launching

Post by paulh »

To get more useful backtraces it helps if it's not already installed to install the mythtv-dbg package that contains the debug symbols.

Code: Select all

sudo apt install mythtv-dgb
Then in a console run mythtv-setup.real under gdb.

Code: Select all

$ gdb mythtv-setup.real
(gdb) run
If you want to run mythtv-setup.real with extra parameters add them after the run command like so

Code: Select all

gdb mythtv-setup.real
(gdb) run --verbose gui
When it freezes or locks up press Ctrl-C in the console (you may have to press RETURN to get back to the (gdb) prompt) then hopefully you should be able to do the normal thread apply all bt full to get the backtrace.

Code: Select all

CTRL-C
(gdb) thread apply all bt full
.
.
.
-- Type <RET> for more, q to quit, c to continue without paging --
Keep pressing RETURN or press C to get the full backtrace.

More details are in the wiki
https://www.mythtv.org/wiki/Debugging#Ubuntu_packages
ulmus-scott
Junior
Posts: 41
Joined: Sat Jun 05, 2021 12:50 am
United States of America

Re: mythtv-setup freezes upon launching

Post by ulmus-scott »

I ran gdb and copied its output from the terminal (gdb_mythtv-setup.txt):

Code: Select all

$ gdb mythtv-setup.real
(gdb) run
I also tried the gdb script on the wiki. The output is probably practically identical (gdb_mythtv-setup_gdbcommands.txt)
Post Reply