[mythtv-users] upgraded 0.28 on mythbuntu not finding proper backend

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Jul 19 17:16:50 UTC 2016


On Tue, 19 Jul 2016 11:47:30 -0400, you wrote:

>On Wed, 2016-07-20 at 02:11 +1200, Stephen Worthington wrote:
>> 
>> Because there are separate settings for the address of the database
>> server and the address of the backend server.
>
>Yes, understood. The problem I am having it not of a working and non-
>working FE not finding the database.  They are both finding the
>database just fine.  It's after that, where they are trying to connect
>to different Mythtv back-ends.
>
>> The connection to the
>> database is made using the address in the config.xml file,
>
>Right.  That much is working for both FEs per my previous message.
> They are both connecting to the database on the Master BE.
>
>> In mythtv-setup, open the General page, and there you will see the
>> settings for the Local Backend
>
>10.75.22.2
>fd31:aeb1:48df:0:214:d1ff:fe13:52fb
>
>>  and Master Backend addresses.
>
>pvr.example.com
>
>which resolves to both of those addresses above.
>
>> As you
>> have only one (master) backend, both IP addresses should be set to
>> the
>> external IP address of the backend box.  Those two settings are
>> stored
>> in the database "settings" table as BackendServerIP and
>> MasterServerIP
>> respectively.  In the settings table, the MasterServerIP value has a
>> NULL hostname as it is a setting common to all hosts.  However, the
>> BackendServerIP value has the hostname of the host to which it
>> applies.  When there are multiple backends, there will be multiple
>> BackendServerIP entries, one for each backend, each with different
>> hostname values.
>
>So if any of this were wrong, why would one FE be finding the right
>back end address and working and another thinking the backend was
>"lcoalhost" and not working?
>
>> So, check all the config.xml files, and make sure they all have the
>> same settings,
>
>They do.  The log output shows both the working and non-working FEs
>successfully connecting to the same database.
>
>> Then check what the database has for the
>> BackendServerIP and MasterServerIP settings.  You can do that by
>> logging in to the mythconverg database with mysql and doing this
>> query:
>> 
>>   select * from settings where value like '%ServerIP';
>
>I get:
>
>value	data	hostname
>BackendServerIP	10.75.22.2	pvr
>MasterServerIP	pvr.interlinx.bc.ca	NULL

This could be the problem.  Using a DNS name instead of an IP address
here can be dangerous.  From what you said, I am guessing that you
have your own DNS server, and that name resolves to both an IPv4
address and also to a link-local IPv6 address.  But which one will any
particular PC get?  If the PC is IPv6 capable, it will normally prefer
to use IPv6, and so will get the link-local IPv6 address and try to
connect to it.  If it is not IPv6 capable, it will get the IPv4
address and connect with that.  But the use of IPv6 or IPv4 may vary
from PC to PC, so that the frontend PC may be trying an IPv4 address
when the backend is listening on an IPv6, or vice versus.

And at startup, is the DNS server available when the this address
needs to be resolved so that the backend will listen on it?  If the
networking is still coming up, the DNS server may not be accessible
unless it is on the same PC and is already up and available (probably
via 127.0.0.1 or ::1).  So what IP address mythbackend is actually
listening on may be dependent on timing, and may change on reboot - it
may be listening on IPv6 or on IPv4, or it may fall back to listening
on localhost because the DNS was not able to be resolved.

Also, if the frontend PC is on a different subnet from the backend PC,
using a link-local IPv6 address on the backend will not work.  It is
quite unusual to have a global IPv4 address and a local IPv6 address
on the same DNS name, as they have quite different uses.  It would be
much better if the IPv6 address was a global unicast address, not a
link-local one.

I would try setting MasterServerIP to an IP address instead of a DNS
name and see if that resolves the problem.

In my personal DNS setup, I have different domains for my IPv6 and
IPv4 addresses because of problems like this.  So I have
mypvr.jsw.gen.nz as the IPv4 address and mypvr.6.jsw.gen.nz for the
IPv6 address.  But I would still not like to use a DNS name for
something like this.

>exactly as mythtv-setup->General shows.
>
>> Also, you need to check that the database is accessible from outside
>> the backend box.
>
>It is.  The one working FE would not be working if it weren't I don't
>think.
>
>Ultimately this all comes down to the original question of why one FE
>finds the right backend to use (fd31:aeb1:48df:0:214:d1ff:fe13:52fb)
>while the other thinks it wants to connect to "localhost" when both are
>successfully looking at the exact same database.
>
>Cheers,
>b.


More information about the mythtv-users mailing list