Unable to access MythTV Perl API - console error

Bug #220604 reported by pdragon on 2008-04-22
8
Affects Status Importance Assigned to Milestone
Mythbuntu
Low
Unassigned
mythtv (Ubuntu)
Undecided
rhpot1991

Bug Description

8.04 RC1

When I SSH into my MythTV box, I do get the encoder status and list of upcoming recordings, but then following that is this error:

Schedule Conflicts:
Unable to access MythTV Perl API. Try with --verbose to find out why.

Related branches

Does it work if you run it just as mythtv-status from command line?

Mario Limonciello
<email address hidden>
Sent from my iPod Touch

On Apr 22, 2008, at 8:16, pdragon <email address hidden> wrote:

> Public bug reported:
>
> 8.04 RC1
>
> When I SSH into my MythTV box, I do get the encoder status and list of
> upcoming recordings, but then following that is this error:
>
> Schedule Conflicts:
> Unable to access MythTV Perl API. Try with --verbose to find out why.
>
> ** Affects: mythbuntu
> Importance: Undecided
> Status: New
>
> --
> Unable to access MythTV Perl API - console error
> https://bugs.launchpad.net/bugs/220604
> You received this bug notification because you are a member of
> Mythbuntu, which is subscribed to Mythbuntu.

pdragon (pdragon) wrote :

It does not give the error back when I run it directly. I don't have any conflicts for the next two days. I do have a conflict on thursday, so I'll try running it manually tomorrow and see if the conflicts are returned.

pdragon (pdragon) wrote :

I can confirm this error is only happening on the SSH console login. When run directly from the console AFTER logging in, conflicts are shown properly. If I log out of the SSH session and back in again, only current Scheduled recordings are shown and the Conflicts section has the above error every time.

Doug (dscoular) wrote :

Hi,
I think this happens when the following cron job runs:

*/10 * * * * root [ -x /etc/init.d/mythtv-status ] && /etc/init.d/mythtv-status reload > /dev/null

Since it runs as root it fails to find ~/.mythtv/config.xml to find the backend.
It then attempts to use UPnP to find the backend. However, it fails to do this
and gives this rather misleading message about failing to load the MythTV
Perl API.

The reason you see it when you ssh it is that ssh is displaying the /etc/motd
which the cron job updates every 10 minutes. When you run it by hand it
runs under your userid which, generally has a ~/.mythtv/config.xml.

As a temporary workaround you could try the following:

sudo cp ~/.mythtv/config.xml /root/.mythtv

Within 10 minutes the cron job will run, update /etc/motd, and the error will
disappear.

The real bug is why the UPnP doesn't find the backend and that it mis-reports
the real issue.

Cheers,

Doug

Steve Wolfe (yoooder) wrote :

I am seeing this both during the login screen and when running mythtv-status manually. Following Doug's train of thought it makes sense, as my Mythbuntu box is running as backend-only and does not have config.xml for root or for any local user on the machine.

Andrew Ruthven (andrew-etc) wrote :

Hi,

I'm the mythtv-status author and only just found this thread.

The UPnP stuff is probably failing due to some of the required modules for the Perl API missing.

I think that MythBuntu could probably ship with a minial /root/.mythtv/config.xml that just points at localhost. That would resolve the issue that people are seeing.

mythtv-status doesn't report failing to find UPnP for most people, as it often isn't required...

Cheers!

Thomas Mashos (tgm4883) on 2008-08-09
Changed in mythbuntu:
importance: Undecided → Low
status: New → Confirmed
Grizzly (sven-witterstein) wrote :

Isn't it more elegant to do

sudo ln -s /home/<username>/.mythtv/config.xml /root/.mythtv/config.xml

provided, .mythtv exists in /root ?
so one would always get the contents of the actual in-use config.xml?

Mythexport gets bitten by this bug as well. I threw a blurb in the
wiki which has helped people to fix the problem but it would be nice
to see a real fix.
https://help.ubuntu.com/community/MythExport

The problem is that we need to know which user runs the frontend in
order to symlink to the config.

On Thu, Oct 2, 2008 at 1:05 PM, Grizzly <email address hidden> wrote:
> Isn't it more elegant to do
>
> sudo ln -s /home/<username>/.mythtv/config.xml /root/.mythtv/config.xml
>
> provided, .mythtv exists in /root ?
> so one would always get the contents of the actual in-use config.xml?
>
> --
> Unable to access MythTV Perl API - console error
> https://bugs.launchpad.net/bugs/220604
> You received this bug notification because you are a member of Mythbuntu
> Bug Team, which is subscribed to Mythbuntu.
>
> Status in Mythbuntu, Ubuntu derivative focused upon MythTV: Confirmed
>
> Bug description:
> 8.04 RC1
>
> When I SSH into my MythTV box, I do get the encoder status and list of upcoming recordings, but then following that is this error:
>
> Schedule Conflicts:
> Unable to access MythTV Perl API. Try with --verbose to find out why.
>

Grizzly (sven-witterstein) wrote :

Right, my box always runs the same user, so I did not consider it a problem to decide what user runs it!

finlay (finlay-moeraki) wrote :

As noted this problems occurs because the cron job runs as root and the root user doesn't have a properly configured /too/.mythtv/config.xml file. An alternative fix to the problem is to add the following to the /etc/default/mythtv-status file:

MYTHCONFDIR=/home/mythtv/.mythtv
export MYTHCONFDIR

Replace the /home/mythtv/.mythtv path with whatever path works on your system.

Changed in mythtv:
assignee: nobody → rhpot1991
status: New → Fix Committed
Changed in mythbuntu:
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mythtv - 0.21.0+fixes19961-0ubuntu1

---------------
mythtv (0.21.0+fixes19961-0ubuntu1) jaunty; urgency=low

  [ John Baab ]
  * Fixes missing config.xml issue (LP: #220604)

  [ Mario Limonciello ]
  * Check whether $USER_HOME exists in mythtv-backend init
    script before continuing on. Thanks Will Uther. (LP: #326702)
  * Update branch to release-0-21-fixes rev #19961. Pulls in
    fix related to channel scanning and setting number correctly. (LP: #323769)

 -- Mario Limonciello <email address hidden> Mon, 09 Feb 2009 08:49:29 -0600

Changed in mythtv:
status: Fix Committed → Fix Released
Changed in mythbuntu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers