<div dir="ltr">Each time mythfilldatabase runs, it creates a logfile in /var/log or elsewhere, find this logfile and see what is in it.<div><br></div><div>When things failed for me. it was because the mythbackend was launching it as a different user and using a different configuration file path. This error was seen in the logfiles. I believe in my case it was trying to find the config files in /etc or /var/lib or somewhere else, so copy the config files from the working user location to the new location it is expecting.</div><div><br></div><div>Find where mythfilldatabase logs and start from there.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 15, 2020 at 2:22 PM Matthew Daubenspeck <<a href="mailto:matt@oddprocess.org">matt@oddprocess.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, May 14, 2020 at 03:19:31PM +1200, Stephen Worthington wrote:<br>
> On Wed, 13 May 2020 14:25:05 -0400, you wrote:<br>
> <br>
> >Just recently updated to mythtv 31.0 on Arch Linux. I moved the<br>
> >SchedulesDirect setup to tv_grab_zz_sdjson and am having a very strange<br>
> >thing happen which I can't figure out.<br>
> ><br>
> >If I run mythfilldatabase manually at the commandline, everything works<br>
> >perfectly. If I add it to a cron job, it fails with the following error:<br>
> ><br>
> >tv_grab_zz_sdjson  --capabilities failed or we timed out waiting. You<br>
> >may need to upgrade your xmltv grabber<br>
> ><br>
> >Grabbing XMLTV data using tv_grab_zz_sdjson is not supported. You may<br>
> >need to upgrade to the latest version of XMLTV.<br>
> ><br>
> >Again, it works perfectly, as long as it isn't run from cron and I can't<br>
> >figure out why. Any suggestions?<br>
> <br>
> That sounds like the classic problem of cron running jobs as root, and<br>
> mythfilldatabase needs to be run from your mythtv user normally.  If<br>
> you are any good at systemd, you might like to consider running<br>
> mythfilldatabase as a systemd timer unit - systemd makes it easy to<br>
> run things as different users.<br>
> <br>
> Here is what I think a systemd setup to run mythfilldatabase as the<br>
> mythtv user should look like.  Note that I have not tested this:<br>
> <br>
> Create a file /etc/systemd/system/mythfilldatabase.service:<br>
> <br>
> [Unit]<br>
> Description=MythTV mythfilldatabase service.<br>
> Wants=mythtv-backend.service<br>
> After=mythtv-backend.service<br>
> <br>
> [Service]<br>
> User=mythtv<br>
> Group=mythtv<br>
> Type=simple<br>
> ExecStart=/usr/bin/mythfilldatabase<br>
> <br>
> [Install]<br>
> WantedBy=multi-user.target<br>
> <br>
> And then create a file /etc/systemd/system/mythfilldatabase.timer:<br>
> <br>
> [Unit]<br>
> Description=MythTV mythfilldatabase timer.<br>
> <br>
> [Timer]<br>
> OnCalendar=15:10:00<br>
> Persistent=true<br>
> <br>
> [Install]<br>
> WantedBy=timers.target<br>
> <br>
> Those files need to be chown root:root and chmod u=rw,g=r,u=r.<br>
> <br>
> Change the OnCalendar= setting to whenever you want mythfilldatabase<br>
> to be run.  You can have as many OnCalendar= lines as you like.<br>
> <br>
> The do these commands:<br>
> <br>
> sudo systemctl daemon-reload<br>
> sudo systemctl enable mythfilldatabase.service<br>
> sudo systemctl enable mythfilldatabase.timer<br>
> sudo systemctl start mythfilldatabase.timer<br>
> <br>
> If you want to manually run mythfilldatabase:<br>
> <br>
> sudo systemctl start mythfilldatabase.service<br>
> <br>
> If you only want mythfilldatabase to be run at the time specified, and<br>
> not at boot time if the timer was missed, then do not enable the<br>
> mythfilldatabase.service.<br>
> <br>
> <br>
> The way to run cron jobs as different users is to change your command<br>
> prompt to that user:<br>
> <br>
> su -l mythtv<br>
> <br>
> and then run:<br>
> <br>
> crontab -e<br>
> <br>
> That puts you in your default command line editor (nano in my case) on<br>
> the crontab file for that user.  Put your mythfilldatabase cron job<br>
> there, save and exit.  Remove the anacron job from /etc/cron.daily or<br>
> wherever you currently have it.<br>
> <br>
> Note that user cron jobs are cron jobs, not anacron jobs.  They are<br>
> run at the time specified only, and are not queued and run in sequence<br>
> with other jobs as cron.daily jobs are.  And they do not get run<br>
> automatically at boot if the time was missed due to the PC being shut<br>
> down.<br>
> <br>
> My mythfilldatabase runs from my user crontab, as I have been running<br>
> it there since well before Ubuntu changed to systemd.<br>
> _______________________________________________<br>
<br>
I'm about to throw something!<br>
<br>
I've tried multiple cron settings, like you suggested, and get the same<br>
results. My normal user runs mythtv-setup, and has run mythfilldatabase<br>
for years just fine, until the change to the SD JSON grabber. I tried<br>
the systemd method as well, it gets the same error:<br>
<br>
tv_grab_zz_sdjson  --capabilities failed or we timed out waiting...<br>
<br>
I've tried scripts running as other users, I've read and re-read both<br>
replies to my original message, as well as both wiki articles on xmltv<br>
and mythfilldatabase. Neither of them seem to make a difference.<br>
Everything runs fine when I run them manually, but as soon as cron is<br>
involved, it errors out and doesn't work.<br>
<br>
I copied all of the .mythtv and .xmltv directories to a newly created<br>
mythtv home directory, and again, it runs fine if I do so manually. But<br>
add it to cron, or your systemd suggestion, and it errors out the same<br>
way.<br>
<br>
I'm almost to the point of having another machine run a cronjob over ssh<br>
just to get it to work.<br>
<br>
I also tried sudo --set-home --login --user=mythtv ... but I guess I<br>
don't understand what the ... should be, as any command I use there does<br>
nothing and returns to the prompt.<br>
<br>
I'm stuck!<br>
<br>
<br>
_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org" target="_blank">mythtv-users@mythtv.org</a><br>
<a href="http://lists.mythtv.org/mailman/listinfo/mythtv-users" rel="noreferrer" target="_blank">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a><br>
<a href="http://wiki.mythtv.org/Mailing_List_etiquette" rel="noreferrer" target="_blank">http://wiki.mythtv.org/Mailing_List_etiquette</a><br>
MythTV Forums: <a href="https://forum.mythtv.org" rel="noreferrer" target="_blank">https://forum.mythtv.org</a><br>
</blockquote></div>