Fixing the Database

For discussion of topics specific to MythTV on OSX
Post Reply
coldcase
Junior
Posts: 15
Joined: Sat Mar 28, 2015 12:38 am
United States of America

Fixing the Database

Post by coldcase »

I think I've found one of the sources of some recent MythTV frustration, its the lengthy backend startup on my system.

It seems like when I switched disks and/or had a disk drive failure months ago, many of the recordings Myth was keeping track of were lost (recordings I didn't care about and was expecting the backend to expire). These are still indexed in the database, however.

So every time the backend starts, it seems to spend minutes looking for these missing video files and logging error messages. It doesn't look like any are expiring and being removed as it looks like the expiration process fails.

Is there an easier way to recover besides uninstalling myth and its database and starting with a fresh install (I'm not going to be doing any mysql command line stuff :) ). I don't care about any of the video files, but it would be nice not to have to set everything up again.

I've spent a couple hours reading through the setup guides, FAQs and these forums and really hadn't found anything neat. But then I may be missing something.

BTW, when I use the front end recording manager, only two of these videos show up, and they can't be deleted.
sfatula
Senior
Posts: 163
Joined: Sun Aug 09, 2015 3:51 am
Location: Calera, OK
United States of America

Re: Fixing the Database

Post by sfatula »

There is a find orphans script. see: https://www.mythtv.org/wiki/Find_orphans.py and it can delete too.

Depending on the number of them, if you are using mythweb, then, I have found it pretty reliable at deleting things that won't otherwise go away.
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Fixing the Database

Post by pvr4me »

If you installed Myth with the all-in-one installer, a copy of that script is at:

/opt/dvr/share/mythtv/contrib/find_orphans.py

Craig
Formerly the MacPorts guy.
leejk
Junior
Posts: 65
Joined: Wed Mar 18, 2015 1:51 am

Re: Fixing the Database

Post by leejk »

pvr4me wrote:If you installed Myth with the all-in-one installer, a copy of that script is at:

/opt/dvr/share/mythtv/contrib/find_orphans.py

Craig
For whatever reason, on my install the script is not there... can it be manually installed?

thx
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Fixing the Database

Post by pvr4me »

leejk wrote:
pvr4me wrote:If you installed Myth with the all-in-one installer, a copy of that script is at:

/opt/dvr/share/mythtv/contrib/find_orphans.py

Craig
For whatever reason, on my install the script is not there... can it be manually installed?
Sorry, you're right. That's something that I ought to add.

You can download the script to anywhere and run it. Just change the first line so it uses the right version of Python. Change from:

Code: Select all

#!/usr/bin/env python2
to

Code: Select all

#!/opt/dvr/bin/python2.7
Craig
Formerly the MacPorts guy.
coldcase
Junior
Posts: 15
Joined: Sat Mar 28, 2015 12:38 am
United States of America

Re: Fixing the Database

Post by coldcase »

Well its been awhile, hope you all are well. I ended up using the frontend watch recordings GUI (deleted shows filter) to delete the OBE shows. That helped, but I’m still seeing 20 or so entries every time the frontend’s view recordings button is pressed. Now that I have some spare time I tried orphans.py to finish the cleanup but its not finding anything. I thought I’d check in here to see if there is anything I missed over the past 5 years :)

The backend log entry I’m seeing is: “ 2020-04-08 13:23:54.917852 E [86000/6151] ProcessRequest programinfo.cpp:2358 (GetPlaybackURL) - ProgramInfo(2502_20170929015900.mpg): GetPlaybackURL: '2502_20170929015900.mpg' should be local, but it can not be found.” i

So there is probably something simple I’m missing, I’ve been retired for years and I’m just not as up to speed as I once was. Its not a big deal as the log file growth rate is low. If something is not broken, I have a tendency to not try to fix it, but thought I’d give this another shot.

I’m using a 2015 vintage 0.27 via MacPorts on a OSX 10.9.5 mini server.
Post Reply