can't connect backend and frontend

For discussion of topics specific to MythTV on linux
Post Reply
Kasjer
Newcomer
Posts: 7
Joined: Fri Feb 05, 2016 2:43 pm
Poland

can't connect backend and frontend

Post by Kasjer »

Hi everyone, firsty i'm sorry for my english.

I have a problem with my mythfrontend, i've got meesage "Could not connect to master backend \n Is the IP address set for it in mythtv-setup correct?" when i have Hostname = 127.0.0.1 . But when i changed on external address (e.g. 192.168.0.12) then i'v got "backend is online" but option "Watch tv" gave me "There are no configured tuner" (when it's configured) or "All tuners are currently busy", and when i run again frontend then displaing to select county and language in loop until i type address 127.0.0.1.

Please help, I have one box with Debian jessie 8.3, 3.16.0.4-amd64 x86_64 AND my mythtv version is 0.27.5-dmo2
and working tuner BTS6205 with installed drivers, all of it working fine with software "kaffeine"
I need to have frontend and backend on one machine

In attachment is: mysql settings, mythtv-setup/myth-frontend entries from the console and .mythtv/config.xml.

At the end i will add that mybackend have list of channels in database cause scan working fine:)
Attachments
config.txt
(621 Bytes) Downloaded 210 times
mythtv.txt
(26.38 KiB) Downloaded 188 times
mysql.txt
(19.94 KiB) Downloaded 210 times
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: can't connect backend and frontend

Post by bill6502 »

Hi,

1st, 2 observations:

A config.xml entry of: <UserName>root</UserName> is unusual. Typically,
the user is mythtv. And the backend is normally started by root with the
--user mythtv switch. However, changing this may be difficult because any
files created (e.g. recordings and Storage Directories) are likely owned by
root now. If you're just getting started, now would be a good time to change.

It appears that you're starting the frontend as user root too. Normally, you'd
just use your own user and the config.xml file in ~/.mythtv/config.xml would
be used.

As for the issue:

In your settings table dump, there are entries for hostnames: debain and User.
So it looks like you changed hostnames at some time. Note that debain has the
127... IP and User has the 192... It could also be that you changed <LocalHostName>
in one or more config.xml files (which usually shouldn't be done.)

Could your backend be using a different user and therefore different config.xml file.

Since MythTV uses the hostname as a profile name in settings and other tables,
changing it could be the cause of the missing tuners.

Also, check /etc/mysql/conf.d/mythtv.cnf file to see what IP it's allowing (never
change it in my.cnf) if you choose to keep the 192... address.
Kasjer
Newcomer
Posts: 7
Joined: Fri Feb 05, 2016 2:43 pm
Poland

Re: can't connect backend and frontend

Post by Kasjer »

Thanks for your reply
Is still the same problem
I used according to your instructions
bill6502 wrote: A config.xml entry of: <UserName>root</UserName> is unusual. Typically,
the user is mythtv.
Now my user is mythtv (for the database)
bill6502 wrote: you'd just use your own user and the config.xml file in ~/.mythtv/config.xml would
be used.
i'm login as my user now (not root)
bill6502 wrote: In your settings table dump, there are entries for hostnames: debain and User.
So it looks like you changed hostnames at some time. Note that debain has the
127... IP and User has the 192... It could also be that you changed <LocalHostName>
in one or more config.xml files (which usually shouldn't be done.)
Now is only 192... IP I'm used also 127... for testing
bill6502 wrote: Since MythTV uses the hostname as a profile name in settings and other tables,
changing it could be the cause of the missing tuners.
What should i do? i reinstalled system, and nothing helped. My tuners is still busy.
bill6502 wrote: Also, check /etc/mysql/conf.d/mythtv.cnf file to see what IP it's allowing (never
change it in my.cnf) if you choose to keep the 192... address.
i don't know why but i have no any mythtv.cnf and in my.cnf everything is fine.

new logs in attachment.
Please tel me what i'm doing wrong.

If you need some additional information to solve problem please tell me.
Attachments
mythtv.txt
(26.28 KiB) Downloaded 176 times
mysql.txt
(33.01 KiB) Downloaded 188 times
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: can't connect backend and frontend

Post by bill6502 »

The frontend is trying to get to:

Code: Select all

Failed to connect to (127.0.0.1:6545)
But this says the database will tell the frontend to try to connect to:

Code: Select all

| MasterServerIP          | 192.168.0.12            | NULL      |
| BackendServerIP         | 192.168.0.12            | debianx   |
The output of this will tell you if there 2 different config.xml files in use here:

Code: Select all

diff ~mythtv/.mythtv/config.xml ~/.mythtv/config.xml
Please try to start the frontend again and attach a copy of the mythbackend.log
at that time.
Kasjer
Newcomer
Posts: 7
Joined: Fri Feb 05, 2016 2:43 pm
Poland

Re: can't connect backend and frontend

Post by Kasjer »

bill6502 wrote: The frontend is trying to get to:

Code: Select all

Failed to connect to (127.0.0.1:6545)
I know but how change it? in all files config.xml i have 192... i can check it by command

Code: Select all

sudo find / -name config.xml | while read i ; do echo $i; sudo cat $i; done 
bill6502 wrote: Please try to start the frontend again and attach a copy of the mythbackend.log
at that time.
Is very strange that myth-backend save all chanels in database and in the logs is error (all content mythbackend.log in attachment):

Code: Select all

QMYSQL: Unable to connect
Database error was:
Access denied for 'mythtv'@'localhost'
Attachments
mythbackend.log
(72.97 KiB) Downloaded 168 times
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: can't connect backend and frontend

Post by bill6502 »

Hi,

OK, the very last run of the backend looks good and it's using the confing.xml file
here:

Code: Select all

Using configuration directory = /var/lib/mythtv/.mythtv
Your userx should use the same file or an exact copy of it (or even create a
symbolic link to it.)

Fix the error here, it's a permission problem, or locate the directory elsewhere,
whatever you prefer:

Code: Select all

Group 'Default' wants to use directory '/home/userx/rec/', but this directory is not writeable.
That's configurable in the Storage Group setup.

I don't know about all of the other runs of the backend, but at least in one case,
you started it twice because the:

Code: Select all

Error 8: The bound address is already in use
message is in the log. I'm not familiar with Debian jessie and don't know how it
starts the backend. It may be systemd or an /etc/init.d script or an Upstart
.conf file in /etc/init.
Kasjer
Newcomer
Posts: 7
Joined: Fri Feb 05, 2016 2:43 pm
Poland

Re: can't connect backend and frontend

Post by Kasjer »

Hi, permission problem is fixed, so:
bill6502 wrote: Your userx should use the same file or an exact copy of it (or even create a symbolic link to it.)
You say "should use", it is default behaviour?
bill6502 wrote: I don't know about all of the other runs of the backend, but at least in one case,
you started it twice because the:

Code: Select all

Error 8: The bound address is already in use
Even if i stopped backend, started it again and this error is not appears, it's still the same problem. Backend looks good but frontend calling to me: "could connect to master backend"

I'm starting lose my forces for that, over week configuration of mythtv is impossible:/ i'll go creazy..
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: can't connect backend and frontend

Post by bill6502 »

Sorry you're having so much trouble.

What is the command you use to start the frontend? If it's a
script, attach it.

Please add the output of this command:

Code: Select all

diff /var/lib/mythtv/.mythtv/config.xml /home/userx/.mythtv/config.xml
I suggest that you don't change the hostname, username or
any default port numbers. Each time that's done, a new set
of backend and frontend logs is necessary. Also the contents
of both config.xml files.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: can't connect backend and frontend

Post by bill6502 »

Note that "MythSocket(7fb87c0132f0:-1): Failed to connect to (127.0.0.1:6545) Connection refused"
is trying to connect to the LCDServerPort. Make sure all of your ports in mythtv-setup are using
the default value. There's no need to change them. The backend server port is 6543. When you
were using the debain hostname, it was set to 6545. It looks correct in the latest settings dump
for hostname debainx.
Kasjer
Newcomer
Posts: 7
Joined: Fri Feb 05, 2016 2:43 pm
Poland

Re: can't connect backend and frontend

Post by Kasjer »

YES! Finaly!:) broblem is solved!

I cleaned database and reinstalled it again. There was unnecessary entries with hostname "debian" but my hostname is "debianX"
and to be enble correctly starting i must run backen via command "mythbacken &" but "mythtv-setup" still causses an error. I guess that it uses other configuration files. I don't understand why do mythtv need so many files config.xml and a lot of settings in the database.

Thanks a lot for your help and explanations, now i understand much more about this settings:)
bill6502 wrote:

Code: Select all

diff /var/lib/mythtv/.mythtv/config.xml /home/userx/.mythtv/config.xml

Code: Select all

7c7
<     <Password>mythtv</Password><!--pjlyolRuJMl92/BC</Password-->
---
>     <Password>mythtv</Password>
16a17,21
>   <UPnP>
>     <UDN>
>       <MediaRenderer>60b4bd60-ed81-44d6-8b2e-2090bfa9573a</MediaRenderer>
>     </UDN>
>   </UPnP>
18d22
And my last little question about line with <Password>. Where this default password is set? I geues this password is set for user mythtv for database. I don't checked it because i changed this mysterious password (pjlyolRuJMl92/BC) for database via root user :)
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: can't connect backend and frontend

Post by bill6502 »

The cryptic password was probably generated by the code that
installed MythTV on your distribution. It needs to be stored in
all of the config.xml files as well as in the DB setup. At this
point, whichever one is working is the one I'd use everywhere.

There is no default password. 'mythtv' is very common though.
skooobie
Newcomer
Posts: 3
Joined: Fri Apr 01, 2016 5:53 am
New Zealand

Re: can't connect backend and frontend

Post by skooobie »

There is a good list of troubleshoting activities and help guide info here: http://shoelace.altervista.org
Post Reply