[mythtv-users] Problem deleting recordings with find_orphans.py NameError: global name 'NoneType' is not defined
Raymond Wagner
raymond at wagnerrp.com
Thu Aug 25 16:36:36 UTC 2011
On 8/25/2011 12:18, Eric Sharkey wrote:
> On Thu, Aug 25, 2011 at 11:22 AM, Raymond Wagner<raymond at wagnerrp.com> wrote:
>> This is an unavoidable but otherwise benign race condition. If the
>> backend deletes the entry at some point between the script pulling the
>> entry from the database, and telling the backend to delete it, you will
>> get this error.
> That doesn't seem plausible. It also doesn't seem that benign either.
The script pulls Recorded entries, which match up to a line in the
database. They must pull a ProgramInfo object from the backend in order
to delete them. That error means the backend is unaware of the line,
meaning some time between the script pulling it, and you telling it to
delete them, it already has deleted them.
> I run the script, it reports I have 229 recordings with missing files,
> I select option 1, it repeats the list of 229 recordings, I confirm
> that yes I want to delete it, and then ~10 seconds later I get the
> traceback error and the script exits.
Exactly. The script tells the backend to delete all of them, and then
immediately pulls a new list from the database. The backend has only
had the chance to delete a couple of them by the time you poll the database.
> So now I run it again and I'm down to 227 recordings with missing
> files. Should I just keep doing this 114 more times?
Wait a few seconds and refresh the list. The count will have gone
down. Refresh again and the list has reduced further. You only need to
run it once. Be patient and wait for the backend to churn through
everything.
More information about the mythtv-users
mailing list