MythTV / mythtv

The official MythTV repository
https://www.mythtv.org
GNU General Public License v2.0
699 stars 343 forks source link

Mythtv backend error when clicking on New Episodes only #895

Closed jfabernathy closed 2 months ago

jfabernathy commented 2 months ago

First I noticed that I have some old reruns being recorded overnight of a program that was in my list to record all episodes. I tried using leanfront to check the box for New episodes only. But when I looked at upcoming episodes, it was still scheduled to record.

Next I use the Web App to check the box and got a Pink error box saying only Backend Error. I ssh'ed into the backend and saw this error in the journalctl log:

Apr 12 07:18:26 den-pc mythbackend[1519]: mythbackend[1519]: N HTTP11
v2myth.cpp:1006 (DelayShutdown) Shutdown delayed 5 minutes for
external application.
Apr 12 07:19:04 den-pc mythbackend[1519]: mythbackend[1519]: N Expire
autoexpire.cpp:247 (CalcParams) AutoExpire: CalcParams(): Max required
Free Space: 3.0 GB w/freq: 14 min
Apr 12 07:19:04 den-pc mythbackend[1519]: mythbackend[1519]: N Expire
autoexpire.cpp:638 (SendDeleteMessages) Expiring 4000 MB for 20201 at
2024-04-12T02:00:00Z => "Law & Order":"Family Ties"
Apr 12 07:19:04 den-pc mythbackend[1519]: mythbackend[1519]: N Expire
autoexpire.cpp:638 (SendDeleteMessages) Expiring 873 MB for 20701 at
2024-04-12T06:00:00Z => "Young Sheldon":"A Tummy Ache and a Whale o>
Apr 12 07:19:04 den-pc mythbackend[1519]: mythbackend[1519]: N Expire
autoexpire.cpp:638 (SendDeleteMessages) Expiring 881 MB for 20701 at
2024-04-12T06:30:00Z => "Young Sheldon":"Blonde Ambition and the Co>
Apr 12 07:19:10 den-pc mythbackend[1519]: mythbackend[1519]: N
DeleteThread mainserver.cpp:2539 (DeleteRecordedFiles)
DeleteRecordedFiles - recording id 197 filename
/mythtv/recordings/20201_20240412020000.>
Apr 12 07:19:10 den-pc mythbackend[1519]: mythbackend[1519]: N
DeleteThread mainserver.cpp:2612 (DoDeleteInDB) DoDeleteINDB -
recording id 197 (chanid 20201 at 2024-04-12T02:00:00Z)
Apr 12 07:19:16 den-pc mythbackend[1519]: mythbackend[1519]: N
DeleteThread mainserver.cpp:2539 (DeleteRecordedFiles)
DeleteRecordedFiles - recording id 204 filename
/mythtv/recordings/20701_20240412060000.>
Apr 12 07:19:16 den-pc mythbackend[1519]: mythbackend[1519]: N
DeleteThread mainserver.cpp:2612 (DoDeleteInDB) DoDeleteINDB -
recording id 204 (chanid 20701 at 2024-04-12T06:00:00Z)
Apr 12 07:19:22 den-pc mythbackend[1519]: mythbackend[1519]: N
DeleteThread mainserver.cpp:2539 (DeleteRecordedFiles)
DeleteRecordedFiles - recording id 205 filename
/mythtv/recordings/20701_20240412063000.>
Apr 12 07:19:22 den-pc mythbackend[1519]: mythbackend[1519]: N
DeleteThread mainserver.cpp:2612 (DoDeleteInDB) DoDeleteINDB -
recording id 205 (chanid 20701 at 2024-04-12T06:30:00Z)
Apr 12 07:20:52 den-pc mythbackend[1519]: mythbackend[1519]: E HTTP9
mythdb.cpp:228 (DBError) DB Error (UPDATE/INSERT record):
                                          Query was:
                                          UPDATE record SET type = ?,
search = ?, recpriority = ?, prefinput = ?, startoffset = ?, endoffset
= ?, dupmethod = ?, dupin = ?, filter = ?, autoextend = ?, inacti>
                                          Bindings were:
                                          :AUTOCOMMFLAG=false,
:AUTOEXPIRE=false, :AUTOEXTEND=0, :AUTOMETADATA=true,
                                          :AUTOTRANSCODE=false,
:AUTOUSERJOB1=false, :AUTOUSERJOB2=false,
                                          :AUTOUSERJOB3=false,
:AUTOUSERJOB4=false, :AVGDELAY=100, :CATEGORY="Drama",
                                          :CHANID=20701,
                                          :DESCRIPTION="Shaun is
forced to confront Lea about their relationship and determine what he
really means to her; the team debates about plastic surgery; Lim hopes
>
                                          :DUPIN=31, :DUPMETHOD=6,
:ENDDATE=2024-04-14, :ENDOFFSET=0,
                                          :ENDTIME=09:00:00.000,
:EPISODE=8, :FILTER=0, :FINDDAY=1, :FINDID=739343,
                                          :FINDTIME=01:00:00.000,
:INACTIVE=false, :INETREF="", :INPUT=0, :LASTDELETE="",
                                          :LASTREC="", :MAXEPISODES=0,
:MAXNEWEST=false, :NEXTREC="2024-04-14 08:00:00",
                                          :PARENTID=0,
:PLAYGROUP="Default", :PROGRAMID="EP026966280086",
                                          :RECGROUP="Default",
:RECGROUPID=1, :RECORDID=72, :RECPRIORITY=0,
                                          :RECPROFILE="Default",
:SEARCHTYPE=0, :SEASON=5, :SERIESID="EP02696628",
                                          :STARTDATE=2024-04-14,
:STARTOFFSET=0, :STARTTIME=08:00:00.000, :STATION="KAZT",
                                          :STORAGEGROUP="Default",
:SUBTITLE="Rebellion", :TITLE="The Good Doctor",
                                          :TRANSCODER=0, :TYPE=4
                                          Driver error was [2/1062]:
                                          QMYSQL3: Unable to execute statement
                                          Database error was:
                                          Duplicate entry
'20701-08:00:00-2024-04-14-The Good Doctor-4' for key 'chanid'

Additional information

bennettpeter commented 2 months ago

It looks like you may have more than one recording rule for "The Good Doctor". Please go to Recording Rules in web app and check that. Let me know what you see for "The Good Doctor". If you have a "Record Once" as well as a "Record All" and you tried to change the "Record Once" to a "Record All" this error may happen. I don't know how you could have a "Record Once" as well as a "Record All"

jfabernathy commented 2 months ago

It is likely that there are multiples of a show. As we were moving across the USA in our RV from NC to AZ we would setup recordings in different cities. For some reason my "record all" didn't automatically work in the new city on a new ABC station. So I'd setup a new rule. I'll go clean that up. The is probably a unique issue for few people.