[Solved] Scheduled recordings completely disappearing

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

Moderator: Forum Moderators

spotlessyogurt
Newcomer
Posts: 9
Joined: Thu May 20, 2021 10:27 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by spotlessyogurt »

nouglywires wrote:
Fri May 21, 2021 4:10 pm
The normal process is that mythfilldatabase clears out upcoming recordings and attempts to restart the backend, which buidls and maintains the upcoming recordings list. Here's the mythfilldatabase log:

Code: Select all

===============================================================
| Attempting to contact the master backend for rescheduling.  |
| If the master is not running, rescheduling will happen when |
| the master backend is restarted.                            |
===============================================================
2021-05-20 19:49:38.270340 N  mythfilldatabase run complete.
The problem here is that the backend restart step fails.

You can rebuild "upcoming recordings" by restarting the backend manually:
sudo systemctl restart mythtv-backend

This is not a database problem.

It's easy to verify this. Run mythfilldatabase and confirm that upcoming recordings is empty. Then restart the backend and see that the list is populated again.
My mythfilldatabase runs via cron every day at 5 pm; when I check my upcoming recordings everything is fully populated and not empty; it records the evenings programs just fine. It also shows that I have my daily 2 pm manual recording scheduled. But sometime after midnight and 2 pm the next day, the upcoming recordings list turns blank.
ZedThou
Junior
Posts: 25
Joined: Tue May 18, 2021 8:11 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by ZedThou »

Checking my logs, the upcoming recordings disappeared three times in the past week, and in each instance it was when there was a time gap between recordings of greater than 8 hours, which is the default wait_timeout value.

I've increased the wait_timeout setting, and the next time there will be that large a time gap between recordings is Sunday at noon. If my upcoming recordings haven't disappeared by then, I will have some confidence that the issue is resolved.
BillK
Senior
Posts: 129
Joined: Tue Dec 09, 2014 9:49 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by BillK »

Interesting! If you restart mysql without restarting mythbackend, you'll get a constant string of DBErrors. That suggests to me that that persistent connection is being queried constantly. The wait_timeout, as I understand it, severs the connect if there has been no activity on it for that duration. No activity for 8 hours seems like an improbability. Some have suggested that the mysql documentation might be wrong and the wait_timeout is in milliseconds, not seconds.
nouglywires
Junior
Posts: 20
Joined: Sun Nov 23, 2014 7:17 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by nouglywires »

My mythfilldatabase runs via cron every day at 5 pm; when I check my upcoming recordings everything is fully populated and not empty; it records the evenings programs just fine. It also shows that I have my daily 2 pm manual recording scheduled. But sometime after midnight and 2 pm the next day, the upcoming recordings list turns blank.
You shouldn't need to set up a cron job for mythfilldatabse. The backend triggers mythfilldatabase every day.

Is it possible that your backend runs mythfilldatabase sometime between midnight and 2pm, and that clears the upcoming recordings?

Check the last time mythfilldatabase ran with (frontend) Information Center > System Status, or MythWeb > Backend Status.

Of course, it's possible that you and I have different MythTV problems.
ZedThou
Junior
Posts: 25
Joined: Tue May 18, 2021 8:11 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by ZedThou »

BillK wrote:
Fri May 21, 2021 5:27 pm
No activity for 8 hours seems like an improbability.
This is easy enough to verify. Run with '-v database:debug'.
tonyguadagno
Junior
Posts: 46
Joined: Sat Oct 25, 2014 4:00 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by tonyguadagno »

hi, anyone have a solution to this? i am having the exact same issue

mysql-server-8.0/focal-updates,focal-security,now 8.0.25-0ubuntu0.20.04.1 amd64 [installed,automatic]
mythtv-backend-master/focal,focal,now 2:31.0+fixes.202105172232.f8c59ee69d~ubuntu20.04.1 all [installed]
ZedThou
Junior
Posts: 25
Joined: Tue May 18, 2021 8:11 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by ZedThou »

tonyguadagno wrote:
Fri May 21, 2021 7:20 pm
hi, anyone have a solution to this? i am having the exact same issue
Assuming you're getting the database disconnect error I mentioned in the first message of this thread, try adding wait_timeout = 2592000 to /etc/mysql/mysql.conf.d/mysqld.cnf, restart mysql, restart the backend, see how it goes.
BillK
Senior
Posts: 129
Joined: Tue Dec 09, 2014 9:49 pm
United States of America

Re: scheduled recordings completely disappearing

Post by BillK »

ZedThou wrote:
Thu May 20, 2021 1:57 am
lostinignorance wrote:
Thu May 20, 2021 1:29 am
What file and location are you changing these settings in?
I've put the setting

Code: Select all

wait_timeout = 2592000
in /etc/mysql/mysql.conf.d/mysqld.cnf, although it might be more "proper" to put personalized settings in /etc/mysql/my.cnf
bill6502 wrote:
Thu May 20, 2021 1:37 am
Note issue here too: viewtopic.php?f=36&t=4450&p=21883#p21880
I saw that thread, but didn't see any mention of the disconnect timeout in the error messages pasted there.
I tried that, however, in mysql, the mysql command "SHOW SESSION VARIABLES LIKE 'wait_timeout';" still returns 28800. I think you have to change it with:

Code: Select all

$ mysql -u root -p -h 127.0.0.1 --init-command="SET SESSION wait_timeout={new setting}"
ZedThou
Junior
Posts: 25
Joined: Tue May 18, 2021 8:11 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by ZedThou »

Code: Select all

mysql> SHOW global VARIABLES LIKE 'wait_%';
+---------------+---------+
| Variable_name | Value   |
+---------------+---------+
| wait_timeout  | 2592000 |
+---------------+---------+
1 row in set (0.04 sec)
From the MySQL documentation,
On thread startup, the session wait_timeout value is initialized from the global wait_timeout value or from the global interactive_timeout value, depending on the type of client
So, the session wait_timeout in the interactive mysql client is being set to the default interactive_timeout value, which is also 8 hours.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by bill6502 »

I've got a backend running now with DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS",
MySQLServer version: 8.0.25-0ubuntu0.20.04.1 (Ubuntu) and MythTV Version : v32-Pre-2763-g034eb86a3f

The scheduler runs every 5 minutes (300000ms actually). It may be of interest to do the
following on a running backend: mythbackend --setverbose schedule . You'll see this in
the backend log:

Code: Select all

2021-05-21 15:15:00.246714 I [14354/14379] Scheduler scheduler.cpp:2071 (run) - sleeping for 300000 ms (s2n: 279869 sr: 3 qr: 0 cs: 0)
(Disclosure: I'm not a scheduler person, but maybe there's more detail available.)

My test box has only been up for 4 hours. Running MFDB works.

SHOW GLOBAL VARIABLES WHERE Variable_name='wait_timeout'; is unchanged and = 28800
spotlessyogurt
Newcomer
Posts: 9
Joined: Thu May 20, 2021 10:27 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by spotlessyogurt »

nouglywires wrote:
Fri May 21, 2021 5:36 pm
My mythfilldatabase runs via cron every day at 5 pm; when I check my upcoming recordings everything is fully populated and not empty; it records the evenings programs just fine. It also shows that I have my daily 2 pm manual recording scheduled. But sometime after midnight and 2 pm the next day, the upcoming recordings list turns blank.
You shouldn't need to set up a cron job for mythfilldatabse. The backend triggers mythfilldatabase every day.

Is it possible that your backend runs mythfilldatabase sometime between midnight and 2pm, and that clears the upcoming recordings?

Check the last time mythfilldatabase ran with (frontend) Information Center > System Status, or MythWeb > Backend Status.

Of course, it's possible that you and I have different MythTV problems.
I used to have my backend run mythfilldatabase for me; I'd give it a specific window to run in and it worked fine. However, when SchedulesDirect changed their data format and I had to use XMLTV to grab my data, I had to re-configure it by hand and so for a while, I was running it manually. I disabled the backend running mythfilldatabase and setup a cron to do it for me at a precise time each day. The main reason I was doing it this way was I had the cron job send the output through a script I had which parsed it for specific strings to I could confirm it was working properly for me. My mythfilldatabase is running exactly once a day.

The reason I suspect a database change is that my mythtv packages have not been updated in over a year; I grab the packages by adding the PPA to my ubuntu setup, grab the most recent files and then remove the PPA; this way I'm not surprised by any changes that happen due to updates to mythtv. My box doesn't do anything else, so it has no software updates applied with one exception - it does grab the latest security updates from ubuntu automatically, and what was notable was that this issue with mythtv first started happening to me May 13th; about 1.5 days after the mysql security updates were downloaded. That's why I suspect it's some sort of mysql behavior change.

I've made the wait_timeout=172800 on my server last night; that's 2 days in seconds, which should be more than enough time. It's just before 2 pm and normally by now my scheduled recordings queue would be empty; it looks totally populated now which is a good sign. If it still looks this way by tomorrow I believe this was the problem.

Now the big question is; what is it about the mysql updates that made this behavior change?
tonyguadagno
Junior
Posts: 46
Joined: Sat Oct 25, 2014 4:00 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by tonyguadagno »

ZedThou wrote:
Fri May 21, 2021 7:46 pm
tonyguadagno wrote:
Fri May 21, 2021 7:20 pm
hi, anyone have a solution to this? i am having the exact same issue
Assuming you're getting the database disconnect error I mentioned in the first message of this thread, try adding wait_timeout = 2592000 to /etc/mysql/mysql.conf.d/mysqld.cnf, restart mysql, restart the backend, see how it goes.
sorry i missed that, trying now, both of these
wait_timeout = 172800
interactive_timeout = 172800


btw, my file was /etc/mysql/mysql.conf.d/mythtv.cnf not the other one referenced earlier
jusmop
Newcomer
Posts: 2
Joined: Sat May 22, 2021 10:13 am
Australia

Re: Scheduled recordings completely disappearing

Post by jusmop »

I'm seeing the same issue.

Running 31+fixes on Ubuntu 20.04 (LTS).

As with others, restarting the backend fixes the problem - until the next day. Interestingly today no restart was required.

I've also noticed that "sudo systemctl stop mythtv-backend" never completes. Not sure if this is related.

A snippet of backend log when experiencing the problem and doing a manual scheduled record is attached.
mythtvbackend.log
(11.33 KiB) Downloaded 232 times
BillK
Senior
Posts: 129
Joined: Tue Dec 09, 2014 9:49 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by BillK »

Yesterday, I tripled the timeouts and restarted mysql and myth-backend. This morning, the scheduler ran at 07:59:00 without generating an error. Fingers crossed.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Scheduled recordings completely disappearing

Post by bill6502 »

Code: Select all

Name                  Ubuntu  MythTV                          MySQL
ZedThou               20.04   master                          8.0.25
lostinignoramce       20.04   ?                               ?
nouglywires           20.04   31 @ commit f8c59ee             ?
crowston              20.04   31.0                            8.0.25                         
spotlessyougart       20.04   31+fixes                        MariaDB 10.3.29
BillK                 20.04   31.0                            8.0.23  # Happens at 0759, MFDB runs at 1200
tonyguadagno          20.04   31.0 @ commit f8c59ee           8.0.25
jusmop                20.04   31+fixes                        8.0.25
jhoyt                 20.04   master                          8.0.25
justin                20.04   31+fixes                        ?
stephen               20.04   31+fixes                        MariaDB 10.3.29 # Happened on 2 MythTV systems
jan                   20.04   31+fixes                        8.0.25
Sorry for any typos. Just add a comment with any errors, I'll fix them and delete the comment. Last 3
are from the -users mailing list.
  • All can restart the backend as a Band Aid.
  • ?All? are running Ubuntu, no other OS users have reported, need to verify this.
  • 8+ hours of inactivity seems important, e.g overnight
I didn't add mine as I haven't had the issue.
Post Reply