[mythtv-users] find_orphans.py not working on current?

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Dec 10 10:02:07 UTC 2018

On Sun, 9 Dec 2018 13:10:23 +0000, you wrote:

>On Sat, 21 Jul 2018 at 16:34, Bill Meek <keemllib at gmail.com> wrote:
>> On 07/21/2018 08:59 AM, George Poulson wrote:
>> > On 21 July 2018 at 14:56, Bill Meek <keemllib at gmail.com <mailto:
>> keemllib at gmail.com>> wrote:
>> >
>> >     Does line 100 in find_orphans.py look like this?
>> >
>> >          if not (f.endswith('.mpg') or f.endswith('.nuv') or
>> f.endswith('.ts')):
>> >
>> >
>> >
>> > Mine does, yes :-)
>> > George
>> "Works for me" using the version on the Wiki.
>> I assume 'tvbox' is the correct hostname.
>> diff ~mythtv/.mythtv/config.xml ~/.mythtv/config.xml should match. Which
>> should
>> be the case assuming "everything works fine" means that mythfrontend
>> works when run as your own user. *Important* as Storage Groups are searched
>> here to develop the list of filenames.
>> I'd start planting print statements in find_orphans.py. Looks like the
>> list of files is getting created, but for some reason names from metadata
>> aren't being removed (unfiltered.remove().)
>> When I add the print statement below line 98:
>>              for f in list(unfiltered):
>>                  if name in f:
>>                      unfiltered.remove(f)
>>                      print 'removed from unfiltered list: {}'.format(f)
>> I get lots of output, as it excludes matching files in the metadata.
>> You could do this too to see if the metadata list is created
>> note that kwargs includes the hostname. After line 84:
>>      recs = list(DB.searchRecorded(**kwargs))
>>      for blah in recs:
>>          print 'metadata: {}'.format(blah.basename)
>It's a long time now since I came across this issue, but having just found
>(and fixed) the problem I thought I should post an update.
>Adding the print statements as suggested produced no output at all, so I
>guessed that somehow the backend database just wasn't being accessed.
>Trawling through the database 'settings' table I found that the required
>entry of 'BackendServerIP' did not exist, but instead was an entry
>'BackendServerAddr' with the correct IP address as data.
>I have updated my 'find_orphans.py' script (lines 60 and 68 or
>thereabouts), changing 'BackendServerIP' to 'BackendServerAddr' and the
>script now works as expected.
>I have absolutely no idea how this error has occured.

Interesting.  All my operational databases all have both the
'BackendServerIP' and 'BackendServerAddr' settings.  The database I
have on a virtual machine where I installed Xubuntu 18.04 from new
does not have the 'BackendServerIP' value.

Maybe the name has been changed at some point, but the database
upgrading process has not deleted the old one for some reason.  Or
maybe both addresses are there normally and have different uses.  So
anyone working with a database that has been progressively upgraded
will still have the old 'BackendServerIP' value and find_orphans.py
will work.  However, one of my operational databases has an IPv6
address for 'BackendServerAddr', so just changing the name in
find_orphans.py may not be enough - it would need to be tested to see
if it will work with IPv6 addresses too.

More information about the mythtv-users mailing list