[Solved] FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

For discussion of topics specific to MythTV on linux
User avatar
anoldguy
Junior
Posts: 27
Joined: Sat Jul 11, 2020 8:07 pm
United States of America

[Solved] FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by anoldguy »

[See Summary at most recent message]

Clean install of Ubuntu 20.04

Installed MythTV FrontEnd fixes/31 on ‘robert99’

When I start MythTV FE on ‘robert99’, the message is that it cannot connect to the database.

I can start the MythTV FE on the computer named ‘computer’ [with the BackEnd] and it allows me to use MythTV.

I can terminal ping ‘computer’ from ‘robert99’ with no problem.

The Database Configuration setup screen on ‘robert99’ is the same as ‘computer’, except that ‘computer’ has a Hostname of 'localhost' and ‘robert99’ has the IP address of ‘computer’.

‘computer’ has a security PIN of 1234 and ‘robert99’ matches.


Here is the ‘robert99’ /var/log/mythtv/mythfrontend.log
I have been searching and trying for days on this problem and have run out of ideas.

Both computers were working fine on Ubuntu 14.04 and MythTV 27 before this clean install.
I restored my old database on the 'computer' backend and made changes for the new version.


OTHER SYMPTOMS: [pertinent?]

I can’t seem to run MythFillDataBase and mythconverg_backup.pl from a terminal window [sudo su - mythtv] without fully-qualifying them.

When I start the MythTV BackEnd, it can’t delete the LiveTV recordings I have made [log says not found, but .ts files exist in /var/lib/mythtv/livetv/ with a padlock symbol on the files].

I had to put in a delay for the BackEnd to start up, to allow the HVR2250s to download firmware.

I can’t watch TV recordings with a Time Stretch > 1.25, it has audio dropouts. The same hardware ran fine at 2.0 times. Also sometimes lip-synch delays on recordings.


HARDWARE:

Ubuntu 20.04 (x86_64)
Qt 5.12.8
MythTV fixes/31 (v31.0-v31.0)
Intel Core i7-2600K CPU @ 3.40GHz × 8
Intel HD Graphics 3000 (SNB GT2)
Gnome 3.36.3
7.7 GB RAM
Last edited by anoldguy on Tue Jul 21, 2020 6:59 pm, edited 1 time in total.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by bill6502 »

Using the DB credentials in .mythtv/config.xml here: Using configuration directory = /home/banana/.mythtv
make sure this works: mysql --user=<probably mythtv> --password --hostname=<probably computer> mythconverg
User avatar
anoldguy
Junior
Posts: 27
Joined: Sat Jul 11, 2020 8:07 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by anoldguy »

Thank you for the response Bill.

This is weird.

On the Front End only computer, robert99,
the /home /*/.mythtv /config.xml files are different between
banana.at.robert99 and mythtv.at.robert99.
The mythtv user’s MySQL password is different from the others on the sytem.

On the Back End computer, ‘computer’,
the /home /*/.mythtv /config.xml files are the same
for banana.at.computer and mythtv.at.robert99.

On the robert99 Front End computer, I tried your signing on to MySQL
for both users, and for a host name of ‘computer’, I got
ERROR 2005 (HY000): Unknown MySQL server host 'computer' (11)
and for a host name of 192.168.0.102, I got
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.102' (111)

The same results on the Back End computer ‘computer’.

Then I tried it as mythtv.at.computer with a host name of ‘localhost’
and it put me into MySQL fine.

/etc/ mythtv/config.xml has the password, but refers to localhost

I’m confused and tempted to re-install MythTV 31
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by bill6502 »

This isn't a v31 issue, I wouldn't uninstall it.

My normal response re config.xml is to direct folks here: https://www.mythtv.org/wiki/Config.xml#Troubleshooting

But, to be honest, it isn't helping everyone.

Do this:

Code: Select all

$ ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
-rw-rw---- 1 mythtv mythtv 565 Mar 24 13:53 /etc/mythtv/config.xml
lrwxrwxrwx 1 bill   bill    22 May 26  2019 /home/bill/.mythtv/config.xml -> /etc/mythtv/config.xml
lrwxrwxrwx 1 mythtv mythtv  22 May 26  2019 /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml
Some distributions, esp. *buntu, use links (which the Wiki eludes to.)

And sometimes, one or the other link gets broken. I don't know why/how. Mine don't.

As to the mysql command failing, my 1st guess is missing GRANTS. From the root DB user
not to be confused with the linux root user, try SHOW GRANTS FOR 'username'@'hostname'
most likely the username=mythtv and hostname=whatever you use. Although the hostname
localhost should be there already.

locate -b '\mc.sql' should find the file that creates grants. DON'T edit it, but use the
syntax there to create new users/hostname combinations if that's the issue.

Only lines 2-5 discussed this here are needed: viewtopic.php?f=36&t=3911&p=19063#p19021
User avatar
anoldguy
Junior
Posts: 27
Joined: Sat Jul 11, 2020 8:07 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by anoldguy »

Wow Bill, thanks for that fascinating trip down a rabbit hole.

I changed the config.xml files in
/ home / banana /.mythtv,
/ home / mythtv /.mythtv, and in
/ etc / mythtv
to have a host name of localhost.

The config.xml file in
/ usr / share / mythtv has a host name of 127.0.0.1,
but I thought I need to leave that alone.

Now the BackEnd seems to start [the liveTV autoexpire is still failing: GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/computer/].

Whew. Thank you Bill!


When I start the FrontEnd [on the system with the BackEnd]
I get MythTV Startup Status screen with ‘Database failed to start’.

If I choose the ‘Setup’ button, it flickers and won’t take me into the Setup screen.

Looking at / var / log / mythtv / mythfrontend.log, it says,
...
Start up testing connections. DB 192.168.0.102, BE , attempt 10, status dbAwake, Delay: 2000
… Start up failure…

If I try from a terminal:
sudo su - mythtv
[sudo] password for banana:
$
$ mythfrontend
error: XDG_RUNTIME_DIR not set in the environment.
error: XDG_RUNTIME_DIR not set in the environment.
error: XDG_RUNTIME_DIR not set in the environment.
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted (core dumped)
$
$ date
Thu 16 Jul 2020 04:19:24 PM EDT


Looks like it is remembering the BackEnd IP address from somewhere,
but won’t let me configure a new one.
I don’t know where the file is that it is getting the IP address from.

The above was on the BackEnd desktop, Ubuntu 20.04, MythTV 31/Fixes.


BTW on the MySQL Grants idea:

mysql> SHOW GRANTS FOR mythtv
-> ;
+---------------------------------------------------------+
| Grants for mythtv@% |
+---------------------------------------------------------+
| GRANT USAGE ON *.* TO `mythtv`@`%` |
| GRANT ALL PRIVILEGES ON `mythconverg`.* TO `mythtv`@`%` |
+---------------------------------------------------------+
2 rows in set (0.00 sec)

There are no Grants for the user ‘banana’.


Thanks again for all of your help Bill, I appreciate it. -Mike
User avatar
anoldguy
Junior
Posts: 27
Joined: Sat Jul 11, 2020 8:07 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by anoldguy »

Day 9 of the MythTV 27 to 31 conversion.

I did a mythtv --reinstall, but I still cannot open the database from any FrontEnd.

I was in database mythconverg in the settings table looking for clues why my FrontEnds won’t connect to the database.

I discovered lots of hostname entries for computers no longer on my network, so I deleted those rows.


For my BackEnd hostname, I found TWO rows for the
value BackendServerAddr, both had the address of 192.168.0.102 [correct]
and also TWO rows for the
value BackendServerIP, likewise with 192.168.0.102.
[Do I need to delete the duplicate rows?]

- - - - - - -

A value MasterServerIP 192.168.0.102 NULL.
[Is this NULL hostname a problem? There are many rows with a hostname of NULL]

- - - - - - -

A value DefaultVxmlUrl data http:||192.168.1.101/vxml/index.vxml on the correct BackEnd hostname [incorrect subnet address]
Is this setting value not used? [Voicemail?]

- - - - - - -

For HardwareProfilePublicUUID and HardwareProfileUUID with the BackEnd hostname, I have UUIDs that are not disc drives on the current system.
[This database goes back many years. When I converted from old Ubuntu to 20.04, I replaced the system disc drive with a SSD. The MythTV27 database used the old hard drive.]

Same for SystemUUID host NULL.

The UUIDs for the BackEnd hostname: UPnP/UDN/MasterMediaServer,
UPnP/UDN/MediaServer, and UPnP/UDN/SlaveMediaServer and not one of the disc drives on my present BackEnd.

Also a strange one:
upnp:UDN: urn:schemas-upnp-org:device:MediaServer:1 unrecognizable UUID

Are these UUIDs in use and messing up my Front Ends, or are they vestigial?
Should they be deleted?
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by blm-ubunet »

It is okay to have multiple BackendServerAddr & BackendServerIP as long as the hostnames are different.
Mine has old remote BEs & FEs..
The Master (not sure for how long!) backend is set by MasterServerIP etc.

MasterServerIP 192.168.1.32 NULL is fine. I recall this always being that way.

AFAIU
If you want remote FEs & BEs you have to have mysql server setup to listen on IP addr (not 127... not localhost)
Your attempts to connect to mysql server fail on both your PCs when you tried to use real IP.
I don't think your dB server is listening to anything outside of the MBE (localhost).

My result for SHOW GRANTS for mythtv; is exactly same as you. And that is from a remote PC logged in by:
mysql -hmythbe01 -umythtv -p mythconverg
mythbe01 == 192.168.1.32 in /etc/hosts file.

The hostname (to be usable) has to resolve to an IP via hosts file or DHCP? server. Check what this resolves to on each computer.
I believe you must use static IPs for MBE if you wish to use remote FEs & BEs.
I found this painful in *buntu-20.04

Smarter people than me say you can use localhost for the FE on the same PC as MBE (for possible remote FE etc) .. for me this does not work.
I run mythfrontend as different user to 'mythtv' just because I did 12+ years ago.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by bill6502 »

@blm-ubunet, right. In the DB, NULL hostname entries are Global.

I think your mixing config.xml and backend addresses.

In the Database section of config.xml on a backend (or combined backend/frontend),
the Host should be localhost (or 127.0.0.1) so that sockets are used to connect to the DB. Using
TCP is a waste there. Unless the DB is on a different host, unlikely, but it's allowed.

In mythtv-setup, a backend that allows access from remote frontends must have a routable address, typically a
Private Network address like 192.168.1.2.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by bill6502 »

@anoldguy, sorry this isn't working for you. The Ubuntu packaging should have set things up
correctly in the 1st place. On your backend host:

Code: Select all

cat /etc/mysql/conf.d/mythtv.cnf
ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
mysql --user=<probably mythtv, but see UserName from config.xml> --password=<Password from config.xml> --host=<Host in config.xml> mythconverg
Repeat the ls and mysql command on the remote frontend, The --host value should be
different on the mysql command because its the host running MySQL (or MariaDB) isn't on the remote
host.

Can we see the current command line and output from the five commands above?
User avatar
anoldguy
Junior
Posts: 27
Joined: Sat Jul 11, 2020 8:07 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by anoldguy »

Thank you blm-ubunet and bill6502.

The FrontEnd on the BackEnd host is now working!
I changed the Host Address Backend Setup
Primary IP Address/DNS Name to ‘localhost’.
The FrontEnd on BackEnd seems to be working,
except that AutoExpire List deleting LiveTV recordings.
Other than my recent mess-up, I have had no problems with
running FrontEnd on the same BackEnd host since, I think MythTV 21.

For a FrontEnd on a different host,
I am beginning to suspect an issue with Ubuntu 20.04.


Here are the results of Bill’s test.
I used the file in / home / mythtv / .mythtv / config.xml
The BackEnd is colossus and the FrontEnd is zworykin.

BACKEND
banana@colossus:~$ date
Sun 19 Jul 2020 02:13:14 PM EDT
banana@colossus:~$ cat /etc/mysql/conf.d/mythtv.cnf
[mysqld]
#bind-address=::
max_connections=100
banana@colossus:~$
banana@colossus:~$ ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
-rw-rw---- 1 mythtv mythtv 452 Jul 16 13:42 /etc/mythtv/config.xml
-rw-rw-r-- 1 banana banana 837 Jul 19 12:05 /home/banana/.mythtv/config.xml
lrwxrwxrwx 1 root root 22 Jul 9 13:31 /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml
banana@colossus:~$
banana@colossus:~$ mysql --user=mythtv --password=****** --host=127.0.0.1 mythconverg
mysql: [Warning] Using a password on the command line interface can be insecure.
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 105
Server version: 8.0.20-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

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>

FRONTEND
banana@zworykin:~$ date
Sun 19 Jul 2020 02:42:55 PM EDT
banana@zworykin:~$ cat /etc/mysql/conf.d/mythtv.cnf
cat: /etc/mysql/conf.d/mythtv.cnf: No such file or directory
banana@zworykin:~$
banana@zworykin:~$ ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
-rw-rw---- 1 mythtv mythtv 456 Jul 15 19:59 /etc/mythtv/config.xml
-rw-rw-r-- 1 banana banana 746 Jul 19 12:30 /home/banana/.mythtv/config.xml
lrwxrwxrwx 1 root root 22 Jul 11 19:52 /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml
banana@zworykin:~$
banana@zworykin:~$ mysql --user=mythtv --password=****** --host=192.168.0.102 mythconverg
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.102' (111)
banana@zworykin:~$

I tried the hostname colossus
banana@zworykin:~$ mysql --user=mythtv --password=****** --host=colossus mythconverg
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2005 (HY000): Unknown MySQL server host 'colossus' (11)
banana@zworykin:~$

It is connected
banana@zworykin:~$ ping 192.168.0.102
PING 192.168.0.102 (192.168.0.102) 56(84) bytes of data.
64 bytes from 192.168.0.102: icmp_seq=1 ttl=64 time=0.347 ms
64 bytes from 192.168.0.102: icmp_seq=2 ttl=64 time=0.423 ms
64 bytes from 192.168.0.102: icmp_seq=3 ttl=64 time=0.427 ms
64 bytes from 192.168.0.102: icmp_seq=4 ttl=64 time=0.443 ms
^C
--- 192.168.0.102 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3078ms
rtt min/avg/max/mdev = 0.347/0.410/0.443/0.037 ms
banana@zworykin:~$
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by blm-ubunet »

Pinging another box only means the network is up & hostname (if used) is resolved.
If you ping 'colossus', from remote FE, it probably fails as you do not have a name resolver service &/or no entry in /etc/hosts file

Your mysql server is not listening on a external IP address.
You can only connect to it on the local machine & using localhost or 172...

I only know how to make mysql listen on a specific IP address (TCP), I do not know how to make it listen on local (socket) & TCP for remote BE & FE.
Maybe that is an automatic trick in MythTV.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by bill6502 »

Good info, thanks.

On the DB server/backend, this is wrong and should have been
correct based on an answer to a question† when the package was
installed:

Code: Select all

$ cat /etc/mysql/conf.d/mythtv.cnf
[mysqld]
#bind-address=::
The # above means comment and that MySQL is only listening on it's own host.
Remove the #. You may need to restart mysql (sudo systemctl restart mysql)

Code: Select all

banana@colossus:~$ ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
-rw-rw---- 1 mythtv mythtv 452 Jul 16 13:42 /etc/mythtv/config.xml
-rw-rw-r-- 1 banana banana 837 Jul 19 12:05 /home/banana/.mythtv/config.xml
lrwxrwxrwx 1 root root 22 Jul 9 13:31 /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml
This is OK, but non-standard. Note that there's only one link, not two.
Remove /home/banana/.mythtv/config.xml and link it to /etc/mythtv/config.xml.
ln -s /etc/mythtv/config.xml /home/banana/.mythtv/config.xml
If you have multiple copies of the file, then it's necessary to update all of them
vs. just one. Really a personal choice.

People reading this thread should note that if their distribution uses MYTHCONFDIR,
then the above won't apply.

† Will other computers run MythTV?
If any other computers (that includes other Front End machines) with MythTV
will be used, this computer needs to be configured to allow remote connections.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by bill6502 »

@blm-ubunet, you're right, listening on a socket is partly done in the MythTV code.
If the Host is 127.0.0.1 it gets converted to localhost and the DB server knows what
to do:
https://code.mythtv.org/cgit/mythtv/tre ... n.cpp#n156
User avatar
anoldguy
Junior
Posts: 27
Joined: Sat Jul 11, 2020 8:07 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by anoldguy »

Thank you! I un-commented the bind-address in the MySQL mythtv.cnf file.
That gave me access on the FrontEnd machine:

root@zworykin:/home/banana#
root@zworykin:/home/banana# cat /etc/mysql/conf.d/mythtv.cnf
cat: /etc/mysql/conf.d/mythtv.cnf: No such file or directory
root@zworykin:/home/banana#
root@zworykin:/home/banana# date
Sun 19 Jul 2020 05:39:55 PM EDT
root@zworykin:/home/banana# mysql --user=mythtv --password=****** --host=192.168.0.102 mythconverg
mysql: [Warning] Using a password on the command line interface can be insecure.
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 41
Server version: 8.0.20-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

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>

I don’t remember being prompted for this parameter at install time.

- - - - -

When I start the FrontEnd on the FEOnly host, it still prompts me:
Zw FE config a.jpg
Zw FE config a.jpg (150.93 KiB) Viewed 2438 times
Zw FE config b2.jpg
Zw FE config b2.jpg (210.07 KiB) Viewed 2438 times
I keep changing the address to 192.168.0.102, but it still won’t connect and the next boot it goes back to the 127 address. I made all 4 config.xml files I found have the correct IP address. I don’t know where it reverts to / why it doesn’t save the change.

I did a reinstall of mythfrontend on the FE. No difference. I’m tempted to reinstall Ubuntu and mythfrontend.

I don’t know how to allow remote connections. Different from Remote Desktop, right?
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: FrontEnd won’t connect on remote computer Myth 31 Ubuntu 20.04

Post by bill6502 »

/etc/mysql/conf.d/mythtv.cnf only exists on for the DB server that's why I only asked
for the ls and mysql commands on the remote frontend. This is OK.

"I don’t remember being prompted for this parameter at install time.", I see, you only did the
install on the new frontend. No worries, it's fixed.

Reinstalling during all of this isn't helpful. We can't tell what may/may not heve
changed.

Let's see the remote frontend log. Try to start the it from the command line like this:

mythfrontend.real --logpath /tmp

Exit the GUI.

There will be an obvious (and long) filename in /tmp.
Attach the output here. Or, use pastebin.com if it won't attach.

As to:
I keep changing the address to 192.168.0.102, but it still won’t connect and the next boot it goes back to the 127 address. I made all 4 config.xml files I found have the correct IP address. I don’t know where it reverts to / why it doesn’t save the change.
Typically a permissions issue.

Type this: sudo adduser `whoami` mythtv. If you're already a member of
the mythtv group, a message will tell you that. If it does add you, then the easiest
method to have it take effect is to simply reboot the remote frontend.

You mentioned "all 4 config.xml files". There's only one: /etc/mythtv/config.xml. The one
for your user (and on the backend for user mythtv) are links to the one in /etc. See previous
posts for how to fix that. [I thought it was done.] The one in /usr/share/mythtv isn't in play. It
is used as a template when /etc/mythtv/config.xml doesn't exist.
Post Reply