Mailing List Archive

XMLTV grabber returned error code 1
I am getting that error when I run mythfilldatabase. It is followed by:

Malformed XML file, missing </tv> element, at line 1, Premature end of
document.

What XML file is it talking about? The one returned by Schedules Direct?
How do I troubleshoot this?
Re: XMLTV grabber returned error code 1 [ In reply to ]
On Tue, 10 May 2022 19:52:50 -0700, you wrote:

>I am getting that error when I run mythfilldatabase. It is followed by:
>
> Malformed XML file, missing </tv> element, at line 1, Premature end of
>document.
>
>What XML file is it talking about? The one returned by Schedules Direct?
>How do I troubleshoot this?

That error message normally means that the .xml file is empty or just
has the initial header lines - the EPG download failed. I am not sure
where the Schedules Direct grabbers put the file, but if it has not
been automatically deleted, you should be able to find it, if you have
the mlocate package installed. Run "sudo updatedb" to scan all drives
for new files, and when that finishes, run "locate *.xml" and you
should see it listed somewhere.
_______________________________________________
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
Re: XMLTV grabber returned error code 1 [ In reply to ]
On Wed, May 11, 2022 at 2:53 AM DryHeat122 <dryheat122@gmail.com> wrote:
>
> I am getting that error when I run mythfilldatabase. It is followed by:
>
> Malformed XML file, missing </tv> element, at line 1, Premature end of document.
>
> What XML file is it talking about? The one returned by Schedules Direct? How do I troubleshoot this?

The one that mythfilldatabase is trying to load,
which is (typically) generated by your grabber,
unless an error occurs.

There are many possible reasons for a grabber
to fail (the most common are a filesystem (/tmp)
being out of space, and that one is running it
by a userid (i.e. the backend user) who does not
have permissions on the file(s) that were created
by the userid one used (i.e. not the same userid
as the backend userid) to configure the grabber
initially).

To obtain additional information from the grabber
itself, one can add in the flags "--verbose general,xmltv"
to the invocation of mythfilldatabase and mythtv
will log the grabbers output (if any) that may
provide additional guidance.
_______________________________________________
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
Re: XMLTV grabber returned error code 1 [ In reply to ]
On Wed, May 11, 2022 at 10:28 AM Gary Buhrmaster <gary.buhrmaster@gmail.com>
wrote:

> On Wed, May 11, 2022 at 2:53 AM DryHeat122 <dryheat122@gmail.com> wrote:
> >
> > I am getting that error when I run mythfilldatabase. It is followed by:
> >
> > Malformed XML file, missing </tv> element, at line 1, Premature end
> of document.
> >
> > What XML file is it talking about? The one returned by Schedules Direct?
> How do I troubleshoot this?
>
> The one that mythfilldatabase is trying to load,
> which is (typically) generated by your grabber,
> unless an error occurs.
>
> There are many possible reasons for a grabber
> to fail (the most common are a filesystem (/tmp)
> being out of space, and that one is running it
> by a userid (i.e. the backend user) who does not
> have permissions on the file(s) that were created
> by the userid one used (i.e. not the same userid
> as the backend userid) to configure the grabber
> initially).
>
> To obtain additional information from the grabber
> itself, one can add in the flags "--verbose general,xmltv"
> to the invocation of mythfilldatabase and mythtv
> will log the grabbers output (if any) that may
> provide additional guidance.
>

Thanks Stephen and Gary for the replies. I think I have figured out the
problem. I have grabber setups under both /home/mythtv and /home/steve.
Don't ask me how I managed that.

After running Gary's channel fixer script, MythTV is using the xmltv under
/home/steve. When I ran mythfilldatabase as user steve, it grabbed shows
and restored my program guide and upcoming recordings. However, when it
MythTV runs mythfilldatabase nightly (I think it is) it does so as user
mythtv, and encounters these errors. I had a look at the grabber code and
can't find anywhere it actually creates an .xml file, nor a line where the
reported error message is generated.

So it seems the options are to (1) tell myth to run mythfilldatabase under
user steve, but I don't know if that can be done or if so how, (2) re-run
Gary's script pointing at the /home/mythtv (which I'm reluctant to do for
fear of breaking things again), or (3) do the expedient thing and cheat by
writing a cron job to run mythfilldatabase under steve and just let the
job under myth continue to fail.
Re: XMLTV grabber returned error code 1 [ In reply to ]
On 5/11/22 12:59, DryHeat122 wrote:
>
> On Wed, May 11, 2022 at 10:28 AM Gary Buhrmaster <gary.buhrmaster@gmail.com <mailto:gary.buhrmaster@gmail.com>> wrote:
>
> On Wed, May 11, 2022 at 2:53 AM DryHeat122 <dryheat122@gmail.com <mailto:dryheat122@gmail.com>> wrote:
> >
> > I am getting that error when I run mythfilldatabase. It is followed by:
> >
> >      Malformed XML file, missing </tv> element, at line 1, Premature end of document.
> >
> > What XML file is it talking about? The one returned by Schedules Direct? How do I troubleshoot this?
>
> The one that mythfilldatabase is trying to load,
> which is (typically) generated by your grabber,
> unless an error occurs.
>
> There are many possible reasons for a grabber
> to fail (the most common are a filesystem (/tmp)
> being out of space, and that one is running it
> by a userid (i.e. the backend user) who does not
> have permissions on the file(s) that were created
> by the userid one used (i.e. not the same userid
> as the backend userid) to configure the grabber
> initially).
>
> To obtain additional information from the grabber
> itself, one can add in the flags "--verbose general,xmltv"
> to the invocation of mythfilldatabase and mythtv
> will log the grabbers output (if any) that may
> provide additional guidance.
>
>
> Thanks Stephen and Gary for the replies. I think I have figured out the problem. I have grabber setups under both /home/mythtv and /home/steve.
> Don't ask me how I managed that.
>
> After running Gary's channel fixer script, MythTV is using the xmltv under /home/steve. When I ran mythfilldatabase as user steve, it grabbed
> shows and restored my program guide and upcoming recordings. However, when it MythTV runs mythfilldatabase nightly (I think it is) it does so as
> user mythtv, and encounters these errors.  I had a look at the grabber code and can't find anywhere it actually creates an .xml file, nor a line
> where the reported error message is generated.
>
> So it seems the options are to (1) tell myth to run mythfilldatabase under user steve, but I don't know if that can be done or if so how, (2)
> re-run Gary's script pointing at the /home/mythtv (which I'm reluctant to do for fear of breaking things again), or (3) do the expedient thing
> and cheat by writing a cron job to run mythfilldatabase under steve and  just let the job under myth continue to fail.

The intent is that both the backend's run of mythfilldatabase and a user's run are both
done as user mythtv. The Wiki encourages running the setup commands as user mythtv.

This ASCII art works, for me:

https://forum.mythtv.org/viewtopic.php?f=36&t=3480&start=15#p19508

Note, I'm a tv_grab_zz_sdjson_sqlite user.

My mfdbrun command is my alias and this is in my .bashrc:

alias mfdbrun='sudo --login --user=mythtv mythfilldatabase --verbose=xmltv'

The only issue I've heard of is that some users don't want to allow user mythtv
to login.

I understand redoing a working setup may appear risky. I'd just COPY the files under your
user to the same places in ~mythtv/.mythtv. Make all related files user:group mythtv
and the <source>.xmltv file(s) points to mythtv's copy of the SQLite DB. Test that
the 'normal' MFDB run by the backend works as does the mfdbrun above (or whatever
you'd like to name it.) I recall that the .xmltv directory must also be mythtv:mythtv

When both tests pass, delete the newly created files in your user's .mythtv directory
(or hide them is a secret place and delete them later.)

--
Bill
_______________________________________________
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
Re: XMLTV grabber returned error code 1 [ In reply to ]
On Wed, May 11, 2022 at 11:48 AM Bill Meek <keemllib@gmail.com> wrote:

> On 5/11/22 12:59, DryHeat122 wrote:
>
> I understand redoing a working setup may appear risky. I'd just COPY the
> files under your
> user to the same places in ~mythtv/.mythtv. Make all related files
> user:group mythtv
> and the <source>.xmltv file(s) points to mythtv's copy of the SQLite DB.
> Test that
> the 'normal' MFDB run by the backend works as does the mfdbrun above (or
> whatever
> you'd like to name it.) I recall that the .xmltv directory must also be
> mythtv:mythtv
>

I thought about that, but I worry that the frontend may reference these
files and lose track of them if I change the directory.
Re: XMLTV grabber returned error code 1 [ In reply to ]
On 5/11/22 16:39, DryHeat122 wrote:
>
>
> On Wed, May 11, 2022 at 11:48 AM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com>> wrote:
>
> On 5/11/22 12:59, DryHeat122 wrote:
>
> I understand redoing a working setup may appear risky. I'd just COPY the files under your
> user to the same places in ~mythtv/.mythtv. Make all related files user:group mythtv
> and the <source>.xmltv file(s) points to mythtv's copy of the SQLite DB. Test that
> the 'normal' MFDB run by the backend works as does the mfdbrun above (or whatever
> you'd like to name it.) I recall that the .xmltv directory must also be mythtv:mythtv
>
>
> I thought about that, but I worry that the frontend may reference these files and lose track of them if I change the directory.

The files we're discussing are mainly used at mythfilldatabase run time.
I'm ignoring the setup part of the puzzle.

The files could vanish and the frontend wouldn't know about it until
your listings ran out of data ;).


--
Bill
_______________________________________________
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
Re: XMLTV grabber returned error code 1 [ In reply to ]
On Wed, May 11, 2022, 4:43 PM Bill Meek <keemllib@gmail.com> wrote:

> On 5/11/22 16:39, DryHeat122 wrote:
> >
> >
> > On Wed, May 11, 2022 at 11:48 AM Bill Meek <keemllib@gmail.com <mailto:
> keemllib@gmail.com>> wrote:
> >
> > On 5/11/22 12:59, DryHeat122 wrote:
> >
> > I understand redoing a working setup may appear risky. I'd just COPY
> the files under your
> > user to the same places in ~mythtv/.mythtv. Make all related files
> user:group mythtv
> > and the <source>.xmltv file(s) points to mythtv's copy of the SQLite
> DB. Test that
> > the 'normal' MFDB run by the backend works as does the mfdbrun above
> (or whatever
> > you'd like to name it.) I recall that the .xmltv directory must also
> be mythtv:mythtv
> >
> >
> > I thought about that, but I worry that the frontend may reference these
> files and lose track of them if I change the directory.
>
> The files we're discussing are mainly used at mythfilldatabase run time.
> I'm ignoring the setup part of the puzzle.
>
> The files could vanish and the frontend wouldn't know about it until
> your listings ran out of data ;).
>

So let me ask this: What is it that normally runs mythfilldatabase? Does
the backend do it, or is it a cron job, or...

My thinking is that if I can disable that I can just substitute my own cron
job to run mythfilldatabase under my user, and Bob's your uncle.

>
Re: XMLTV grabber returned error code 1 [ In reply to ]
On 5/16/22 23:13, DryHeat122 wrote:
>
>
> On Wed, May 11, 2022, 4:43 PM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com>> wrote:
>
> On 5/11/22 16:39, DryHeat122 wrote:
> >
> >
> > On Wed, May 11, 2022 at 11:48 AM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com> <mailto:keemllib@gmail.com
> <mailto:keemllib@gmail.com>>> wrote:
> >
> >     On 5/11/22 12:59, DryHeat122 wrote:
> >
> >     I understand redoing a working setup may appear risky. I'd just COPY the files under your
> >     user to the same places in ~mythtv/.mythtv. Make all related files user:group mythtv
> >     and the <source>.xmltv file(s) points to mythtv's copy of the SQLite DB. Test that
> >     the 'normal' MFDB run by the backend works as does the mfdbrun above (or whatever
> >     you'd like to name it.) I recall that the .xmltv directory must also be mythtv:mythtv
> >
> >
> > I thought about that, but I worry that the frontend may reference these files and lose track of them if I change the directory.
>
> The files we're discussing are mainly used at mythfilldatabase run time.
> I'm ignoring the setup part of the puzzle.
>
> The files could vanish and the frontend wouldn't know about it until
> your listings ran out of data ;).
>
>
> So let me ask this: What is it that normally runs mythfilldatabase? Does the backend do it, or is it a cron job, or...
>
> My thinking is that if I can disable that I can just substitute my own cron job to run mythfilldatabase under my user, and Bob's your uncle.

The backend runs MFDB if enabled (in mythtv-setup). That's what I use on my production host.
Some users like cron, others use a systemd .timer and .service.

Whatever you select, be sure the user that runs MFDB automatically and the user that runs
it casually (from the command line) are the same. Both need to access the *same* set of files
seen in the ASCII art link posted earlier. Some choose to 'solve' issues with symbolic or
even hard links. That's just adding complexity and another thing to break IMNSHO.

--
Bill
_______________________________________________
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
Re: XMLTV grabber returned error code 1 [ In reply to ]
On Mon, 16 May 2022 23:54:51 -0500, you wrote:

>On 5/16/22 23:13, DryHeat122 wrote:
>>
>>
>> On Wed, May 11, 2022, 4:43 PM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com>> wrote:
>>
>> On 5/11/22 16:39, DryHeat122 wrote:
>> >
>> >
>> > On Wed, May 11, 2022 at 11:48 AM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com> <mailto:keemllib@gmail.com
>> <mailto:keemllib@gmail.com>>> wrote:
>> >
>> >? ? ?On 5/11/22 12:59, DryHeat122 wrote:
>> >
>> >? ? ?I understand redoing a working setup may appear risky. I'd just COPY the files under your
>> >? ? ?user to the same places in ~mythtv/.mythtv. Make all related files user:group mythtv
>> >? ? ?and the <source>.xmltv file(s) points to mythtv's copy of the SQLite DB. Test that
>> >? ? ?the 'normal' MFDB run by the backend works as does the mfdbrun above (or whatever
>> >? ? ?you'd like to name it.) I recall that the .xmltv directory must also be mythtv:mythtv
>> >
>> >
>> > I thought about that, but I worry that the frontend may reference these files and lose track of them if I change the directory.
>>
>> The files we're discussing are mainly used at mythfilldatabase run time.
>> I'm ignoring the setup part of the puzzle.
>>
>> The files could vanish and the frontend wouldn't know about it until
>> your listings ran out of data ;).
>>
>>
>> So let me ask this: What is it that normally runs mythfilldatabase? Does the backend do it, or is it a cron job, or...
>>
>> My thinking is that if I can disable that I can just substitute my own cron job to run mythfilldatabase under my user, and Bob's your uncle.
>
>The backend runs MFDB if enabled (in mythtv-setup). That's what I use on my production host.
>Some users like cron, others use a systemd .timer and .service.
>
>Whatever you select, be sure the user that runs MFDB automatically and the user that runs
>it casually (from the command line) are the same. Both need to access the *same* set of files
>seen in the ASCII art link posted earlier. Some choose to 'solve' issues with symbolic or
>even hard links. That's just adding complexity and another thing to break IMNSHO.

mythtv-setup > 1. General > Programme Schedule Downloading Options
_______________________________________________
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