mythfilldatabase sdjson

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

Moderator: Forum Moderators

Post Reply
wesnewell
Senior
Posts: 356
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

mythfilldatabase sdjson

Post by wesnewell » Sat Aug 11, 2018 5:47 am

Runs fine from terminal as user, but get errors when run from mythtv.
I tried everything I know but it just won't run from mythtv backend. Tried copying files to mthtv dir. Still get errors. Tried running mythv-set from mythtv user account after creating a passwd for it. No go.
Finally created a crontab job to run a simple shell script each day from my home dir and that seems to work ok, but that doesn't seem like the proper way to do it. Anyone got any ideas?
Errors in log show up as error 1, and error 255, depending on how I configure the backend setup.
Aug 8 08:21:32 mythfe0 mythfilldatabase: mythfilldatabase[1954]: E CoreContext filldata.cpp:441 (GrabData) FillData: XMLTV grabber returned error code 1
Aug 8 08:21:32 mythfe0 mythfilldatabase: mythfilldatabase[1954]: E CoreContext xmltvparser.cpp:670 (parseFile) Error in 1:1: unexpected end of file
Aug 8 08:21:32 mythfe0 mythfilldatabase: mythfilldatabase[1954]: I CoreContext filldata.cpp:321 (GrabDataFromFile) No programs found in data.
...
Aug 9 10:01:48 mythfe0 mythfilldatabase: mythfilldatabase[19168]: E CoreContext filldata.cpp:441 (GrabData) FillData: XMLTV grabber returned error code 255
Aug 9 10:01:48 mythfe0 mythfilldatabase: mythfilldatabase[19168]: E CoreContext xmltvparser.cpp:670 (parseFile) Error in 1:1: unexpected end of file
Aug 9 10:01:49 mythfe0 mythfilldatabase: mythfilldatabase[19168]: I CoreContext filldata.cpp:321 (GrabDataFromFile) No programs found in data.

Other files.
wes@mythfe0:~$ cat ~/.mythtv/sd.xmltv
cache=/home/wes/.xmltv/tv_grab_zz_sdjson.cache
channel-id-format=default
previously-shown-format=date
username=xxxxxxx
password=xxxxxxxxxx
mode=lineup
lineup=USA-OTA-75098

wes@mythfe0:~$ cat /home/mythtv/.mythtv/sd.xmltv
cache=/home/mythtv/.xmltv/tv_grab_zz_sdjson.cache
channel-id-format=default
previously-shown-format=date
username=xxxxxxxx
password=xxxxxx
mode=lineup
lineup!USA-OTA-75098

wes@mythfe0:~$ ll ~/.mythtv/sd*
-rw-rw-r-- 1 wes wes 180 Aug 8 10:00 /home/wes/.mythtv/sd.xmltv
wes@mythfe0:~$ ll ~/.xmltv/*
-rw-rw-rw- 1 wes mythtv 52480352 Aug 11 00:18 /home/wes/.xmltv/tv_grab_zz_sdjson.cache
wes@mythfe0:~$ ll /home/mythtv/.mythtv/sd*
-rw-rw-r-- 1 mythtv mythtv 183 Aug 10 06:44 /home/mythtv/.mythtv/sd.xmltv
wes@mythfe0:~$ ll /home/mythtv/.xmltv/*
-rw-rw-rw- 1 mythtv mythtv 52319942 Aug 7 07:46 /home/mythtv/.xmltv/tv_grab_zz_sdjson.cache
wes@mythfe0:~$

wes@mythfe0:~$ crontab -l
# Edit this file to introduce tasks to be run by cron.
# m h dom mon dow command
18 10 * * * /home/wes/mfdb

wes@mythfe0:~$ cat mfdb
#!/bin/bash
mythfilldatabase
Backend-GF8200A, AMD Phenom II B95, 6 atsc tuners. Frontends-GF8200's,,AMD Athlon II's. Mythtv user since 2005.

MikeB2013
Senior
Posts: 286
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: mythfilldatabase sdjson

Post by MikeB2013 » Sat Aug 11, 2018 7:34 am

Looks like a permissions issue.

Assuming a packaged version of mythtv e.g. on Ubuntu, mythfilldatabase runs under user "mythtv" when automatically run. If you want to run mythfilldatabase from a terminal session, you need to switch to mythtv user by doing sudo su mythtv in the terminal session.

Make sure no other versions of sd.xmltv files exist, except in /home/mythtv/.mythtv/

Your sd.xmltv file needs to be in /home/mythtv/.mythtv/ with the cache= line being cache=/home/mythtv/.xmltv/tv_grab_zz_sdjson.cache

Ownership of sd.xmltv and files in /home/mythtv/.xmltv/ should be mythtv:mythtv

Note I have never added a password to mythtv user, the only thing I have done is to add a shell to mythtv user which makes terminal usage a little easier (you get things like auto-complete) by doing sudo chsh -s /bin/bash mythtv

Mike

wesnewell
Senior
Posts: 356
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: mythfilldatabase sdjson

Post by wesnewell » Sat Aug 11, 2018 2:16 pm

MikeB2013 wrote:
Sat Aug 11, 2018 7:34 am
Looks like a permissions issue.
Ownership of sd.xmltv and files in /home/mythtv/.xmltv/ should be mythtv:mythtv
If you note in my first post, they are owned by mythtv and also in mythtv group with r/w permissions set.

This was originally a mythbuntu 16.04 install that I did a release upgrade to 18.04lts a while back when 18.04 first came out. Everything works properly using SD data direct. This problem only started when I swicthed to sdjson data about a week ago. There was no mythtv user you could log in as before I added the password for user mythtv. I think at this point, it may be easier to just re-install everything with 18.04.1 LTS, but I'm trying to avoid that. The crontab job does work and guide data does get updated so maybe I'll just leave it that way.
Backend-GF8200A, AMD Phenom II B95, 6 atsc tuners. Frontends-GF8200's,,AMD Athlon II's. Mythtv user since 2005.

MikeB2013
Senior
Posts: 286
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: mythfilldatabase sdjson

Post by MikeB2013 » Sat Aug 11, 2018 2:43 pm

Just noticed in
wes@mythfe0:~$ cat /home/mythtv/.mythtv/sd.xmltv
cache=/home/mythtv/.xmltv/tv_grab_zz_sdjson.cache
channel-id-format=default
previously-shown-format=date
username=xxxxxxxx
password=xxxxxx
mode=lineup
lineup!USA-OTA-75098

The lineup is disabled, the ! should be =

Your other files has the lineup enabled:
Other files.
wes@mythfe0:~$ cat ~/.mythtv/sd.xmltv
cache=/home/wes/.xmltv/tv_grab_zz_sdjson.cache
channel-id-format=default
previously-shown-format=date
username=xxxxxxx
password=xxxxxxxxxx
mode=lineup
lineup=USA-OTA-75098

wesnewell
Senior
Posts: 356
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: mythfilldatabase sdjson

Post by wesnewell » Sat Aug 11, 2018 5:46 pm

Good catch. Don't know how that happened. Just ran mythfilldatabase as user mythtv without errors. It didn't insert any new data but I'll assume for now that's because I ran a crontab job as wes earlier today. Will delete crontab today and see if that fixed it tomorrow when it runs again.
Thank you very much.

Yep. ran like a charm today. thanks again.
Backend-GF8200A, AMD Phenom II B95, 6 atsc tuners. Frontends-GF8200's,,AMD Athlon II's. Mythtv user since 2005.

Post Reply