Program Guide Updates Stopped Around Schedule Directs Renewal

For discussion of topics specific to MythTV on Raspberry Pi devices
Post Reply
angelo454
Newcomer
Posts: 13
Joined: Wed Nov 11, 2020 2:33 am
United States of America

Program Guide Updates Stopped Around Schedule Directs Renewal

Post by angelo454 »

My Pi4 MythTV setup has been working flawlessly for almost 1 year. Around the time of my Schedule Directs subscription renewal, it stopped getting Program Guide updates (I renewed my subscription around 4 weeks before it expired). I tried running mythfilldatabase manually as mythtv user and I get "FillData: XMLTV grabber returned error code 1" (full output below). Is it just a coincidence that this happened around the time of my subscription renewal? How can I fix this problem?

Code: Select all

pi@mythtv:/home/mythtv/.xmltv $ sudo --login --user=mythtv mythfilldatabase --verbose=xmltv
2021-12-05 09:54:13.334967 C  mythfilldatabase version: fixes/31 [v31.0-54-g445cf1fe6b] www.mythtv.org
2021-12-05 09:54:13.335067 C  Qt version: compile: 5.11.3, runtime: 5.11.3
2021-12-05 09:54:13.335188 I  Raspbian GNU/Linux 10 (buster) (arm)
2021-12-05 09:54:13.335207 N  Enabled verbose msgs:  general xmltv
2021-12-05 09:54:13.335243 N  Setting Log Level to LOG_INFO
2021-12-05 09:54:13.346870 I  Added logging to the console
2021-12-05 09:54:13.347086 I  Setup Interrupt handler
2021-12-05 09:54:13.347106 I  Setup Terminated handler
2021-12-05 09:54:13.347137 I  Setup Segmentation fault handler
2021-12-05 09:54:13.347156 I  Setup Aborted handler
2021-12-05 09:54:13.347182 I  Setup Bus error handler
2021-12-05 09:54:13.347199 I  Setup Floating point exception handler
2021-12-05 09:54:13.347223 I  Setup Illegal instruction handler
2021-12-05 09:54:13.347242 I  Setup Real-time signal 0 handler
2021-12-05 09:54:13.347271 I  Setup Hangup handler
2021-12-05 09:54:13.347648 N  Using runtime prefix = /usr
2021-12-05 09:54:13.347663 N  Using configuration directory = /home/mythtv/.mythtv
2021-12-05 09:54:13.347807 I  Assumed character encoding: en_US
2021-12-05 09:54:13.347834 W  This application expects to be running a locale that specifies a UTF-8 codeset, and many features may behave improperly with your current language settings. Please set the LC_ALL or LC_CTYPE, and LANG variable(s) in the environment in which this program is executed to include a UTF-8 codeset (such as 'en_US.UTF-8').
2021-12-05 09:54:13.349110 I  Empty LocalHostName. This is typical.
2021-12-05 09:54:13.349133 I  Using a profile name of: 'mythtv' (Usually the same as this host's name.)
2021-12-05 09:54:13.349358 I  Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
2021-12-05 09:54:14.369824 N  Setting QT default locale to en_US
2021-12-05 09:54:14.369866 I  Current locale en_US
2021-12-05 09:54:14.369993 N  Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
2021-12-05 09:54:14.397589 E  PowerDBus: No UPower interface. Unable to monitor battery state
2021-12-05 09:54:14.409140 I  PowerDBus: Failed to delay sleep,shutdown: Permission denied
2021-12-05 09:54:14.426940 I  Power: On AC power
2021-12-05 09:54:14.426970 I  Power: Supported actions: None
2021-12-05 09:54:14.428595 I  Loading en_us translation for module mythfrontend
2021-12-05 09:54:14.432261 I  Current MythTV Schema Version (DBSchemaVer): 1361
2021-12-05 09:54:14.439295 I  MythCoreContext::ConnectCommandSocket(): Connecting to backend server: 192.168.1.27:6543 (try 1 of 1)
2021-12-05 09:54:14.442603 I  MythCoreContext::CheckProtoVersion(): Using protocol version 91 BuzzOff
2021-12-05 09:54:14.443186 I  Opening blocking connection to master backend
2021-12-05 09:54:14.444488 I  Updating source #1 (Fios) with grabber tv_grab_zz_sdjson_sqlite
2021-12-05 09:54:14.444927 I  Found 855 channels for source 1 which use grabber
2021-12-05 09:54:14.445465 I  Starting process manager
2021-12-05 09:54:14.445640 I  Starting IO manager (read)
2021-12-05 09:54:14.445742 I  Starting process signal handler
2021-12-05 09:54:14.445841 I  Starting IO manager (write)
2021-12-05 09:54:16.250714 I  Grabber has capabilities: baseline manualconfig preferredmethod lineups apiconfig
2021-12-05 09:54:18.005572 I  Grabber prefers method: allatonce
2021-12-05 09:54:18.006470 I  XMLTV config file is: /home/mythtv/.mythtv/Fios.xmltv
2021-12-05 09:54:18.010897 I  Grabber Command: nice tv_grab_zz_sdjson_sqlite --config-file '/home/mythtv/.mythtv/Fios.xmltv' --output /tmp/mythQSDVlc
2021-12-05 09:54:18.010911 I  ----------------- Start of XMLTV output -----------------
2021-12-05 09:54:20.008528 I  ------------------ End of XMLTV output ------------------
2021-12-05 09:54:20.010208 E  FillData: XMLTV grabber returned error code 1
2021-12-05 09:54:20.810223 E  Malformed XML file, missing </tv> element, at line 1, Premature end of document.
2021-12-05 09:54:20.811415 E  Failed to fetch some program info
2021-12-05 09:54:20.811482 I  Adjusting program database end times.
2021-12-05 09:54:20.812078 I      0 replacements made
2021-12-05 09:54:20.812089 I  Marking generic episodes.
2021-12-05 09:54:20.812751 I      Found 0
2021-12-05 09:54:20.812775 I  Extending non-unique programids with multiple parts.
2021-12-05 09:54:20.813671 I      Found 0
2021-12-05 09:54:20.813683 I  Fixing missing original airdates.
2021-12-05 09:54:20.814476 I      Found 0 with programids
2021-12-05 09:54:20.815458 I      Found 0 without programids
2021-12-05 09:54:20.815469 I  Marking repeats.
2021-12-05 09:54:20.817886 I      Found 0
2021-12-05 09:54:20.817898 I  Unmarking new episode rebroadcast repeats.
2021-12-05 09:54:20.818596 I      Found 0
2021-12-05 09:54:24.794302 I  Marking episode first showings.
2021-12-05 09:54:24.797725 I      Found 0
2021-12-05 09:54:24.797739 I  Marking episode last showings.
2021-12-05 09:54:24.800503 I      Found 0
2021-12-05 09:54:24.802555 I
===============================================================
| Attempting to contact the master backend for rescheduling.  |
| If the master is not running, rescheduling will happen when |
| the master backend is restarted.                            |
===============================================================
2021-12-05 09:54:24.804394 N  mythfilldatabase run complete.
2021-12-05 09:54:24.804577 I  PowerDBus: Closing interfaces
2021-12-05 09:54:24.805870 I  Waiting for threads to exit.
2021-12-05 09:54:24.808730 I  Exiting
pi@mythtv:/home/mythtv/.xmltv $
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Program Guide Updates Stopped Around Schedule Directs Renewal

Post by bill6502 »

Try running the grabber (in the log above) from the command line:

Code: Select all

tv_grab_zz_sdjson_sqlite --config-file '/home/mythtv/.mythtv/Fios.xmltv' --output /tmp/anyFileNameYouLike
Then look in the file or any output for more detail about the error.
angelo454
Newcomer
Posts: 13
Joined: Wed Nov 11, 2020 2:33 am
United States of America

Re: Program Guide Updates Stopped Around Schedule Directs Renewal

Post by angelo454 »

I tried it as pi and mythtv and got the following errors.

pi@mythtv:~ $ tv_grab_zz_sdjson_sqlite --config-file '/home/mythtv/.mythtv/Fios.xmltv' --output /tmp/tmpfile Opening the local database
Initializing database /home/mythtv/.xmltv/SchedulesDirect.DB
Unable to create settings table in database /home/mythtv/.xmltv/SchedulesDirect.DB: attempt to write a readonly database

pi@mythtv:~ $ sudo su - mythtv
mythtv@mythtv:~ $ tv_grab_zz_sdjson_sqlite --config-file '/home/mythtv/.mythtv/Fios.xmltv' --output /tmp/tmpfile
Cannot write to /tmp/tmpfile.
mythtv@mythtv:~ $
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Program Guide Updates Stopped Around Schedule Directs Renewal

Post by bill6502 »

The 1st attempt created /tmp/tmpfile owned by 'pi' and the 2nd tried to write to it as user 'mythtv'
and failed. You can remove the file between attempts or just use another file name.

The 1st attempt also reports: Unable to create settings table in database /home/mythtv/.xmltv/SchedulesDirect.DB: attempt to write a readonly database
which makes sense as 'pi' can't probably can't write to the DB owned by 'mythtv'.
angelo454
Newcomer
Posts: 13
Joined: Wed Nov 11, 2020 2:33 am
United States of America

Re: Program Guide Updates Stopped Around Schedule Directs Renewal

Post by angelo454 »

I deleted tmpfile and re-ran and got the follow:

mythtv@mythtv:~ $ tv_grab_zz_sdjson_sqlite --config-file '/home/mythtv/.mythtv/Fios.xmltv' --output /tmp/tmpfile
Opening the local database
Obtaining authentication token for Schedules Direct
Unable to authenticate to Schedules Direct: Schedules Direct authorization token request code: 4003, message: Invalid username or token has expired.
mythtv@mythtv:~ $

I renewed my SD subscription before it ended and I did not change my username or password. Does something change when you renew? How do I update this?
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Program Guide Updates Stopped Around Schedule Directs Renewal

Post by jfabernathy »

I don't mess around when Schedules Direct stops working. It's harder to fix than just reinitialize it. I follow the XMLTV instructions for tv_grab_zz_sdjson_sqlite verbatim. https://www.mythtv.org/wiki/XMLTV#Setup ... son_sqlite which means in the mythtv-setup my Video Source is names SD and my grabber is the Multinational SDJSON one. Since Schedules Direct stores your previous Lineup choice you should not have to do that again when you reinitialize.

UPDATE: I forgot to mention, it's critical that you do all your XMLTV setup and maintenance as user 'mythtv'. So I do all my mythtv-setup and mythfrontend as user 'pi', but then I

Code: Select all

sudo su mythtv
cd ~/
...whatever XMLTV commands I need.
angelo454
Newcomer
Posts: 13
Joined: Wed Nov 11, 2020 2:33 am
United States of America

Re: Program Guide Updates Stopped Around Schedule Directs Renewal

Post by angelo454 »

Sorry, it took so long to reply. It has been hectic lately and this is the first time I had some time to work on this. I did not get far. My video source is Fios. I entered the following commands :

sudo su mythtv
cd ~
tv_grab_zz_sdjson_sqlite --configure --config-file $HOME/.mythtv/Fios.xmltv

tv_grab_zz_sdjson_sqlite uses a local database for downloaded EPG data. Please specify the database name created via tv_grab_zz_sdjson_sqlite --manage-lineups Database for Schedules Direct EPG: [/home/mythtv/.xmltv/SchedulesDirect.DB]

When I hit enter I got the same error I noted earlier in this post:

Unable to authenticate to Schedules Direct: Schedules Direct authorization token request code: 4003, message: Invalid username or token has expired.

I think I followed the steps correctly in the link posted. Did I miss something? What does this error mean and how can I fix it? Should I delete SchedulesDirect.DB?
Last edited by angelo454 on Sat Dec 18, 2021 3:46 am, edited 2 times in total.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Program Guide Updates Stopped Around Schedule Directs Renewal

Post by jfabernathy »

From my perspective, you are running the commands out of order. Like I said in the previous post I run them exactly like https://www.mythtv.org/wiki/XMLTV#Setup ... son_sqlite I don't change a thing.

Code: Select all

tv_grab_zz_sdjson_sqlite --manage-lineups --config-file $HOME/.mythtv/SD.xmltv
Replace SD (which I don't change) with the name of the source you had set up in MythTV Setup.

Enter your Schedules Direct user and password when prompted.
Select the Initialize/update the local database option.
Accept the default database name.
Accept the password hash question.
Add or delete lineups using the prompts.
Do not go into channel selection yet. Run this:

Code: Select all

tv_grab_zz_sdjson_sqlite --configure --config-file $HOME/.mythtv/SD.xmltv
Supply the database name you selected above.
Accept defaults for the prompted questions.
.. Keep following the instructions on that page.
angelo454
Newcomer
Posts: 13
Joined: Wed Nov 11, 2020 2:33 am
United States of America

Re: Program Guide Updates Stopped Around Schedule Directs Renewal

Post by angelo454 »

Sorry, I forgot to mention that I did start with that command. I received an error when I got to the 3rd command in the directions. The error was about my password not being correct. I tried deleting it and re-entering the password but that did not work. I ended up renaming SchedulesDirect.DB so I would have to start with a new DB. I ran 'tv_grab_zz_sdjson_sqlite --configure --manage-lineups' and 'tv_grab_zz_sdjson_sqlite --manage-lineups' because I did not have a database and then followed the directions in https://www.mythtv.org/wiki/XMLTV#Setup ... son_sqlite. I then ran mythfilldatabase and it's now working.
Post Reply