[mythtv-users] recorded database is short over 300 programs all of a sudden

Jeff jeff at intersystems.com
Thu Jun 3 22:51:11 EDT 2004

Thursday, June 3, 2004, 9:31:42 PM, Jason Donhaue wrote:
> On Thu, 2004-06-03 at 21:10, Jeff wrote:
>> This is running Myth .14 (Knoppmyth R4V2).
>> Yesterday everything was fine but when I went to watch
>> a show today I found that the list of recordings was missing
>> quite a number of shows. If I look in the database I have around
>> 60 recorded shows. If I look in the /myth/tv directory I have around
>> 300 .nuv files.
>> I couldn't find anything 'interesting' in any of the log files.
>> This box has been up and running for 4 months now w/no trouble.
>> This doesn't sound like hardware, it sounds like mysql has
>> lost its mind :-(
>> Any chance of reconstructing the recorded database from the nuv
>> filenames and the oldrecorded data?
>> Has this happened to anyone else?

> Something similar happened to me twice - you wouldn't be using NFS would
> you?

> For me what happened was, Myth lost the NFS mount, and *apparently* if
> you go to the "watch recordings" screen, it rescans for the files, and
> if missing - DELETES the entry from mysql :(

> I had to manually recreate about 40 entries :( Now I keep the mysql DB
> on the NFS server too, that way if the mount is lost, myth can delete
> anything :)

I have two boxes and one does NFS mount the /myth volume
from the master. I'm not sure that's my problem though,
whatever happened to me is very strange. The problem is
fixed and here's what I found. I have no idea what this
means though or why the problem would have occurred to start

My recorded table contained 63 rows. I use mysqldump to
capture the database and extracted the recorded table. This is
how many entries there were. This is the same # of shows
that mythweb reported and that phpMyAdmin displayed.

I took the recorded table, the oldrecorded table and the
list of .nuv files and created a set of inserts to recreate
the missing rows in recorded. There were 202 of these.

When I tried to execute these inserts with mysql it complained
that every key was a duplicate. Now, there were 202 keys in
this file and only 63 rows to start with...The insert commands
were correct.

At this point mysql decided the recorded table was corrupt and
reported "#1016 - Can't open file: 'recorded.MYI'. (errno: 145)"

mysql> check table recorded;
| Table                | Op    | Msg_type | Msg_text                                               |
| mythconverg.recorded | check | warning  | Table is marked as crashed                             |
| mythconverg.recorded | check | warning  | 3 clients is using or hasn't closed the table properly |
| mythconverg.recorded | check | warning  | Not used space is supposed to be: 4628 but is: 4600    |
| mythconverg.recorded | check | error    | record delete-link-chain corrupted                     |
| mythconverg.recorded | check | error    | Corrupt                                                |
mysql> repair table recorded;
| Table                | Op     | Msg_type | Msg_text                                              |
| mythconverg.recorded | repair | info     | Wrong block with wrong total length starting at 12700 |
| mythconverg.recorded | repair | warning  | Number of rows changed from 281 to 280                |
| mythconverg.recorded | repair | status   | OK                                                    |

Now myth reports 280 recorded programs.

More information about the mythtv-users mailing list