Recording Rule does not exist - any help?

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
plainfaceboy
Junior
Posts: 15
Joined: Tue May 05, 2015 10:06 am
Great Britain

Recording Rule does not exist - any help?

Post by plainfaceboy » Thu Jul 09, 2020 1:58 pm

Hi - I'm running Ubuntu 18.04 and Mythtv 31 (fresh install), previous versions working fine and 31 no different. I've got 100's of 'recordings' and 'videos' going back around 10 years.
Just recently I have lost the recording schedule info for most of my recordings - everything after a date several years ago (~2013). When I hit E, or use M and edit recording schedule I get a 'recording rule does not exist' message. I can edit the metadata, but not the recording rule. This also mean that I cannot edit the covers, or fanart. In the recordings screen, recordings still show the recording date, and artwork is still present.
All the 'videos' are of course fine and I can edit artwork as normal.

In case it means anything, for all the recordings with the missing recording rule, in the 'show recording details' option under menu there is a 'recording rule' field (which is a different number for each eg 21, 39, etc). The older recordings that still have the rule (and where I can edit the recording schedule) do not show this field.

I've tried restoring to the oldest database backup I have (about a month ago) when I'm sure everything was working, but I still have the issue.
I've run optimise using mysqlcheck and optimize_mythdb.

Can anyone suggest anything that might fix this?
Thanks.

wesnewell
Senior
Posts: 667
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Recording Rule does not exist - any help?

Post by wesnewell » Thu Jul 09, 2020 3:19 pm

Recent recordings of movies set to record as one time here also don't have recording rules. I suspect this is by design to keep the DB from storing rules that are no longer needed since they have already accomplished what they were designed to do. Make one recording of the program. In fact, just set a record only one showing recording of a show in progress, and it was set to L for later, and no recording rule was created.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.

User avatar
bill6502
Developer
Posts: 1713
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Recording Rule does not exist - any help?

Post by bill6502 » Thu Jul 09, 2020 5:02 pm

Short answer, the rules are most likely gone. And the correct answer, which you
already tried, restore from backup.

When you press i while positioned on a recording, the information that comes
up includes the "Recording Rule : " entry. The number is from the recorded
table in mythconverg and it's the recordid stored there. The text that follows
the number (actutally number comma) is from the matching recordid column in the
record table and the title column there. No match on the recordid, no
rule text.

I use the Steppes theme. The display may be different, but the data is stored the same.

If you have old backend logs you can try this:

Code: Select all

zgrep "Reschedule requested for MATCH .* 0 0 - DeleteRule" mythbackend*
That might be a clue about how/when the rules got removed. It's normal to have some
entries there.

I believe this will develop a list of recordings without rules, but some rules are expected to be missing (Wes's response):

Code: Select all

mysql --batch --user=mythtv --password --execute="SELECT CONCAT('\"',title,'\" ') FROM recorded WHERE recordid NOT IN (SELECT recordid FROM record) AND recordid != 0 ORDER BY title" mythconverg | grep -v CONCAT | sort -u | tee /tmp/lost.rule.list.that.must.be.curated
If that's true (and you must verify all output) there may be some unofficial tools
to add the rules. There are some fields that can't be recreated because if the original rule is
gone, the information is lost forever. For example, the Schedule Type like Record All/RecordOne,
start/end offsets, ... . Some can be recreated using a Recording Rule Template.
Last edited by bill6502 on Tue Jul 14, 2020 3:44 am, edited 1 time in total.
Reason: Re-work query to eliminate duplicate titles

plainfaceboy
Junior
Posts: 15
Joined: Tue May 05, 2015 10:06 am
Great Britain

Re: Recording Rule does not exist - any help?

Post by plainfaceboy » Sun Jul 12, 2020 5:37 pm

All your info makes sense, though I'm still a little baffled.
You're right re. the info on the 'i' info screen with the rules having a number followed by comma etc.
So all recordings with a missing rule have just this - number,
Those older recordings that still have the rule do not show this field at all.
I have just made a recording now, and that has so far kept the rule - and 'i' does show the recording rule field, *and* some text - so:
number, "programme name"

The backend logs have no mention of DeleteRule. There are a few references to SaveRule - for the most recent recordings - which makes sense, but these recording also have no recording rule, despite no reference to DeleteRule in the log.
No older logs.
I confirmed from your script I have a list of 375 recordings with no recording rule.

I managed to find an older back up from December, and that was the same as well - and I would have sworn that the rules weren't actually gone then, but maybe I'm wrong! What's confusing is that the rules are gone for even those recordings that were the most recent recordings at the time of the back up.
So a couple of questions - can I change artwork another way for recordings (without moving them to videos)?
(and is there a way to move recordings to videos within mythtv or do I just have to copy/rename files manually?)

You mentioned some unofficial tools that might be able to recreate rules - any pointers on where to look??

Thanks

User avatar
bill6502
Developer
Posts: 1713
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Recording Rule does not exist - any help?

Post by bill6502 » Tue Jul 14, 2020 3:42 am

Check your Private Messages.

I'm not sure I understand that all 375 recordings would need a rule. That's for you
to decide. The MySQL command above will be updated to give better results too.

plainfaceboy
Junior
Posts: 15
Joined: Tue May 05, 2015 10:06 am
Great Britain

Re: Recording Rule does not exist - any help?

Post by plainfaceboy » Sat Jul 18, 2020 9:55 am

Not had chance to attempt a fix yet, but I did spot that the recording rule for the recording I made a couple of days ago had disappeared the next day when I restarted. That seems very quick and definitely didn't used to happen that quickly.
Is this something new, or could I inadvertently have changed something myself?

My main problem with removing the rules is that I can't change the artwork - unless someone has a workaround for this.

User avatar
bill6502
Developer
Posts: 1713
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Recording Rule does not exist - any help?

Post by bill6502 » Sat Jul 18, 2020 7:39 pm

Need to know the type of rules being added (e.g. Record One, Single Record...) and if the recordings are
deleted, or go on the Autoexpire list.

plainfaceboy
Junior
Posts: 15
Joined: Tue May 05, 2015 10:06 am
Great Britain

Re: Recording Rule does not exist - any help?

Post by plainfaceboy » Tue Jul 21, 2020 2:20 pm

They're generally record this showing type rules (so record once), and pretty sure they go onto the auto-expire list by default.
I've taken some off auto-expire (though always much later than the recording - so the old programmes with a rule remaining are a mixture of on and off the auto expire list.
Just wondering why this has only started happening recently....

User avatar
bill6502
Developer
Posts: 1713
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Recording Rule does not exist - any help?

Post by bill6502 » Tue Jul 21, 2020 2:27 pm

Record All and Custom rules (for example) remain in the record table. Single
rule are automatically deleted. I recall that happens when the recording
is deleted.

Post Reply