[SOLVED] Frontend cannot link to backend

For discussion of topics specific to MythTV on linux
Post Reply
pinnerite
Senior
Posts: 260
Joined: Mon Apr 07, 2014 2:34 pm
Great Britain

[SOLVED] Frontend cannot link to backend

Post by pinnerite »

This is a fresh installation under Mageia 5 following an upgrade from Mageia 4.

Before installing MySQL (MariaDb) I had modified /etc/my.cnf so that datadir = /home/mysql.
With the backend running, when I start the frontend it reports that cannot connect to the backend.

Both frontend and backend are on the same machine.
Its hostname is origen.albury
Its IP address is 192.168.0.5 entered in two places in the backend setup (IPv4 address and IP address) and config.xml at /home/mythtv/.mythtv.
I cannot find any mythtv-setup logs but these are the last few lines of the backend.log

2016-03-17 20:26:31.488970 I [3755/3755] CoreContext housekeeper.cpp:655 (Start) - Starting HouseKeeper.
2016-03-17 20:26:31.490069 I [3755/3755] CoreContext serverpool.cpp:404 (listen) - Listening on TCP 127.0.0.1:6544
2016-03-17 20:26:31.490096 I [3755/3755] CoreContext serverpool.cpp:404 (listen) - Listening on TCP 192.168.0.5:6544
2016-03-17 20:26:31.490136 I [3755/3755] CoreContext serverpool.cpp:404 (listen) - Listening on TCP [::1]:6544
2016-03-17 20:26:31.490170 E [3755/3755] CoreContext serverpool.cpp:416 (listen) - Failed listening on TCP [fe80::6236:ddff:fe23:621b%wlp5s0]:6544 - Error 9: The address is not available
2016-03-17 20:26:31.490215 E [3755/3755] CoreContext mediaserver.cpp:86 (Init) - MediaServer::HttpServer Create Error
2016-03-17 20:26:31.490865 I [3755/3755] CoreContext serverpool.cpp:404 (listen) - Listening on TCP 127.0.0.1:6543
2016-03-17 20:26:31.490887 I [3755/3755] CoreContext serverpool.cpp:404 (listen) - Listening on TCP 192.168.0.5:6543
2016-03-17 20:26:31.490917 I [3755/3755] CoreContext serverpool.cpp:404 (listen) - Listening on TCP [::1]:6543
2016-03-17 20:26:31.490944 E [3755/3755] CoreContext serverpool.cpp:416 (listen) - Failed listening on TCP [fe80::6236:ddff:fe23:621b%wlp5s0]:6543 - Error 9: The address is not available
2016-03-17 20:26:31.490969 C [3755/3755] CoreContext main_helpers.cpp:681 (run_backend) - Backend exiting, MainServer initialization error.

Help would be much appreciated.
Last edited by pinnerite on Fri Mar 18, 2016 8:09 pm, edited 1 time in total.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Frontend cannot link to backend

Post by bill6502 »

pinnerite wrote: ...
Before installing MySQL (MariaDb) I had modified /etc/my.cnf so that datadir = /home/mysql.With the backend running, when I start the frontend it reports that cannot connect to the backend.

Code: Select all

2016-03-17 20:26:31.490170 E [3755/3755] CoreContext serverpool.cpp:416 (listen) - Failed listening on TCP [fe80::6236:ddff:fe23:621b%wlp5s0]:6544 - Error 9: The address is not available
I would go back to mythtv-setup and look for "Listen on Link-Local addresses"
and turn it off. If that doesn't help, then stop the backend, verify that it's stopped
and restart from the command line with:

sudo mythbackend --user mythtv --loglevel debug --logpath /tmp

and attach the file in /tmp here. That provides a single log for that
run with the best detail (as opposed to console output.)

Also, I moved my datadir too, but changing it in my.cnf is the worst choice.
Rather, find the directory for local changes (/etc/mysql/mariadb.conf.d in
my case) and add a file there. That way if the package manager releases
a new my.cnf your changes won't get overwritten (restore /etc/my.cnf to
the original value too.) There have been cases where mythtv.cnf got
clobbered by a MythTV distribution too, but at least you know that you
did that. One user uses xmythtv.cnf to protect against that.

Example:

Code: Select all

$ cat /etc/mysql/mariadb.conf.d/mythtv.cnf
[mysqld]
bind-address=::
max_connections = 100
datadir		= /srv/db
pinnerite
Senior
Posts: 260
Joined: Mon Apr 07, 2014 2:34 pm
Great Britain

Re: Frontend cannot link to backend

Post by pinnerite »

Disabling "Listen on Link-Local addresses' did the trick.
However there is still an error message in the backend log. Here is a snip:

2016-03-18 14:21:11.121239 I [3914/3914] CoreContext housekeeper.cpp:655 (Start) - Starting HouseKeeper.
2016-03-18 14:21:11.122438 I [3914/3914] CoreContext serverpool.cpp:404 (listen) - Listening on TCP 127.0.0.1:6544
2016-03-18 14:21:11.122468 I [3914/3914] CoreContext serverpool.cpp:404 (listen) - Listening on TCP 192.168.0.5:6544
2016-03-18 14:21:11.122517 I [3914/3914] CoreContext serverpool.cpp:404 (listen) - Listening on TCP [::1]:6544
2016-03-18 14:21:12.069608 E [3914/3914] CoreContext bonjourregister.cpp:60 (Register) - Bonjour: Error: -65537
2016-03-18 14:21:12.069614 E [3914/3914] CoreContext bonjourregister.cpp:77 (Register) - Bonjour: Failed to register service.
2016-03-18 14:21:12.069620 I [3914/3914] CoreContext main_helpers.cpp:668 (run_backend) - Main::Registering HttpStatus Extension

As I have a problem linking from a remote frontend. I thought I had better mention it.

So now the local frontend is working but the remote one cannot link to the database.
At first I couldn't ping the backend server but turning off the firewall cleared that.
The remote frontend had been working before the upgrade of the o/s on the backend machine.

Finally I couldn't follow your advice regarding datadir. Mageia has no /etc/mysql and no mythtv.cnf on the machine either.
Furthermore now that the database is situated at /home/mysql. I'm too nervous to undertake serious surgery a this stage. :)





2016-03-18 14:10:33.897210 I Testing network connectivity to '192.168.0.5'
2016-03-18 14:10:33.897433 I Starting process manager
2016-03-18 14:10:33.898601 I Starting process signal handler
2016-03-18 14:10:33.898759 I Starting IO manager (read)
2016-03-18 14:10:33.898793 I Starting IO manager (write)
2016-03-18 14:10:33.997564 I New Client: (#1)
2016-03-18 14:10:34.009558 E Unable to connect to database!
2016-03-18 14:10:34.009575 E Driver error was [1/1130]:
QMYSQL: Unable to connect
Database error was:
Host '192.168.0.2' is not allowed to connect to this MariaDB server
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Frontend cannot link to backend

Post by bill6502 »

Hi,

https://www.mythtv.org/wiki/MythTV-HOWT ... le_systems
is most likely the answer. The frontend is getting to the backend, but it's not allowed to connect.

Re/Re the datadir. I understand not wanting to change what works. Would be interesting to see
if your system has a line similar to this in its /etc/my.cnf file: !includedir /etc/mysql/conf.d/ which
tells mysql where to look for local configuration changes.
pinnerite
Senior
Posts: 260
Joined: Mon Apr 07, 2014 2:34 pm
Great Britain

Re: Frontend cannot link to backend

Post by pinnerite »

You are right!
I twigged that the pronblem was MySqL access and just added the line giving it to all membes of the LAN and changed the bind-address to the server's address.

The last line in my.cnf is indeed !includedir /etc/mysql/conf.d/ but I don't think adding a line there would be any different to doing so elsewhere that is likely not to get overwritten next time there is a distro upgrade. My next job is to plan what needs backing up before the next one. Sadly Mageia's release cycle is to be 9 months with support overall for 18 months.

I'm very grateful for your help. I owe you one. AS
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Frontend cannot link to backend

Post by bill6502 »

Good to hear, for the benefit of others that might trip over this thread, please
append [Solved] to the Subject:. To finish off the datadir (or other local changes)
a proper distribution upgrade/update will never touch local changes.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Frontend cannot link to backend

Post by wesnewell »

I cured the bind address problem forever by adding my on config file (xmythtv.cnf) that gets loaded last in line.
wes@mythfe0:~$ ls /etc/mysql/conf.d/
mysqld_safe_syslog.cnf mythtv.cnf.dpkg-dist xmythtv.cnf
mythtv.cnf mythtv-tweaks.cnf
wes@mythfe0:~$ cat /etc/mysql/conf.d/xmythtv.cnf
[mysqld]
bind-address = 0.0.0.0
wes@mythfe0:~$

Prior to this, every update screwed it up.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
pinnerite
Senior
Posts: 260
Joined: Mon Apr 07, 2014 2:34 pm
Great Britain

Re: [SOLVED] Frontend cannot link to backend

Post by pinnerite »

I cannot recall a problem with updates (of this nature).

It wasn't the updates it was the full uograde that caused my problems.
I only have two partitions / and /home.

The root partition is always reformatted when a new distro version is in installed.
That was why I put the MySQL database at /home/mysql in the first place.
I had already backed up the CUPS ppds, samba.conf, hosts. hostnames etc but
clearly there is more.

Thanks again
Post Reply