[mythtv-users] MythArchive only sees 10 out of 100s of recordings

stuart stuart at xnet.com
Sun Nov 15 18:09:24 UTC 2009

Michael T. Dean wrote:
> On 11/14/2009 06:47 PM, stuart wrote:
>> Playing w/SQL data queries has uncovered the real culprit. My MBE data 
>> base of recordings is missing over 100 recordings.  I can find over 
>> 150 recordings all of non-zero length in the appropriate directory.
>>> MBE:/space/recordings> ls *.mpg | wc
>>>     153     153    3672 
>> However a SQL query only finds 11!:
>>> mysql> SELECT title, subtitle, starttime, endtime, chanid, basename 
>>> FROM recorded WHERE hostname='MBE';
>>> +--------------------------------+------------------<stuff deleted>
>>> | title                          | subtitle         <stuff deleted>
>>> +--------------------------------+------------------<stuff deleted>
>> <stuff deleted>
>>> | The Office                     | Murder           <stuff deleted>
>>> +--------------------------------+------------------<stuff deleted>
>>> 11 rows in set (0.00 sec) 
>> At this point I'd like to dump the data base and start over.  But it 
>> appears to be doing a better job of tracking recordings on the SBE 
>> machine.  There the data base has 213 lines.  However, I can only find 
>> 162 files.  Ha, the reverse problem!  I can not find 51 files on the SBE.
>> Clearly I have issues.
>> Given that the MFEs lists the missing files by name and date (I 
>> tracked one such file that exists on the MBE but is not in the data 
>> base) there must be a way to find the missing data that goes beyond 
>> the broken SQL data base. To be clear, the MFEs can not play such 
>> shows as they are reported missing.  I'm hoping I can repair the data 
>> base and restore the data for over 100 recordings that, apparently, 
>> both exist and show up in the MFEs list of recordings but not the SQL 
>> data base.
>> Any ideas on how to do that? 
> Did you move recording files that were recorded on the master backend to 
> the remote backend?  If so, the database would need to be updated iff 
> the filesystem to which you moved the recording files is not accessible 
> from the master backend.
> So, if that's the case, you can either mount the remote filesystem using 
> NFS or CIFS on the master backend or fix the hostname for the 
> appropriate recordings in the database.
> You should really do the query above to show a) without any WHERE 
> hostname clause, b) with WHERE hostname = 'MBE', c) with WHERE hostname 
> = 'SBE', /and/ d) with WHERE hostname NOT IN ('MBE', 'SBE');
> Don't give up on your DB just yet.
> Mike

Wow, unscrambling this is harder then a game of Sudoku!  The short 
answer is that I am still working on it - but may soon give up and wipe 
out the orphaned recordings as well as the orphaned data base entries.


To answer your question, yes - I did move some recordings between the 
MBE and SBE mythtv boxes - last time I swapped out the HDD for more 
space on the MBE.

I don't believe I have ever NFS'ed the MBE recordings to the SBE or the 
SBE recordings to the MBE.  (I do, however, NFS export the MBE video 
files to the SBE.)  Those mythtv recordings I moved were probably no 
longer playable back then - I just didn't realize it at the time - as 
they still showed up in the MFE listings - I assume, if I had tried 
playing them, I would have seen a pop-up saying the files could not be 

Going forward, I started looking for files on the MBE (recall there are 
over 100 but only 10 show up in the data base) which are not in the data 
base.  I figured I could then query the data base using the basename and 
discover that the data base thought these files to be on the SBE.  After 
spot checking several files. I could then, like you said, move them the 
the correct BE or change their data base entry.  No such luck.

Then I remembered I had previously used myth data base scripts to clean 
up orphaned files and data base entries.  In other words, I am probably 
so far down an obfuscated rabbit hole w/no "undo" key that there is 
little chance that a one or two step process can be whipped up to solve 
this mythtv data base problem.

I'll keep looking for a pattern.  Maybe I'll be able to recover some of 
the files in some sort of batch process.  But at this point I am 
thinking I'll just save a few important recordings as videos using 
readable file names - removing them from the myth data base paradigm 

-thanks for your help

More information about the mythtv-users mailing list