[mythtv-users] find_orphans.py not working as expected

Roland Ernst rcrernst at gmail.com
Fri May 15 17:51:38 UTC 2020


On Fri, May 15, 2020 at 3:43 PM Gary Raposo <gary at raposo.ca> wrote:
>
> On 2020-05-14 5:09 p.m., Bill Meek wrote:
> > On 5/14/20 3:19 PM, Gary Raposo wrote:
> > ...
> >
> > If I have a host value that doesn't match my recordings, then I get all
> > recordings showing up as missing.
> >
> > Try printing the hosts value like this:
> >
> >     else:
> >         with DB as c:
> >             c.execute("""SELECT hostname FROM settings
> >                          WHERE value='BackendServerIP'""")
> >             hosts = [r[0] for r in c.fetchall()]
> >             print('hosts=',hosts) # <---------------------------
> >
> > Look at some recordings. Press 'i' twice and see what the value of
> > Recording Host: is set to.
> >
>
> Thanks for the suggestions, Bill. Still no luck.
>
> I checked the settings table and I do not have an entry for
> BackendServerIP. I do have a valid/correct entry for MasterServerIP so
> changed the code to reference MasterServerIP. No change.
>
> If I add the print statement you suggested, it's still showing None:
> hosts= [None]
>
> Checking my recordings (pressing "i" twice) I can see that they are all
> correctly tagged with odysseus as the hostname. MasterServerIP
> references the correct IP address for odysseus and /etc/hosts matches.
>
> Looking at the query, it looks like they are pulling hostname from the
> settings table for the entry associated with the
> BackendServerIP/MasterServerIP. I hadn't really looked at it that
> closely before and assumed they were pulling the hostname based on the
> data field. Wouldn't you know it, hostname is set to NULL for that entry.
>
> I updated the settings table and set hostname = odysseus for
> MasterServerIP + added an entry for BackendServerIP (just in case) and
> now I've moved on to a whole different set of problems!
>
> Before, I was able to see all my recordings but they were listed as
> "Recordings with missing files". Now I get no output and the following
> errors:
>
> $ ./find_orphans.py
> Traceback (most recent call last):
>    File "./find_orphans.py", line 222, in <module>
>      BE = MythBE(db=DB)
>    File "/usr/lib/python3.7/site-packages/MythTV/mythproto.py", line 80,
> in __init__
>      self.hostname = self.db._gethostfromaddr(self.host)
>    File "/usr/lib/python3.7/site-packages/MythTV/database.py", line
> 1348, in _gethostfromaddr
>      'BackendServerAddr', addr)
> MythTV.exceptions.MythDBError: Could not find setting
> 'BackendServerAddr' on host 'None'
>
> Not too sure what's going on. Looking at the settings table, I have
> three entries: BackendServerIP, MasterServerIP, and BackendServerAddr.
> All have data set to 10.10.10.20 and hostname = odysseus.
>
> I'm poking around now in mythproto.py and database.py but (again) my
> lack of Python experience is making this a slow process.
>
> As always, any suggestions are welcome.
>
> Gary


Gary
MythTV v29 changed the behaviour for
'BackendServerAddr', 'BackendServerIP', 'BackendServerIP6'
as described in ticket https://code.mythtv.org/trac/ticket/13024.

In short:
If someone explicitly wants a 'BackendServerIP' or 'BackendServerIP6'
this must be entered in the database during the setup step.
But 'BackendServerAddr' should be always in the database for each backend.

The script 'find_orphans.py' iterates over all backends, therefore
I kindly ask you to change every occurrence of
'BackendServerIP' to 'BackendServerAddr' in this script and try again.


More information about the mythtv-users mailing list