<div dir="ltr"><div>I change the entry in settings, installed the patch and verified that the modified version of the python library was loaded.  I was concerned because sys.path shows</div><div>['', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/home/ross/.local/lib/python3.7/site-packages', '/usr/local/lib/python3.7/dist-packages', '/usr/lib/python3/dist-packages'],</div><div>even when I set PYTHONPATH to /home/ross/.local/lib/python3.7/site-packages (which is where the new version lies).  This looks to me as if some system versions are preferred to my local ones, which seems weird.  But the __file__ attribute of the imported module refers to my local copy.</div><div><br></div><div>$ date; python3 test_canonical_address.py <br>Thu 27 Feb 2020 11:14:58 AM PST<br>host : barley<br>Master-Backend IP: <a href="http://myth.betterworld.us">myth.betterworld.us</a><br>Hash1 : 95de2b5593481b1d<br>Hash2 : 95de2b5593481b1d<br>host-ip1 : <a href="http://myth.betterworld.us">myth.betterworld.us</a><br>BackendServerPort1 : 6543<br>host-ip2 : <a href="http://myth.betterworld.us">myth.betterworld.us</a><br>BackendServerPort2 : 6543<br>host-ip3 : <a href="http://myth.betterworld.us">myth.betterworld.us</a><br>BackendServerPort3 : 6543<br></div><div><br></div><div>Does that look right?</div><div>Ross<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 26, 2020 at 2:07 PM Roland Ernst <<a href="mailto:rcrernst@gmail.com">rcrernst@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Feb 24, 2020 at 10:33 PM Ross Boylan<br>
<<a href="mailto:rossboylan@stanfordalumni.org" target="_blank">rossboylan@stanfordalumni.org</a>> wrote:<br>
><br>
><br>
><br>
> On Mon, Feb 24, 2020 at 12:20 PM Peter Bennett <<a href="mailto:pb.mythtv@gmail.com" target="_blank">pb.mythtv@gmail.com</a>> wrote:<br>
>><br>
>><br>
>><br>
>> On 2/24/20 3:01 PM, Ross Boylan wrote:<br>
>><br>
>> The workaround is to add an entry to the settings table in the form the program wants.<br>
>><br>
>> I'm not sure if the lack of the appropriate entry originally indicates<br>
>> 1. I misconfigured my setup<br>
>> 2. the code has a bug<br>
>> 3. the code is correct for the v31 schema but not for v30.<br>
>> 4. something else<br>
>><br>
>> From settings table:<br>
>> | value             | data                | hostname |<br>
>> +-------------------+---------------------+----------+<br>
>> | AllowConnFromAll  | 0                   | barley   |<br>
>> | BackendServerAddr | <a href="http://myth.betterworld.us" rel="noreferrer" target="_blank">myth.betterworld.us</a> | barley   |<br>
>> | BackendServerAddr | 192.168.1.10        | barley   |<br>
>> | ListenOnAllIps    | 1                   | barley   |<br>
>> | MasterServerIP    | 192.168.1.10        | NULL     |<br>
>> | MasterServerName  | barley              | NULL     |<br>
>> +-------------------+---------------------+----------+<br>
>><br>
>> The entry for BackendServerAddr | 192.168.1.10 is one I added recently; with that I am  able to get past the error I reported.<br>
>> I initially used <a href="http://myth.betterworld.us" rel="noreferrer" target="_blank">myth.betterworld.us</a> as the hostname, but that didn't match my existing entry for BackendServerPort.<br>
>> <a href="http://myth.betterworld.us" rel="noreferrer" target="_blank">myth.betterworld.us</a>, barley, and 192.168.1.10 are all the same machine, the one on which I'm running.<br>
>><br>
>><br>
>><br>
>> BackendServerAddr and MasterServerName replaced MasterServerIP in V30, but if you have not done any update since V29 it may not have been set up. I believe the code will still use MasterServerIp if BackendServerAddr and MasterServerName are not set up..<br>
>><br>
>> You can set it up by running mythtv-setup -> General -> Host Address Backend Setup on the machine in question. The entry for "Primary IP Address/DNS Name" is what is used for BackendServerAddr.<br>
>><br>
>> I don't know what happens if you have two entries for the same hostname. That should not be allowed.<br>
>><br>
><br>
> Thanks for the tip about double entries; since it's apparently not supposed to be, it seemed safest to fix it the same way I created it, using SQL directly.<br>
> I deleted the old entry with the hostname as the data field, and left the new one with the IP address.<br>
><br>
> I recall during setup some uncertainty about whether I should be using a name or an IP at various points.  Having a hard-coded IP seems a bit problematic if the host has a dynamic IP (not currently an issue for me, though if I stick the BE in a VM it might be).<br>
><br>
> Ross<br>
<br>
<br>
Ross,<br>
Thank You for your report about canonical addressing in the Python Bindings.<br>
<br>
I created ticket #13593 upon your finding at<br>
<a href="https://code.mythtv.org/trac/ticket/13593" rel="noreferrer" target="_blank">https://code.mythtv.org/trac/ticket/13593</a><br>
<br>
Could you please apply the proposed patch in this ticket and<br>
restore the database to the canonical IP addressing scheme, like<br>
<br>
| BackendServerAddr | <a href="http://myth.betterworld.us" rel="noreferrer" target="_blank">myth.betterworld.us</a> | barley |<br>
<br>
 and run the attached test file?<br>
<br>
The attached test file does not alter yourt MythTv system in any way.<br>
<br>
The file should report instead of an IP address '10.0.0.XXX'<br>
the canonical address of your MythTV system<br>
and report something like<br>
<br>
$ python3 test_canonical_address.py<br>
host : myserver<br>
Master-Backend IP: 10.0.0.XXX<br>
Hash1 : f78f3ddee497d3e8<br>
Hash2 : f78f3ddee497d3e8<br>
host-ip1 : 10.0.0.XXX<br>
BackendServerPort1 : 6543<br>
host-ip2 : 10.0.0.XXX<br>
BackendServerPort2 : 6543<br>
host-ip3 : 10.0.0.XXX<br>
BackendServerPort3 : 6543<br>
<br>
Roland<br>
_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org" target="_blank">mythtv-users@mythtv.org</a><br>
<a href="http://lists.mythtv.org/mailman/listinfo/mythtv-users" rel="noreferrer" target="_blank">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a><br>
<a href="http://wiki.mythtv.org/Mailing_List_etiquette" rel="noreferrer" target="_blank">http://wiki.mythtv.org/Mailing_List_etiquette</a><br>
MythTV Forums: <a href="https://forum.mythtv.org" rel="noreferrer" target="_blank">https://forum.mythtv.org</a><br>
</blockquote></div>