[SOLVED] Metadata lookup fails in 0.29 on 16.04

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

User avatar
keepitsimpleengineer
Junior
Posts: 18
Joined: Fri Oct 03, 2014 9:53 pm
Location: Central California, U.S.A.
Contact:
United States of America

[SOLVED] Metadata lookup fails in 0.29 on 16.04

Post by keepitsimpleengineer » Tue Sep 12, 2017 11:29 pm

I upgraded to 16.04 from 14.04.3 then a week later to [myth]buntu 0.29 from 0.28.

I have verified python-future, python-requests, python-requests-cache and urlllib3 are installed and current.

Still mythmetadatalookup errors out with status 128.

Last log entry in mythmetadatalookup.log was for 0.28 and last metadata entry in mythbackend.log was for 0.28

At a loss as to how to debug... .. .
Last edited by keepitsimpleengineer on Sun Sep 17, 2017 7:35 pm, edited 1 time in total.

User avatar
paulh
Developer
Posts: 429
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Metadata lookup failsin 0.29 on 16.04

Post by paulh » Wed Sep 13, 2017 8:07 am

You could try running the grabber from the command line and see if you get any errors.

Something like:-

Code: Select all

/usr/share/mythtv/metadata/Television/ttvdb.py -B Sanctuary
I got an error about having the wrong version of the tvdb module installed which was caused by having 2 copies installed in different locations so may be worth doing a

Code: Select all

locate tvdb_api.py
to see if you have an old copy lying around.

User avatar
keepitsimpleengineer
Junior
Posts: 18
Joined: Fri Oct 03, 2014 9:53 pm
Location: Central California, U.S.A.
Contact:
United States of America

Re: Metadata lookup failsin 0.29 on 16.04

Post by keepitsimpleengineer » Wed Sep 13, 2017 10:33 pm

paulh wrote:You could try running the grabber from the command line and see if you get any errors.

Something like:-

Code: Select all

/usr/share/mythtv/metadata/Television/ttvdb.py -B Sanctuary
I got an error about having the wrong version of the tvdb module installed which was caused by having 2 copies installed in different locations so may be worth doing a

Code: Select all

locate tvdb_api.py
to see if you have an old copy lying around.
Aha, the game is afoot..!

Code: Select all

root@KISE-055:~# locate tvdb_api.py
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.pyc
root@KISE-055:~# cd /usr/lib/python2.7/dist-packages/MythTV/ttvdb/
root@KISE-055:/usr/lib/python2.7/dist-packages/MythTV/ttvdb# ls -lat | grep tvdb_api
-rw-r--r-- 1 root root 40272 Sep 11 07:26 tvdb_api.pyc
-rw-rw-r-- 1 root root 42367 Aug 27 18:11 tvdb_api.py
then

Code: Select all

root@KISE-055:/usr/lib/python2.7/dist-packages/MythTV/ttvdb# mv tvdb_api.py tvdb_api.py.old
root@KISE-055:/usr/lib/python2.7/dist-packages/MythTV/ttvdb# mv tvdb_api.pyc tvdb_api.py
root@KISE-055:/usr/lib/python2.7/dist-packages/MythTV/ttvdb# chmod +x /usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py
root@KISE-055:/usr/lib/python2.7/dist-packages/MythTV/ttvdb# ls -lat | grep tvdb_api
-rwxr-xr-x 1 root root 40272 Sep 11 07:26 tvdb_api.py
-rw-rw-r-- 1 root root 42367 Aug 27 18:11 tvdb_api.py.old

root@KISE-055:/usr/lib/python2.7/dist-packages/MythTV/ttvdb#cd /
root@KISE-055:~# /usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py -B Superstore
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py: line 1: $'\003\363\r': command not found
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py: line 2: $'\247m\243Yc\003@s\344\002dd\001lZdd\001l\001Z\001dd\001l\002Z\002d\002d\003l\003m\004Z\004\001d\002d\004l\003m\005Z\005\001dd\001l\006Z\006dd\001l\aZ\add\001l\bZ\bdd\001l': command not found
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py: line 3: Z: command not found
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py: line 4: $'dd\001l\vZ\vdd\001l\fZ\fd\005Z\rd\006Z\016ej\017d\a\031d\bk\002Z\020e\020r\326e\021Z\022dd': command not found
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py: line 5: syntax error near unexpected token `('
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py: line 5: `\ufffdZ d
                                                                        e!fd
e"fd\ufffd\ufffdYZ#de"fd\ufffd\ufffdYZ$de"fd\ufffd\ufffdYZ%de"fd\ufffd\ufffdYZ&de"fd\ufffd\ufffdYZ'de"fd\ufffd\ufffdYZ(de"fd\ufffd\ufffdYZ)de"fd\ufffd\ufffdYZ*de"fd\ufffd\ufffdYZ+de,fd \ufffd\ufffdYZ-d!e-fd"\ufffd\ufffdYZ.d#e/fd$\ufffd\ufffdYZ0d%e/fd&\ufffd\ufffdYZ1d'e/fd(\ufffd\ufffdYZ2d)e/fd*\ufffd\ufffdYZ3d+e4fd,\ufffd\ufffdYZ5d-e/fd.\ufffd\ufffdYZ6d/fd0\ufffd\ufffdYZ7d1\ufffdZ8e9d2kr\ufffde8\ufffdndS(3i\ufffd\ufffd\ufffd\ufffdNi(trequests_cache_cotjd\ufffdS(Ntvdb_api(tloggingtdbgetLogger(((s9/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.pytlog5sttvdb_exceptioncBseZdZRS(s(Any exception generated by tvdb_api'
root@KISE-055:~# 
OK some something changed. In any case, running 'Look up metadata' via mythfrontend and checking with mythweb, still failing with exit status 128. and nothing in mythmetadatalookup.log
Thanks pauth

User avatar
bill6502
Developer
Posts: 1281
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Metadata lookup fails in 0.29 on 16.04

Post by bill6502 » Wed Sep 13, 2017 11:19 pm

Hi,

The .pyc file is compiled from the .py file, and it loads faster.
You execute the .py file and if .pyc exists, it will be loaded
and run. Running the .pyc directly gives the failure you
spotted above.

I'd restore the .py file and rename the .pyc to .off file, then run
ttvdb.py again. If that fails, then:

Can we see the output of this (here's mine):

Code: Select all

dpkg -l python-future python-requests python-requests-cache python-urllib3
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name               Version        Architecture   Description
+++-==================-==============-==============-==========================================
ii  python-future      0.15.2-4ubuntu all            single-source support for Python 3 and 2 -
ii  python-requests    2.18.1-1       all            elegant and simple HTTP library for Python
ii  python-requests-ca 0.4.13-1       all            persistent cache for requests library
ii  python-urllib3     1.21.1-1       all            HTTP library with thread-safe connection p
And throw in:

Code: Select all

/usr/share/mythtv/metadata/Television/ttvdb.py -v

User avatar
keepitsimpleengineer
Junior
Posts: 18
Joined: Fri Oct 03, 2014 9:53 pm
Location: Central California, U.S.A.
Contact:
United States of America

Re: Metadata lookup fails in 0.29 on 16.04

Post by keepitsimpleengineer » Thu Sep 14, 2017 6:00 pm

bill6502 wrote:Hi,
...
I'd restore the .py file and rename the .pyc to .off file, then run
ttvdb.py again. If that fails, then:

Can we see the output of this (here's mine):

Code: Select all

dpkg -l python-future python-requests python-requests-cache python-urllib3
...
/usr/share/mythtv/metadata/Television/ttvdb.py -v
...onward

Code: Select all

root@KISE-055:/usr/lib/python2.7/dist-packages/MythTV/ttvdb# ls -l | grep tvdb_api
-rw-rw-r-- 1 root root 42367 Aug 27 18:11 tvdb_api.py
-rw-r--r-- 1 root root 40272 Sep 14 09:28 tvdb_api.pyc
-rw-rw-r-- 1 root root 42367 Aug 27 18:11 tvdb_api.py.old
root@KISE-055:/usr/lib/python2.7/dist-packages/MythTV/ttvdb# mv tvdb_api.pyc tvdb_api.pyc.off
root@KISE-055:/usr/lib/python2.7/dist-packages/MythTV/ttvdb# cd /
root@KISE-055:/# /usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py -B Superstore
-bash: /usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py: Permission denied
root@KISE-055:/# chmod +x /usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py
root@KISE-055:/# ls -l /usr/lib/python2.7/dist-packages/MythTV/ttvdb/ | grep tvdb_api
-rwxrwxr-x 1 root root 42367 Aug 27 18:11 tvdb_api.py
-rw-r--r-- 1 root root 40272 Sep 14 09:28 tvdb_api.pyc.off
-rw-rw-r-- 1 root root 42367 Aug 27 18:11 tvdb_api.py.old
root@KISE-055:/# /usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py -B Superstore
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py", line 10, in <module>
    from . import requests_cache_compatability
ValueError: Attempted relative import in non-package
root@KISE-055:/# ls -l /usr/lib/python2.7/dist-packages/MythTV/ttvdb/ | grep tvdb_api
-rwxrwxr-x 1 root root 42367 Aug 27 18:11 tvdb_api.py
-rw-r--r-- 1 root root 40272 Sep 14 09:28 tvdb_api.pyc.off
-rw-rw-r-- 1 root root 42367 Aug 27 18:11 tvdb_api.py.old
root@KISE-055:/# dpkg -l python-future python-requests python-requests-cache python-urllib3
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                           Version              Architecture         Description
+++-==============================-====================-====================-==================================================================
ii  python-future                  0.15.2-1             all                  single-source support for Python 3 and 2 - Python 2.x
ii  python-requests                2.9.1-3              all                  elegant and simple HTTP library for Python2, built for human being
ii  python-requests-cache          0.4.10-1             all                  persistent cache for requests library
ii  python-urllib3                 1.13.1-2ubuntu0.16.0 all                  HTTP library with thread-safe connection pooling for Python
root@KISE-055:/# /usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py -v
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py", line 10, in <module>
    from . import requests_cache_compatability
ValueError: Attempted relative import in non-package
root@KISE-055:/# /usr/share/mythtv/metadata/Television/ttvdb.py -v
<grabber>
  <name>TheTVDB.com</name>
  <author>R.D.Vaughan</author>
  <thumbnail>ttvdb.png</thumbnail>
  <command>ttvdb.py</command>
  <type>television</type>
  <description>Search and metadata downloads for thetvdb.com</description>
  <version>2.0.0</version>
</grabber>
root@KISE-055:/# /usr/share/mythtv/metadata/Television/ttvdb.py -B Superstore
Banner:http://thetvdb.com/banners/graphical/295648-g.jpg,http://thetvdb.com/banners/graphical/295648-g2.jpg,http://thetvdb.com/banners/graphical/295648-g3.jpg
Yikes...
This works:

Code: Select all

root@KISE-055:/# /usr/share/mythtv/metadata/Television/ttvdb.py -B Superstore
but this doesn't:

Code: Select all

root@KISE-055:/# /usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py -B Superstore
OK I blew it. It's ttvdb.py vice tvdb.py vice
and

Code: Select all

root@KISE-055:/# ls -la /usr/share/mythtv/metadata/Television/
total 140
drwxr-xr-x 2 root root   4096 Sep 14 09:27 .
drwxr-xr-x 5 root root   4096 Sep  2 14:30 ..
-rwxr-xr-x 1 root root 127081 Sep 13 23:42 ttvdb.py
-rw-r--r-- 1 root root    248 Sep 13 23:42 tvdb_test.conf
Then the working ttvdb.py does not explain the error in Lookup metadata..?
I presume the differences in dpkg -l output comes from different releases..?
Name Version
============
python-future 0.15.2-1
python-requests 2.9.1-3
python-requests-cache 0.4.10-1
python-urllib3 1.13.1-2ubuntu0.16.0

User avatar
bill6502
Developer
Posts: 1281
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Metadata lookup failsin 0.29 on 16.04

Post by bill6502 » Thu Sep 14, 2017 8:57 pm

Error code 128 fires when ttvdb.py -v fails, or if it's trying to do a lookup on a non-existent
jobid. Seeing the command line used by the mythmetadatalookup would nail this down.

If the backend is running, then type: mythbackend --setverbose system
or start the backend with the -v system switch. That will cause any
system call made by the backend and from programs it calls to print the
command line in the log.

You should see a line similar to this in the mythmetadatalookup.log:

Code: Select all

... Running Grabber: /usr/local/share/mythtv/metadata/Television/ttvdb.py -l en -a US -C 315820
It sounds like when the backend calls mythmetadatalookup that it's running
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py. But the log will
prove that.

User avatar
keepitsimpleengineer
Junior
Posts: 18
Joined: Fri Oct 03, 2014 9:53 pm
Location: Central California, U.S.A.
Contact:
United States of America

Re: Metadata lookup failsin 0.29 on 16.04

Post by keepitsimpleengineer » Thu Sep 14, 2017 10:19 pm

bill6502 wrote:Error code 128 fires when ttvdb.py -v fails, or if it's trying to do a lookup on a non-existent
jobid. Seeing the command line used by the mythmetadatalookup would nail this down.

If the backend is running, then type: mythbackend --setverbose system
or start the backend with the -v system switch. That will cause any
system call made by the backend and from programs it calls to print the
command line in the log.

You should see a line similar to this in the mythmetadatalookup.log:

Code: Select all

... Running Grabber: /usr/local/share/mythtv/metadata/Television/ttvdb.py -l en -a US -C 315820
It sounds like when the backend calls mythmetadatalookup that it's running
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py. But the log will
prove that.
Ok:
as root: mythbackend --setverbose system failed , unable to login to database.
then: killed mythbackend
as root: mythbackend -v
then: verified parameters correct & Using localhost value of KISE-055 & Using configuration directory = /root/.mythtv
then: got 'Cannot login to database'
then as user ljohnson: mythbackend -v and backend started
then: tested metadata lookup and it ran successfully but no entries in mythmetadatalookup.log
then: rebooted KISE-055 and again test metadata lookup and this time it failed

Something not working is startup...?
From journalctl --boot | grep mythbackend (truncate to last attempt after waiting for mariadb to start

Code: Select all

Sep 14 14:55:26 KISE-055 mythbackend[2835]: mythbackend[2835]: C CoreContext main.cpp:132 (main) Failed to init MythContext.
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: C thread_unknown mythcommandlineparser.cpp:2619 (ConfigureLogging) mythbackend version: fixes/29 [v29.0-28-g5dce69f] www.mythtv.org
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: C thread_unknown mythcommandlineparser.cpp:2621 (ConfigureLogging) Qt version: compile: 5.5.1, runtime: 5.5.1
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: N thread_unknown mythcommandlineparser.cpp:2623 (ConfigureLogging) Enabled verbose msgs:  general
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: N thread_unknown logging.cpp:927 (logStart) Setting Log Level to LOG_INFO
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I Logger logging.cpp:313 (run) Added logging to the console
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Interrupt handler
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Terminated handler
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Segmentation fault handler
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Aborted handler
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Bus error handler
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Floating point exception handler
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Illegal instruction handler
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Real-time signal 0 handler
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Hangup handler
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: N thread_unknown mythdirs.cpp:195 (InitializeMythDirs) Using runtime prefix = /usr
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: N thread_unknown mythdirs.cpp:197 (InitializeMythDirs) Using configuration directory = /home/mythtv/.mythtv
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcorecontext.cpp:271 (Init) Assumed character encoding: en_US.UTF-8
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:607 (LoadDatabaseSettings) Using localhost value of 192.168.0.55
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 0, status dbAwake
Sep 14 14:55:27 KISE-055 mythbackend[2876]: mythbackend[2876]: I LogForward loggingserver.cpp:302 (SyslogLogger) Added syslogging
Sep 14 14:55:28 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 1, status dbAwake
Sep 14 14:55:33 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 2, status dbAwake
Sep 14 14:55:38 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 3, status dbAwake
Sep 14 14:55:43 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 4, status dbAwake
Sep 14 14:55:48 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 5, status dbAwake
Sep 14 14:55:53 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 6, status dbAwake
Sep 14 14:55:58 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 7, status dbAwake
Sep 14 14:56:03 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 8, status dbAwake
Sep 14 14:56:08 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 9, status dbAwake
Sep 14 14:56:13 KISE-055 mythbackend[2876]: mythbackend[2876]: I CoreContext mythcontext.cpp:849 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 10, status dbAwake
Then looking at /home/mythtv/.mythtv

Code: Select all

root@KISE-055:~# cd /home/mythtv/.mythtv
root@KISE-055:/home/mythtv/.mythtv# ls
3rdParty  backuprc  cache  Cache-mythbackend-KISE-055  Cache-mythfilldatabase-KISE-055  Cache-mythmetadatalookup-KISE-055  channels  config.xml  HardwareProfile  mysql.txt  pytmdb3.cache  themes  tmp
root@KISE-055:/home/mythtv/.mythtv# cat config.xml
<Configuration>
  <UPnP>
    <MythFrontend>
      <DefaultBackend>
        <!--
Set the <LocalHostName> hostname override below only if you want to use
something other than the machine's real hostname for identifying settings
in the database.  This is useful if your hostname changes often, as
otherwise you'll need to reconfigure mythtv every time.

NO TWO HOSTS MAY USE THE SAME VALUE
-->
      </DefaultBackend>
    </MythFrontend>
  </UPnP>
  <LocalHostName>192.168.0.55</LocalHostName>
  <Database>
    <PingHost>1</PingHost>
    <Host>localhost</Host>
    <UserName>mythtv</UserName>
    <Password>~~~~~~</Password>
    <DatabaseName>mythconverg</DatabaseName>
    <Port>3306</Port>
  </Database>
  <WakeOnLAN>
    <Enabled>0</Enabled>
    <SQLReconnectWaitTime>0</SQLReconnectWaitTime>
    <SQLConnectRetry>5</SQLConnectRetry>
    <Command>echo 'WOLsqlServerCommand not set'</Command>
  </WakeOnLAN>
</Configuration>
So I don't see anything wrong here but I have more than ample ignorance... :roll:

could th culprit lie here...

Code: Select all

root@KISE-055:/# cat /etc/hosts
127.0.0.1 localhost
127.0.0.1 KISE-055
192.168.0.55 KISE-055.kise
UPDATE: mythbackend runs as user mythtv when started by systemd, not as user ljohnson when I started it :shock:

User avatar
keepitsimpleengineer
Junior
Posts: 18
Joined: Fri Oct 03, 2014 9:53 pm
Location: Central California, U.S.A.
Contact:
United States of America

Re: Metadata lookup failsin 0.29 on 16.04

Post by keepitsimpleengineer » Thu Sep 14, 2017 11:02 pm

So I changed the user in /etc/systemd/system/mythbackend.service to ljohnson from mythtv
then: rebooted and metadata lookup failed but produced error in /usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py and a subsequent Launchpad bug report #1717381.

It also produced an additional error in tmdb3.py as in a prior bug report #1716725

At this point it might be worthwhile to mote that this backend was first established seven years ago under I believe Ubuntu 10.~

User avatar
bill6502
Developer
Posts: 1281
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Metadata lookup fails in 0.29 on 16.04

Post by bill6502 » Thu Sep 14, 2017 11:32 pm

Some comments:

journalctl --unit mythtv-backend will get what you want if you need it in the future

The proper way to control the backend is with systemctl. You should never need to
kill it (pulling the rug from under init isn't nice ;).) sudo systemctl start mythtv-backend
is what you want. Leave the user as mythtv. Make sure the config.xml files for yourself
and mythtv are the same. I've seen Mythbuntu setup symbolic links from those users
to something like /etc/mythtv (I may be wrong about that path, don't use mythbuntu
myself.)

Those links have been known to get broken and when users have different results when
running as their own user vs. user mythtv, I look there 1st. See this for details:
https://www.mythtv.org/wiki/Config.xml (especially the diff ~mythtv/.mythtv/config.xml ~/.mythtv/config.xml
suggestion.)

On your backend, the <Host> should be localhost because sockets are used rather
than the network.

Run mythbackend --setverbose as yourself (once config.xml is verified.) It works
great, I promise. Should never be a need /root/.mythtv (I don't have one.)

User avatar
keepitsimpleengineer
Junior
Posts: 18
Joined: Fri Oct 03, 2014 9:53 pm
Location: Central California, U.S.A.
Contact:
United States of America

Re: Metadata lookup fails in 0.29 on 16.04

Post by keepitsimpleengineer » Fri Sep 15, 2017 7:48 pm

Thanks :) for pointing me to https://www.mythtv.org/wiki/Config.xml

Ok so the config.xml files in '~/.mythtv/' & 'home/mythtv/.mythtv/' are identical and:
<Host> is set to 192.168.0.55 otherwise the database will not start for the frontend
mythbackend is running as user mythtv started & stopped using systemd.

Three archlinux frontend clients all work properly.

In addition "/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py -B Superstore"
when run as users: mythtv, ljohnson or root all complete successfully.

Whenever 'Look up Metadata' is run from the front end GUI menu, it fails with exit status 128 per mythweb

There is a crash file with this partial result:

Code: Select all

ProcVersionSignature: Ubuntu 4.4.0-93.116-generic 4.4.79
SourcePackage: mythtv
Tags: xenial third-party-packages
Title: ttvdb.py crashed with OSError in __main__: [Errno 2] No such file or directory: '/etc/mythtv/cache/tvdb_api/'
Uname: Linux 4.4.0-93-generic x86_64
UpgradeStatus: Upgraded to xenial on 2017-08-19 (27 days ago)
and I checked and there is no '/etc/mythtv/cache/tvdb_api/' directory.

but there is this:

Code: Select all

root@KISE-055:/etc/mythtv# find / -name '*tvdb_api*'
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py.old
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.pyc
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py
/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.pyc.off
/home/mythtv/.mythtv/cache/tvdb_api
/home/mythtv/.mythtv/cache/tvdb_api/tvdb_api.sqlite
/home/ljohnson/.mythtv/cache/tvdb_api
/home/ljohnson/.mythtv/cache/tvdb_api/tvdb_api.sqlite

User avatar
bill6502
Developer
Posts: 1281
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Metadata lookup failsin 0.29 on 16.04

Post by bill6502 » Sat Sep 16, 2017 2:06 am

Hi,

I'd create /etc/mythtv/cache/tvdb_api/ and make sure user mythtv can write to it.

Code: Select all

sudo mkdir /etc/mythtv/cache/tvdb_api
sudo chown mythtv:mythtv /etc/mythtv/cache/tvdb_api
It could be that the .system file for the backend has MYTHCONFDIR set
and that's pointing to /etc/mythtv.

I'd do systemctl cat mythtv-backend to see what's there.

User avatar
keepitsimpleengineer
Junior
Posts: 18
Joined: Fri Oct 03, 2014 9:53 pm
Location: Central California, U.S.A.
Contact:
United States of America

Re: Metadata lookup fails in 0.29 on 16.04

Post by keepitsimpleengineer » Sun Sep 17, 2017 7:34 pm

I should wrap this up.
1st The motherboard failed, it had run 24/7 for over seven years. RIP
2nd Replaced the mother board and power supply with spares on hand.
3rd Tuner card was not fully functional thereafter so I re-downloaded the firmware and redid the setup, which included video sources.
4th Refilled the scheduling data.
5th Tested metadata lookup and now it works. :?:

So I want to thank all for the assistance. You went the extra mile.

I love this forum :D

mrkstate
Newcomer
Posts: 6
Joined: Mon May 05, 2014 1:02 pm
United States of America

Re: [SOLVED] Metadata lookup fails in 0.29 on 16.04

Post by mrkstate » Wed Sep 20, 2017 3:47 pm

So - for those of us - still struggling to get this resolved - and who are not going thru a re-build of the set up...

Looking to solve our issues - as it seems to be a change in a configuration somewhere due to the upgrade ...

mrkstate
Newcomer
Posts: 6
Joined: Mon May 05, 2014 1:02 pm
United States of America

Re: [SOLVED] Metadata lookup fails in 0.29 on 16.04

Post by mrkstate » Wed Sep 20, 2017 4:05 pm

Well....

the only change made was these 2 commands on each server that particpates in the mythtv solution.. ( I have 1 master and 2 slave backends ... ):

sudo mkdir -p /etc/mythtv/cache/tvdb_api
sudo chown -R mythtv:mythtv /etc/mythtv/cache/tvdb_api

That seems to have resolved my issue at least....

mrkstate
Newcomer
Posts: 6
Joined: Mon May 05, 2014 1:02 pm
United States of America

Re: [SOLVED] Metadata lookup fails in 0.29 on 16.04

Post by mrkstate » Wed Sep 20, 2017 4:08 pm

Seems to be the location that the process is going to use to create a file - versus using the location of the directory under the user id running the process ....

root@mcvey-pvr:/etc/mythtv/cache/tvdb_api# ls -alrt
total 116
drwxr-xr-x 3 root root 4096 Sep 20 11:49 ..
-rw-r--r-- 1 mythtv mythtv 110592 Sep 20 12:00 tvdb_api.sqlite
drwxr-xr-x 2 mythtv mythtv 4096 Sep 20 12:00 .
root@mcvey-pvr:/etc/mythtv/cache/tvdb_api#

Post Reply