[Solved] Frontend unable to connect to the backend

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

Moderator: Forum Moderators

Post Reply
Julius22
Newcomer
Posts: 8
Joined: Sat Mar 21, 2020 9:40 am
France

[Solved] Frontend unable to connect to the backend

Post by Julius22 »

I'm having an issue connecting my frontend to the backend on the same computer.

I made a fresh install of Debian Buster via the net install iso on this computer in order to use MythTV on it. My local network is on the 192.168.10.x subnet mask. My computer has a hostname that I gave it (so, not the default one). In the MythTV settings, it seems that all I typed in it is OK. As an admin user, I can use mythtv-setup with no problem. But it gets stuck with the mythtv user. :(

Here are the commands I used with MariaDB.

Code: Select all

GRANT ALL PRIVILEGES ON mythconverg.* TO 'mythtv'@'192.168.10.%' IDENTIFIED BY 'mot de passe';
GRANT ALL PRIVILEGES ON mythconverg.* TO 'mythtv'@'127.0.0.1' IDENTIFIED BY 'mot de passe';
GRANT ALL PRIVILEGES ON mythconverg.* TO 'mythtv'@'localhost' IDENTIFIED BY 'mot de passe';
UPDATE user SET Password=PASSWORD('mot de passe') WHERE user='mythtv';
FLUSH PRIVILEGES;
I also tried the following.

Code: Select all

GRANT ALL PRIVILEGES ON mythconverg.* TO 'mythtv'@'192.168.10.%' IDENTIFIED BY 'mot de passe' WITH GRANT PRIVILEGES;
GRANT ALL PRIVILEGES ON mythconverg.* TO 'mythtv'@'127.0.0.1' IDENTIFIED BY 'mot de passe' WITH GRANT PRIVILEGES;
GRANT ALL PRIVILEGES ON mythconverg.* TO 'mythtv'@'localhost' IDENTIFIED BY 'mot de passe' WITH GRANT PRIVILEGES;
UPDATE user SET Password=PASSWORD('mot de passe') WHERE user='mythtv';
FLUSH PRIVILEGES;
Whatever user I use, the following command gives a good answer.

Code: Select all

mysqlcheck --user=mythtv --password=mot de passe mythconverg
But with mythfrontend (with any user), there is nothing to do to start it. The following message appears. :(

Code: Select all

E [DBManager0] Unable to connect to database!
E Driver error was [1/1045]: QMYSQL:
Unable to connect
Database error was:
Access denied for user 'mythtv'@'localhost' (using password: YES)
I Start up testing connections, DB Sutiwora, BE 192.168.10.xyz, attempt 2, status beAwake, Delay: 2000
I MythCoreContext::ConnectCommandSocket(): Connecting to backend server: 192.168.10.xyz:6543 (try 1 of 1)
E MythSocket(7f47c00abf0:-1): Failed to connect to (127.0.0.1:6543) Connection refused
E Connection to master server timed out.
Either the server is down or the master server settings in mythtv-settings does not contain the proper IP address
A Cannot connect to backend
E Failed to init MythContext, exiting.
Does anybody have an idea on what to do in order to solve my problem? :?:

Edit: I changed the title of the subject in order to mark it as solved.
Last edited by Julius22 on Fri May 29, 2020 3:08 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 unable to connect to the backend

Post by bill6502 »

Make sure the passwords in ~/.mythtv/.mythtv/config.xml and ~mythtv/.mythtv/config.xml are
the same. See: https://www.mythtv.org/wiki/Config.xml#Troubleshooting
Julius22
Newcomer
Posts: 8
Joined: Sat Mar 21, 2020 9:40 am
France

Re: Frontend unable to connect to the backend

Post by Julius22 »

My ~mythtv/.mythtv/config.xml file was empty. I tried to copy the one in /etc/mythtv/config.xml to replace it (and I changed its user and group). But it didn't work. So I erased it. After trying to run mythfrontend, there was still the same problem. But a default config.xml file was created. I then rechecked my different config.xml files, following your advice. I then noticed there was no line with LocalHostName in the file in /etc/mythtv. So, I added this line. And mythfrontend launched well both with my adminnistrator user as well as with mythtv user! :D

So, thanks a lot bill6502 for pointing out at the config.xml files. You hit the good target! 8-) Next time, I'll remember you advice.

I still have some things to configure and I hope I will be able to (finally) enjoy MythTV that I missed so much. :P
nouglywires
Junior
Posts: 20
Joined: Sun Nov 23, 2014 7:17 pm
United States of America

Re: [Solved] Frontend unable to connect to the backend

Post by nouglywires »

I ran into this. I took a look at the database backup and found several entries that contained the old backend address. I updated them all, rebooted, and things worked OK. Here's the SQL I executed:

Code: Select all

update config set data='192.168.3.4' where value in ( 'BackendServerIP', 'MasterServerIP', 'BackendServerAddr' );
Perhaps someone with more knowledge of a more conventional way of changing these settings could weigh in?
Post Reply