[I take it other people -are- getting data from tv_grab_zz_sdjson?]
Might be a locked sqlite DB, but I'm not sure how it's locked.
See debugging stream below:
I -had- been running MFDB like this:
$ /usr/bin/mythfilldatabase --verbose general --loglevel info --quiet --syslog local7
and just now ran it by hand, as mythtv, using this:
$ /usr/bin/mythfilldatabase --verbose general.xmltv
with no other args. ("whoami" returns "mythtv",
so I'm definitely the right user while doing this by-hand run.)
I see a line I didn't see with the prior logging:
2022-12-27 16:39:05.222227 I Unable to create settings table in database /home/mythtv/.xmltv/SchedulesDirect.DB: attempt to write a readonly database
I don't know if that's related to anything or if that's happened forever
and I just never saw it with the prior logging, but I'm betting it's new
and related; see below. That file exists and is writable and was last
updated the last time MFDB ran successfully:
-rw-r--r-- 1 mythtv mythtv 296087552 Dec 25 18:16 /home/mythtv/.xmltv/SchedulesDirect.DB
I'm a little suspicious in that I had -just- started to look into
a different issue just after that run, involving getting rid of some
channels which Myth kept trying to record from but weren't tunable.
(Long standing issue I was finally getting to.) The only thing I
did was to do this (as myself, not myth or root):
$ sdjson-sqlite-select --list --database /home/mythtv/.xmltv/SchedulesDirect.DB --file current-callsigns
and then I didn't touch that DB again. I'd also for the first time
run find_orphans but hadn't allowed it to do anything (^C'ed out).
The /home filesystem is not mounted readonly; "touch foo" worked fine.
Config file /home/mythtv/.mythtv/SD.xmltv last modified 18 months ago
when I installed on this machine.
I get the same error trying to run the grabber manually:
$ tv_grab_zz_sdjson_sqlite --days 0 --config-file /home/mythtv/.mythtv/SD.xmltv
Opening the local database
Unable to create settings table in database /home/mythtv/.xmltv/SchedulesDirect.DB: attempt to write a readonly database
and it quits. When I did this 18 months ago when I was installing it,
the next line was instead:
Obtaining authentication token for Schedules Direct
and then several more lines of log and then a giant pile of XML.
Is there some way in which sqlite could have set the DB readonly,
even if the file itself appears to be writable? This page:
https://stackoverflow.com/questions/1518729/change-sqlite-database-mode-to-read-write talks about it potentially being locked by some other process, but
# lsof | grep /home/mythtv/.xmltv/SchedulesDirect.DB
dosen't show any other processes have it open. And the directory it's
in appears writable by mythtv as well, which apparently is another way
the DB can claim to be locked.
/home/mythtv/.xmltv:
total used in directory 289192 available 11044444
drwxrwxr-x 2 mythtv mythtv 4096 Dec 25 20:11 .
drwxr-xr-x 8 mythtv mythtv 4096 Aug 24 2021 ..
-rw-r--r-- 1 mythtv mythtv 296087552 Dec 25 18:16 SchedulesDirect.DB
This page:
https://www.arysontechnologies.com/blog/fix-sqlite-error-database-locked/ claims that one can break the lock by creating a backup and then
swapping DB files. I can try it if nobody has any better ideas, but it
seems a little drastic and perhaps incorrect---especially since the file
claims a last-write date of the end of the last successful MFDB run,
-not- a few hours later when I first ran sdjson-sqlite-select (if that
even has anything to do with it)---does a sqlite lock update the file
itself? Would a reboot clear it? (Which I'm not anxious to do if
there's an easier way.)
Any other things I can do to debug this?
Thanks!
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users http://wiki.mythtv.org/Mailing_List_etiquette MythTV Forums:
https://forum.mythtv.org