[solved] Mythfilldatabase runs with error code 13
Moderator: Forum Moderators
[solved] Mythfilldatabase runs with error code 13
OK what have I done so far,...
If I run mythfilldatabase (mfdb, addrev. used from here on) from the command line as my logged in standard user,.. everything works fine and the program stuff is all nicely populated. However if I leave mythtv to run it as a background process it fails, with erorr code 13,.. as shown in the log snip below
----
2014-04-17 10:29:46.562292 I [5514/5514] CoreContext filldata.cpp:664 (Run) - Grabber prefers method: allatonce
2014-04-17 10:29:46.562961 I [5514/5514] CoreContext filldata.cpp:378 (GrabData) - XMLTV config file is: /home/mythtv/.mythtv/Vs-FreeView.xmltv
2014-04-17 10:29:46.964027 E [5514/5514] CoreContext filldata.cpp:440 (GrabData) - FillData: XMLTV grabber returned error code 13
2014-04-17 10:29:46.964683 E [5514/5514] CoreContext xmltvparser.cpp:587 (parseFile) - Error in 1:1: unexpected end of file
----
I assumed this was to do with the *.xmltv files not being correct within the mythtv structure,.. or something,.. as initially I had a sym link from the mythtv/.mythtv dir to my user account ~\.mythtv\Vs-FreeView.xmltv,.. so I copied over the files files changed their ownership and group and 644 r/w privs.
This made no difference,. much to my dismay,.. but then I cannot explain the "[2972/2972] thread_unknown" text at the start of info lines.
One final note is when I run mfdb within mythtv I specify two options,.. "--logpath /var/log/mythtv2 --loglevel info",..
I did try these options from the command line as a user,.. but it made no difference other than the log file was written to logpath
I did at one stage think my LANGuage stuff was messing things up,. but I have now corrected this as follows by using the following line in the mythtv-backend.conf file,...
test -f /etc/default/locale && . /etc/default/locale || true So I am now at a bit of a loss as to what to do next....
Can anyone spread any light here for me.
many Tx
If I run mythfilldatabase (mfdb, addrev. used from here on) from the command line as my logged in standard user,.. everything works fine and the program stuff is all nicely populated. However if I leave mythtv to run it as a background process it fails, with erorr code 13,.. as shown in the log snip below
----
2014-04-17 10:29:46.562292 I [5514/5514] CoreContext filldata.cpp:664 (Run) - Grabber prefers method: allatonce
2014-04-17 10:29:46.562961 I [5514/5514] CoreContext filldata.cpp:378 (GrabData) - XMLTV config file is: /home/mythtv/.mythtv/Vs-FreeView.xmltv
2014-04-17 10:29:46.964027 E [5514/5514] CoreContext filldata.cpp:440 (GrabData) - FillData: XMLTV grabber returned error code 13
2014-04-17 10:29:46.964683 E [5514/5514] CoreContext xmltvparser.cpp:587 (parseFile) - Error in 1:1: unexpected end of file
----
I assumed this was to do with the *.xmltv files not being correct within the mythtv structure,.. or something,.. as initially I had a sym link from the mythtv/.mythtv dir to my user account ~\.mythtv\Vs-FreeView.xmltv,.. so I copied over the files files changed their ownership and group and 644 r/w privs.
This made no difference,. much to my dismay,.. but then I cannot explain the "[2972/2972] thread_unknown" text at the start of info lines.
One final note is when I run mfdb within mythtv I specify two options,.. "--logpath /var/log/mythtv2 --loglevel info",..
I did try these options from the command line as a user,.. but it made no difference other than the log file was written to logpath
I did at one stage think my LANGuage stuff was messing things up,. but I have now corrected this as follows by using the following line in the mythtv-backend.conf file,...
test -f /etc/default/locale && . /etc/default/locale || true So I am now at a bit of a loss as to what to do next....
Can anyone spread any light here for me.
many Tx
- Attachments
-
- mfdbFail.txt
- (8.78 KiB) Downloaded 229 times
Re: Mythfilldatabase runs with error code 13
Hi,
If the permission check doesn't show any problems, I'd re-run MFDB with: -v xmltv,system for additional logging. You can change the loglevel of the backend, on the fly, with mythbackend --setverbose xmltv,system.
13 (at least on my system) means 'Permission denied'. Type: perror 13 on yours to verify it. It sounds like you now have 2 identical copies of the file in question with the owner/group changed to match the owner/group of the running program e.g. one for mythtv and one for yourself (which works.) I'd recheck the mythtv one.2014-04-17 10:29:46.964027 E [5514/5514] CoreContext filldata.cpp:440 (GrabData) - FillData: XMLTV grabber returned error code 13
This isn't an error, it really means that the name of the thread is unknown. Ignore it.but then I cannot explain the "[2972/2972] thread_unknown" text at the start of info lines
If the permission check doesn't show any problems, I'd re-run MFDB with: -v xmltv,system for additional logging. You can change the loglevel of the backend, on the fly, with mythbackend --setverbose xmltv,system.
Re: Mythfilldatabase runs with error code 13
Code 13 is simply the exit code from the XMLTV grabber. It's meaning is arbitrary, and does not necessarily follow any system standard behavior. I can't seem to find any standard error code behavior defined for general XMLTV grabbers either. You may need to read through the script in question to determine its meaning.
Re: Mythfilldatabase runs with error code 13
Ok guys,.. Success!!
I have increased the log level,.. nice command that to increase logging level,.. those myth boys and girls are so clever that you can do this on the fly.... Love-it...
OK so I have to wait 24hrs or so each time for the guide info to re-run in the background,. I started to look at running it straight of the command line as it would be by MythTV,..
I have made some progress in respect that it is the mythtv user that cannot run mfdb,.. as if I login as the mythtv user ( using the following sudo su - mythtv ),.. then running mfdb from the command line I get the same error, although I have used the extended logging,. and i get the following output.:-
2014-04-20 11:42:33.788815 I Updating source #2 (Vs-FreeView) with grabber tv_grab_uk_rt
2014-04-20 11:42:33.789175 I Found 58 channels for source 2 which use grabber
2014-04-20 11:42:33.789890 I Managed child (PID: 4915) has started! * command=tv_grab_uk_rt --capabilities, timeout=25
2014-04-20 11:42:34.006302 I Managed child (PID: 4915) has exited! command=tv_grab_uk_rt --capabilities, status=0, result=0
2014-04-20 11:42:34.006973 I Grabber has capabilities: baseline manualconfig cache preferredmethod tkconfig apiconfig lineups
2014-04-20 11:42:34.007421 I Managed child (PID: 4917) has started! * command=tv_grab_uk_rt --preferredmethod, timeout=15
2014-04-20 11:42:34.206498 I Managed child (PID: 4917) has exited! command=tv_grab_uk_rt --preferredmethod, status=0, result=0
2014-04-20 11:42:34.207257 I Grabber prefers method: allatonce
2014-04-20 11:42:34.207595 I XMLTV config file is: /home/mythtv/.mythtv/Vs-FreeView.xmltv
2014-04-20 11:42:34.209869 I Grabber Command: nice tv_grab_uk_rt --config-file '/home/mythtv/.mythtv/Vs-FreeView.xmltv' --output /tmp/mythHwUii3
2014-04-20 11:42:34.209876 I ----------------- Start of XMLTV output -----------------
2014-04-20 11:42:34.210566 I Managed child (PID: 4919) has started! * command=nice tv_grab_uk_rt --config-file '/home/mythtv/.mythtv/Vs-FreeView.xmltv' --output /tmp/mythHwUii3, timeout=0
2014-04-20 11:42:34.606835 I Managed child (PID: 4919) has exited! command=nice tv_grab_uk_rt --config-file '/home/mythtv/.mythtv/Vs-FreeView.xmltv' --output /tmp/mythHwUii3, status=3328, result=13
2014-04-20 11:42:34.607836 I ------------------ End of XMLTV output ------------------
2014-04-20 11:42:34.608954 E FillData: XMLTV grabber returned error code 13
2014-04-20 11:42:34.609614 E Error in 1:1: unexpected end of file
2014-04-20 11:42:34.611985 I No programs found in data.
Now I have also checked the file in vi,.. there are no spare lines within the file,.. and it is a UNIX file,. ( and not a DOS file ), and mythtv user can write to /tmp
running the grabber command directly I get the following messages
$ tv_grab_uk_rt --config-file '/home/mythtv/.mythtv/Vs-FreeView.xmltv' --output /tmp/mythHwUii3
Program/library version information:
XMLTV library version: 0.5.61
tv_grab_uk_rt version: 1.342, 2011/06/19 06:50:36
libwww-perl version: 6.03
Date::Manip version: 6.25 [europe/london]
Failed to write to /home/myuser/.xmltv/cache/1fb4ec9170c25a9b69bb9bd7efee0b90.tmp4969 at /usr/share/perl5/HTTP/Cache/Transparent.pm line 379.
whether this is a valid test I do not know,.. or is this just dumb thing to do..
default privs on ---------- drwxrwxr-x 4 myuser myuser 4096 Mar 6 12:25 .xmltv
changed to 777 on myuser/.xmltv/cache,........ And yes IT WORKS and runs fine,... Yippee,.. now just run it as mfdb and it still works,.. now for a " dance round table"
--------------------------------------------------------------------
OK so final question,.. why does mythtv user insist on using /home/myuser/.xmltv/cache rather than is own file structure ???
is this expected,.. by design,..... or have I missed something else during setup.. I can see possible issues either way,.. but I do not know enough about mythtv!!
checked my group file:- and got,.... mythtv
127:myuser,. so myuser and mythtv share the the same group I think.. but myuser is in its own group... not sure what this means...
Can you guys spread some light here.
Thanks for the input,... I got there in the end
I have increased the log level,.. nice command that to increase logging level,.. those myth boys and girls are so clever that you can do this on the fly.... Love-it...
OK so I have to wait 24hrs or so each time for the guide info to re-run in the background,. I started to look at running it straight of the command line as it would be by MythTV,..
I have made some progress in respect that it is the mythtv user that cannot run mfdb,.. as if I login as the mythtv user ( using the following sudo su - mythtv ),.. then running mfdb from the command line I get the same error, although I have used the extended logging,. and i get the following output.:-
2014-04-20 11:42:33.788815 I Updating source #2 (Vs-FreeView) with grabber tv_grab_uk_rt
2014-04-20 11:42:33.789175 I Found 58 channels for source 2 which use grabber
2014-04-20 11:42:33.789890 I Managed child (PID: 4915) has started! * command=tv_grab_uk_rt --capabilities, timeout=25
2014-04-20 11:42:34.006302 I Managed child (PID: 4915) has exited! command=tv_grab_uk_rt --capabilities, status=0, result=0
2014-04-20 11:42:34.006973 I Grabber has capabilities: baseline manualconfig cache preferredmethod tkconfig apiconfig lineups
2014-04-20 11:42:34.007421 I Managed child (PID: 4917) has started! * command=tv_grab_uk_rt --preferredmethod, timeout=15
2014-04-20 11:42:34.206498 I Managed child (PID: 4917) has exited! command=tv_grab_uk_rt --preferredmethod, status=0, result=0
2014-04-20 11:42:34.207257 I Grabber prefers method: allatonce
2014-04-20 11:42:34.207595 I XMLTV config file is: /home/mythtv/.mythtv/Vs-FreeView.xmltv
2014-04-20 11:42:34.209869 I Grabber Command: nice tv_grab_uk_rt --config-file '/home/mythtv/.mythtv/Vs-FreeView.xmltv' --output /tmp/mythHwUii3
2014-04-20 11:42:34.209876 I ----------------- Start of XMLTV output -----------------
2014-04-20 11:42:34.210566 I Managed child (PID: 4919) has started! * command=nice tv_grab_uk_rt --config-file '/home/mythtv/.mythtv/Vs-FreeView.xmltv' --output /tmp/mythHwUii3, timeout=0
2014-04-20 11:42:34.606835 I Managed child (PID: 4919) has exited! command=nice tv_grab_uk_rt --config-file '/home/mythtv/.mythtv/Vs-FreeView.xmltv' --output /tmp/mythHwUii3, status=3328, result=13
2014-04-20 11:42:34.607836 I ------------------ End of XMLTV output ------------------
2014-04-20 11:42:34.608954 E FillData: XMLTV grabber returned error code 13
2014-04-20 11:42:34.609614 E Error in 1:1: unexpected end of file
2014-04-20 11:42:34.611985 I No programs found in data.
Now I have also checked the file in vi,.. there are no spare lines within the file,.. and it is a UNIX file,. ( and not a DOS file ), and mythtv user can write to /tmp
running the grabber command directly I get the following messages
$ tv_grab_uk_rt --config-file '/home/mythtv/.mythtv/Vs-FreeView.xmltv' --output /tmp/mythHwUii3
Program/library version information:
XMLTV library version: 0.5.61
tv_grab_uk_rt version: 1.342, 2011/06/19 06:50:36
libwww-perl version: 6.03
Date::Manip version: 6.25 [europe/london]
Failed to write to /home/myuser/.xmltv/cache/1fb4ec9170c25a9b69bb9bd7efee0b90.tmp4969 at /usr/share/perl5/HTTP/Cache/Transparent.pm line 379.
whether this is a valid test I do not know,.. or is this just dumb thing to do..
default privs on ---------- drwxrwxr-x 4 myuser myuser 4096 Mar 6 12:25 .xmltv
changed to 777 on myuser/.xmltv/cache,........ And yes IT WORKS and runs fine,... Yippee,.. now just run it as mfdb and it still works,.. now for a " dance round table"
--------------------------------------------------------------------
OK so final question,.. why does mythtv user insist on using /home/myuser/.xmltv/cache rather than is own file structure ???
is this expected,.. by design,..... or have I missed something else during setup.. I can see possible issues either way,.. but I do not know enough about mythtv!!
checked my group file:- and got,.... mythtv
Can you guys spread some light here.
Thanks for the input,... I got there in the end
Re: Mythfilldatabase runs with error code 13
I'm over here in the states, so I don't use tv_grab_uk_rt, but it appears that you can run it with the --debug option to get more data. Also, if I'm looking at the right code:
it appears that the location of the cache directory is configurable. As your user, not mythtv, if you compare the two config files, do they point to different cachedirs?
Code: Select all
# New-style config files must include a cachedir entry
if (not defined( $conf->{cachedir} )) {
print STDERR "No cachedir defined in configfile ($opt->{'config-file'})\n" .
"Please run the grabber with --configure.\n";
exit 1;
}Code: Select all
diff /home/mythtv/.mythtv/Vs-FreeView.xmltv ~/.mythtv/Vs-FreeView.xmltvRe: Mythfilldatabase runs with error code 13
Bill,.. No need for compare,.. as I copied the two files over to the other structure,...
One thing I had/have read in forums what ever is to create a sym link from mythtv user/*xmltv files to the myuser/.mythtv/*xmltv files... so hence the two sets of files will always be the same,... or expected to be....
Now things broke a while back,.. because I changed the backend startup to actually run as "--user mythtv",... (compounded with logging problems, fixed logging),..so hence then trying to use the myuser/cache structure, with no privs to do so.. and as part of my debugging I just copied the files over,... So hence they are both the same.
Now I have to say I have not seen anything about editing the xmltv file etc. as they are considered to be exactly the same, hence the linkíng command,.. so unless there is some config command line arg that specs a new cache location I do not know what is exactly going on here. Has a spec. changed somewhere,.. and users must now edit the cachedir def in each ~/.mythtv/xmltv file.
I noticed when installing 0.27 that the xmltv files were correctly created in the mythtv user structure,.. however there is also many docs available about how to manually create them,.. as myuser,.. which then populates the myuser structure.
So hence some contradicting info, miss-understanding of operation around,.. not sure what can be done but there is certainly advantages in having the two sets of files linked,.. IMHO.
Since my last post,.. mfdb has run,.. and has populated successfully,.... I will change my mythtv users xmltv files to reflect mythtv users own file structure for cache files, and see how things go.
Regards
One thing I had/have read in forums what ever is to create a sym link from mythtv user/*xmltv files to the myuser/.mythtv/*xmltv files... so hence the two sets of files will always be the same,... or expected to be....
Now things broke a while back,.. because I changed the backend startup to actually run as "--user mythtv",... (compounded with logging problems, fixed logging),..so hence then trying to use the myuser/cache structure, with no privs to do so.. and as part of my debugging I just copied the files over,... So hence they are both the same.
Now I have to say I have not seen anything about editing the xmltv file etc. as they are considered to be exactly the same, hence the linkíng command,.. so unless there is some config command line arg that specs a new cache location I do not know what is exactly going on here. Has a spec. changed somewhere,.. and users must now edit the cachedir def in each ~/.mythtv/xmltv file.
I noticed when installing 0.27 that the xmltv files were correctly created in the mythtv user structure,.. however there is also many docs available about how to manually create them,.. as myuser,.. which then populates the myuser structure.
So hence some contradicting info, miss-understanding of operation around,.. not sure what can be done but there is certainly advantages in having the two sets of files linked,.. IMHO.
Since my last post,.. mfdb has run,.. and has populated successfully,.... I will change my mythtv users xmltv files to reflect mythtv users own file structure for cache files, and see how things go.
Regards
Re: Mythfilldatabase runs with error code 13
It would seem that the xmltv script, and therefore most likely mythfilldatabase/mythbackend is being run under the 'myuser' and not the 'mythtv' user.
I'd double check with ps -Af | grep myth that mythbackend really is running under the mythtv user.
I'd double check with ps -Af | grep myth that mythbackend really is running under the mythtv user.
Re: Mythfilldatabase runs with error code 13
Stuartm,...
Definitely running as Myth.. I think..
unless "ps" is fibbing,...
mythtv 1587 1 6 14:46 ? 00:06:09 /usr/bin/mythbackend --user mythtv --syslog local7
But none the less,.. mfdb does now run fine,.. having edited the cache entry line... and created two sets of xmltv source files, one within the myuser structure and another within the mythtv structure...
Regards
Definitely running as Myth.. I think..
unless "ps" is fibbing,...
mythtv 1587 1 6 14:46 ? 00:06:09 /usr/bin/mythbackend --user mythtv --syslog local7
But none the less,.. mfdb does now run fine,.. having edited the cache entry line... and created two sets of xmltv source files, one within the myuser structure and another within the mythtv structure...
Regards
Re: [solved] Mythfilldatabase runs with error code 13
New load of MythTV 31.0 on Ubuntu 20.04.03
Run mythfilldatabase as me (user jtb), runs fine. Run as user mythtv, get error 13.
Run mythfilldatabase -v xmltv,system, find this error message
2021-09-28 08:17:24.362650 I Managed child (PID: 53866) has exited! command=nice tv_grab_zz_sdjson --config-file '/home/mythtv/.mythtv/vs01.xmltv' --output /tmp/mythLuTsR9, status=3328, result=13
As hinted at above, went to /home/jtb and ran
chown jtb:mythtv .xmltv/
And in .xmltv, ran
chown jtb:mythtv tv_grab_zz_sdjson.cache
mythfilldatabase runs fine now as either jtb or mythtv
Run mythfilldatabase as me (user jtb), runs fine. Run as user mythtv, get error 13.
Run mythfilldatabase -v xmltv,system, find this error message
2021-09-28 08:17:24.362650 I Managed child (PID: 53866) has exited! command=nice tv_grab_zz_sdjson --config-file '/home/mythtv/.mythtv/vs01.xmltv' --output /tmp/mythLuTsR9, status=3328, result=13
As hinted at above, went to /home/jtb and ran
chown jtb:mythtv .xmltv/
And in .xmltv, ran
chown jtb:mythtv tv_grab_zz_sdjson.cache
mythfilldatabase runs fine now as either jtb or mythtv

