[SOLVED] Problems with fresh install on Ubuntu 24

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

Moderator: Forum Moderators

mbliss
Junior
Posts: 26
Joined: Fri Nov 25, 2022 1:28 am
United States of America

[SOLVED] Problems with fresh install on Ubuntu 24

Post by mbliss »

After giving up on the system crashed by the Ubuntu upgrade, I did a fresh install of Ubuntu, then installed MythTV from the package, installed XMLTV following the method outlined in the wiki, and installed the HDHomerun config utility which seems to find the tuner okay.

1.) Now the backend complains that "Backend cannot start normally because Database Schema Update failed" ("Database schema version is 1379")

2.) On the backend dashboard it shows: Backends
Backend: DellT3500 is a Slave on IP 192.168.1.27
Backend: {{ Name }} is a Master on IP 192.168.1.27
I have no idea if this is normal or not or whether something needs to be done with this, and if so, what?...

3.) I can't add a capture card because of "ERROR: Backend Network Failure". Restarting the backend with sudo systemctl restart mythtv-backend.service has no effect.
Last edited by mbliss on Wed Sep 25, 2024 3:34 pm, edited 1 time in total.
white_haired_uncle
Senior
Posts: 563
Joined: Thu Feb 23, 2023 8:55 pm
Location: Safe outside my gilded cage
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by white_haired_uncle »

You'll probably want to post:

Code: Select all

mysql> SELECT * FROM settings WHERE value IN ('BackendServerIP', 'BackendServerIP6', 'BackendServerAddr', 'MasterServerIP', 'MasterServerName') ORDER BY hostname,value;
heynnema
Junior
Posts: 25
Joined: Tue Apr 26, 2016 4:28 pm
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by heynnema »

If I'm reading it correctly, you have two backends running on the same host?
mbliss
Junior
Posts: 26
Joined: Fri Nov 25, 2022 1:28 am
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by mbliss »

If I'm reading it correctly, you have two backends running on the same host?
That would appear to be the case, why I have no idea.

Code: Select all

mysql> SELECT * FROM settings WHERE value IN ('BackendServerIP', 'BackendServerIP6', 'BackendServerAddr', 'MasterServerIP', 'MasterServerName') ORDER BY hostname,value;
That gave me
bash: syntax error near unexpected token `('
and if I removed the () I got no result. Once upon a time I was a whizz at SQL queries, but I seem to have forgotten it all.
white_haired_uncle
Senior
Posts: 563
Joined: Thu Feb 23, 2023 8:55 pm
Location: Safe outside my gilded cage
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by white_haired_uncle »

"mysql> " is the mysql prompt. You need to log in to mysql as mythtv connected to mythconverg to run that.

or, from bash:

Code: Select all

$ mysql -h localhost -u mythtv -p mythconverg -e "SELECT * FROM settings WHERE value IN ('BackendServerIP', 'BackendServerIP6', BackendServerAddr', 'MasterServerIP', 'MasterServerName') ORDER BY hostname,value;"
mbliss
Junior
Posts: 26
Joined: Fri Nov 25, 2022 1:28 am
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by mbliss »

Sorry, I thought it strange that I could run it from bash, but bash didn't complain about it. But nice that I could run it from bash. Unfortunately, the result, after fixing some quote issues, was: ERROR 1054 (42S22) at line 1: Unknown column 'BackendServerIP' in 'where clause'
That doesn't sound promising.
white_haired_uncle
Senior
Posts: 563
Joined: Thu Feb 23, 2023 8:55 pm
Location: Safe outside my gilded cage
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by white_haired_uncle »

That's not right. Those aren't columns, they are values. It should show what it can match even if some don't exist. Pretty sure BackendServerIP isn't used anymore, but it's never been a column AFAIK, and that command shouldn't be looking for one. Sounds like you did something like "SELECT * FROM settings WHERE BackendServerIP in ..."

This is mine for a single backend. You can ignore anything that doesn't say "mythbackend" or "172.30.219.113". "NULL" in hostname just means that this value applies to all hosts.


Code: Select all

MariaDB [mythconverg]> describe settings;
+----------+----------------+------+-----+---------+-------+
| Field    | Type           | Null | Key | Default | Extra |
+----------+----------------+------+-----+---------+-------+
| value    | varchar(128)   | NO   | MUL |         |       |
| data     | varchar(16000) | NO   |     |         |       |
| hostname | varchar(64)    | YES  |     | NULL    |       |
+----------+----------------+------+-----+---------+-------+
3 rows in set (0.002 sec)

MariaDB [mythconverg]> SELECT * FROM settings WHERE value IN ('BackendServerIP', 'BackendServerIP6', 'BackendServerAddr', 'MasterServerIP', 'MasterServerName') ORDER BY hostname,value; 
+-------------------+----------------+-------------+
| value             | data           | hostname    |
+-------------------+----------------+-------------+
| MasterServerIP    | 172.30.219.113 | NULL        |
| MasterServerName  | mythbackend    | NULL        |
| BackendServerAddr | 172.30.219.103 | hawkeye     |
| BackendServerIP   | 172.30.219.103 | hawkeye     |
| BackendServerIP6  |                | hawkeye     |
| BackendServerAddr | mythbackend    | mythbackend |
| BackendServerAddr | 127.0.0.1      | wolverine   |
| BackendServerIP   | 127.0.0.1      | wolverine   |
| BackendServerIP6  | ::1            | wolverine   |
+-------------------+----------------+-------------+
9 rows in set (0.002 sec)
mbliss
Junior
Posts: 26
Joined: Fri Nov 25, 2022 1:28 am
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by mbliss »

Okay, running the query from within MySQL gave this

Code: Select all

+-------------------+--------------+-----------+
| value             | data         | hostname  |
+-------------------+--------------+-----------+
| MasterServerName  | DellT3500    | NULL      |
| BackendServerAddr | 192.168.1.27 | DellT3500 |
| BackendServerIP   |              | DellT3500 |
| BackendServerIP6  |              | DellT3500 |
+-------------------+--------------+-----------+
Curiously, I was able to enter MySQL with

Code: Select all

mysql --user=mythtv --host=localhost mythconverg -p
but not with

Code: Select all

mysql --user=mythtv --host=192.168.1.27 mythconverg -p
white_haired_uncle
Senior
Posts: 563
Joined: Thu Feb 23, 2023 8:55 pm
Location: Safe outside my gilded cage
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by white_haired_uncle »

Sounds like the same issue you saw before. Did you check those files to see if mythtv.cnf is in the right directory, has the right info, etc?

mysql by default only listens on 127.0.0.1, so you need to tell it to listen on 192.168.1.27 (or all).

Not sure what you should have in that table, but someone here will probably want to see it.

Are you going to have any other backends/frontends? If not, using 127.0.0.1 instead of 192.168.1.27 will probably be easier for you.

Fresh u24.04/myth34 install here. I can connect to mysql from anywhere:

Code: Select all

root@u2404:/var/log/mythtv# grep -r bind /etc/mysql
/etc/mysql/mysql.conf.d/mysqld.cnf:bind-address         = 127.0.0.1
/etc/mysql/mysql.conf.d/mysqld.cnf:mysqlx-bind-address  = 127.0.0.1
/etc/mysql/conf.d/mythtv.cnf:bind-address=*

root@u2404:/var/log/mythtv# ls -l /etc/mysql/mysql.conf.d/
total 8
-rw-r--r-- 1 root root  132 Jan 19  2024 mysql.cnf
-rw-r--r-- 1 root root 2220 Sep 17 16:19 mysqld.cnf
lrwxrwxrwx 1 root root   28 Sep 17 15:31 mythtv.cnf -> /etc/mysql/conf.d/mythtv.cnf

root@u2404:/var/log/mythtv# cat  /etc/mysql/conf.d/mythtv.cnf
[mysqld]
bind-address=*
max_connections=100
mbliss
Junior
Posts: 26
Joined: Fri Nov 25, 2022 1:28 am
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by mbliss »

Sounds like the same issue you saw before.
Bingo! What I thought was a "fresh install" (two, actually) turned out to be nothing of the sort. I tried a third time, but only after deleting all partitions on the hard drive with gparted. Now after installing MythTV and going through the setup screens, all is well! Well, sort of well, the frontend launches now, but there's no content available from the menu and I have to configure the remote. And I still need to install XMLTV to get program listings.

Hoping for the best. Will provide an update tomorrow....
mbliss
Junior
Posts: 26
Joined: Fri Nov 25, 2022 1:28 am
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by mbliss »

Continuing with the setup, I seem to have reached an impasse setting up XMLTV using Schedules Direct. Following the configuration in the backend setup, it says to use

Code: Select all

sudo -u mythtv tv_grab_zz_sdjson --configure --config-file "null/VidSource.xmltv"
which gives me

Code: Select all

Failed to write to null/VidSource.xmltv.TMP at /usr/local/share/perl/5.38.2/XMLTV/Configure.pm line 187.
Alternatively, if I follow the MythTV XMLTV page and try to run

Code: Select all

tv_grab_zz_sdjson --configure --config-file $HOME/.mythtv/VidSource.xmltv
or

Code: Select all

tv_grab_zz_sdjson --configure --config-file ~/.mythtv/VidSource.xmltv
I get

Code: Select all

Cache file for lineups, schedules and programs.
Cache file: [/home/dad/.xmltv/tv_grab_zz_sdjson.cache]
where it hangs, and the .xmltv directory is empty. I'm guessing this has something to do with the warning earlier in the wiki
Warning: It seems users are missing the step that says run the setup as the user that will run mythfilldatabase (which is frequently user mythtv.)
but I can't su to mythtv, none of the obvious guesses for passwords work, and if I do "sudo -i -u mythtv" I get "mythtv is not in the sudoers file." when I try to run the configure command. Also

Code: Select all

sudo -i -u mythtv
$ ls
$ pwd
/home/mythtv
So now I'm stumped again....
white_haired_uncle
Senior
Posts: 563
Joined: Thu Feb 23, 2023 8:55 pm
Location: Safe outside my gilded cage
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by white_haired_uncle »

Code: Select all

sudo -u mythtv tv_grab_zz_sdjson --configure --config-file "null/VidSource.xmltv"
Bug which should be fixed in newer versions.

Code: Select all

tv_grab_zz_sdjson --configure --config-file ~/.mythtv/VidSource.xmltv
from the looks of it, you're logged in as dad at that point. Don't do that, run it as mythtv:

Code: Select all

sudo -u mythtv tv_grab_zz_sdjson --configure --config-file ~mythtv/mythtv/VidSource.xmltv
Note: The above assumes your video source is named "VidSource". Mine is "antenna" so I use "~mythtv/.mythtv/antenna.xmltv". This trips some people up.

Note: at this point, you can do the above, or do what's below. Pick one.

Code: Select all

sudo -i -u mythtv
$ ls
$ pwd
/home/mythtv
Looks like you're probably on as mythtv at this point. You could run 'id' to be sure. If so, it's time to go back and do this...

Code: Select all

tv_grab_zz_sdjson --configure --config-file ~mythtv/.mythtv/VidSource.xmltv
With one caveat. I like the sqlite version better. There's a chance you may decide later that's what you want to use. If so, you'll have to do this all over again. So maybe you want to switch now just in case, maybe you don't. This version will work, it just may have some issues with some of your channels. Up to you.
but I can't su to mythtv, none of the obvious guesses for passwords work, and if I do "sudo -i -u mythtv" I get "mythtv is not in the sudoers file." when I try to run the configure command.
Okay, at this point if you're logged in as mythtv (and it sounds like you are since it said "mythtv is not in the sudoers file." you don't use sudo in the configure command. That "sudo -u mythtv" was supposed to make the command run as mythtv. Now that you are mythtv there's no reason for it (and since mythtv can't use sudo, it not worky). If you're logged in as mythtv, your configure command is

Code: Select all

tv_grab_zz_sdjson --configure --config-file ~mythtv/.mythtv/VidSource.xmltv
again, assuming your video source is "VidSource".
mbliss
Junior
Posts: 26
Joined: Fri Nov 25, 2022 1:28 am
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by mbliss »

Okay, I think we're getting close. The config command under my login gave the same file error, but doing

Code: Select all

sudo -i -u mythtv
tv_grab_zz_sdjson --configure --config-file ~mythtv/.mythtv/VidSource.xmltv
got me to the same point as before when I thought the program was hung, but little did I know it was just waiting for my input, so upon hitting Enter, it continued on and retrieved my info from Schedules Direct. After continuing with the setupwizard, I now have channels listed in the frontend. Running mythfilldatabase under my login failed, but worked when run as mythtv. And initially, I couldn't watch or record TV, but then I realized that there were no storage groups configured. The wiki implies that a Default storage group would be configured, but apparently not in my case. With that configured, I can now watch and record.

Remaining issue is in the program guide and other areas of the frontend, I get double imaging that makes it hard to read. I can't find any way to address that, something with Ubuntu settings? Watching TV or recordings appears fine, it's just things like the program guide where the screen is garbled.
Last edited by mbliss on Mon Sep 23, 2024 9:51 pm, edited 1 time in total.
User avatar
bill6502
Developer
Posts: 2439
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by bill6502 »

You ran the setup part as user mythtv (the same user the backend runs as), that's good.

But you ran mythfilldatabase as user dad. I always run mythfilldatabase as user mythtv. That
way there's only one configuration, though some folks create symbolic links. But that's
just another thing to maintain and/or go wrong.

Here's an example of the only new files in play for XMLTV:
viewtopic.php?p=19508#p19508 As it says at the bottom of that
post, there shouldn't be similar files under you own user.

My personal solution is to add the following line to my .bashrc file:

Code: Select all

alias mfdbrun='sudo --set-home --user=mythtv mythfilldatabase --verbose=system,xmltv'
and then I just type: mfdbrun to start mythfilldatabase. Of course you have to re-read
the .bashrc file like this: . ~/.bashrc (you only need to do this once, the alias will always be
there after future logins.
mbliss
Junior
Posts: 26
Joined: Fri Nov 25, 2022 1:28 am
United States of America

Re: Problems with fresh install on Ubuntu 24

Post by mbliss »

But you ran mythfilldatabase as user dad.
Sorry, I was editing my post and deleting that part while you were responding :-)

And one last update, selecting "Ubuntu on X.org" at login solved the double imaging problem.

Much gratitude to those who lent a hand, would never have been able to do all of this on my own. And I suppose this thread should be marked as "Solved" if possible ....
Post Reply