Metadata lookup started failing (v30, Devuan Linux)

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

Moderator: Forum Moderators

Post Reply
pvrmine
Newcomer
Posts: 6
Joined: Mon Jul 01, 2019 3:19 pm
United States of America

Metadata lookup started failing (v30, Devuan Linux)

Post by pvrmine » Wed Jul 03, 2019 2:57 pm

Running version 30. Metadata lookup was working, then I updated packages to Devuan Testing, and now they don't.

A manual invocation of ttvdb.py results in this:

$ /usr/share/mythtv/metadata/Television/ttvdb.py -l en -a US -N 270091 "Teenage Wasteland"

Code: Select all

Traceback (most recent call last):
  File "/usr/share/mythtv/metadata/Television/ttvdb.py", line 2674, in <module>
    sys.exit(main())
  File "/usr/share/mythtv/metadata/Television/ttvdb.py", line 2374, in main
    userkey=tvdb_account.account_identifier)
  File "/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py", line 693, in __init__
    self.session.remove_expired_responses()
  File "/usr/lib/python2.7/dist-packages/requests_cache/core.py", line 159, in remove_expired_responses
    self.cache.remove_old_entries(datetime.utcnow() - self._cache_expire_after)
  File "/usr/lib/python2.7/dist-packages/requests_cache/backends/base.py", line 110, in remove_old_entries
    response, created_at = self.responses[key]
  File "/usr/lib/python2.7/dist-packages/requests_cache/backends/storage/dbdict.py", line 163, in __getitem__
    return pickle.loads(bytes(super(DbPickleDict, self).__getitem__(key)))
ImportError: No module named ordered_dict
I installed package python-simplejson for ordered_dict, but the result didn't change.

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

Re: Metadata lookup started failing (v30, Devuan Linux)

Post by bill6502 » Wed Jul 03, 2019 3:30 pm

Give the Troubleshooting section here a try: https://www.mythtv.org/wiki/TheTVDB_API_v2
My ordered_dict package is under urllib3 as well as python-simplejson.

pvrmine
Newcomer
Posts: 6
Joined: Mon Jul 01, 2019 3:19 pm
United States of America

Re: Metadata lookup started failing (v30, Devuan Linux)

Post by pvrmine » Wed Jul 03, 2019 3:47 pm

The requirements in that page appear to be met:

$ 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.16.0-1 all single-source support for Python 3 and 2 - Python 2.x
ii python-requests 2.21.0-1 all elegant and simple HTTP library for Python2, built for human beings
ii python-requests-cache 0.4.13-2 all persistent cache for requests library
ii python-urllib3 1.24.1-1 all HTTP library with thread-safe connection pooling for Python

$ pip list |egrep "future|requests|urllib3"
future 0.16.0
requests 2.21.0
requests-cache 0.4.13
urllib3 1.24.1

pvrmine
Newcomer
Posts: 6
Joined: Mon Jul 01, 2019 3:19 pm
United States of America

Re: Metadata lookup started failing (v30, Devuan Linux)

Post by pvrmine » Wed Jul 03, 2019 6:22 pm

Downgraded two packages and it's behaving differently now:

$ sudo apt install python-urllib3=1.19.1-1 python-requests=2.12.4-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
python-certifi
Use 'sudo apt autoremove' to remove it.
Suggested packages:
python-socks python-ntlm
The following packages will be DOWNGRADED:
python-requests python-urllib3
0 upgraded, 0 newly installed, 2 downgraded, 0 to remove and 74 not upgraded.
Need to get 178 kB of archives.
After this operation, 202 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://packages.roundr.devuan.org/merged stable/main amd64 python-requests all 2.12.4-1 [101 kB]
Get:2 http://packages.roundr.devuan.org/merged stable/main amd64 python-urllib3 all 1.19.1-1 [77.5 kB]
Fetched 178 kB in 1s (132 kB/s)
dpkg: warning: downgrading python-requests from 2.21.0-1 to 2.12.4-1
(Reading database ... 155737 files and directories currently installed.)
Preparing to unpack .../python-requests_2.12.4-1_all.deb ...
Unpacking python-requests (2.12.4-1) over (2.21.0-1) ...
dpkg: warning: downgrading python-urllib3 from 1.24.1-1 to 1.19.1-1
Preparing to unpack .../python-urllib3_1.19.1-1_all.deb ...
Unpacking python-urllib3 (1.19.1-1) over (1.24.1-1) ...
Setting up python-urllib3 (1.19.1-1) ...
Setting up python-requests (2.12.4-1) ...

$ /usr/share/mythtv/metadata/Television/ttvdb.py -l en -a US -N 270091 "Teenage Wasteland"
Traceback (most recent call last):
File "/usr/share/mythtv/metadata/Television/ttvdb.py", line 2674, in <module>
sys.exit(main())
File "/usr/share/mythtv/metadata/Television/ttvdb.py", line 2481, in main
seriesfound=searchseries(t, opts, x)
File "/usr/share/mythtv/metadata/Television/ttvdb.py", line 1529, in searchseries
series_data = search_for_series(t, series_name, opts.language)
File "/usr/share/mythtv/metadata/Television/ttvdb.py", line 1513, in search_for_series
return tvdb.series_by_sid(sid_or_name, language)
File "/usr/share/mythtv/metadata/Television/ttvdb.py", line 1485, in series_by_sid
self._getShowData(sid, language=language)
File "/usr/lib/python2.7/dist-packages/MythTV/ttvdb/tvdb_api.py", line 1054, in _getShowData
for curInfo in seriesInfoEt.keys():
AttributeError: 'NoneType' object has no attribute 'keys'

Searching for something else to downgrade.

pvrmine
Newcomer
Posts: 6
Joined: Mon Jul 01, 2019 3:19 pm
United States of America

Re: Metadata lookup started failing (v30, Devuan Linux)

Post by pvrmine » Wed Jul 03, 2019 6:46 pm

The latter error may be a flaw in the data for that one program. The backlog of missing metadata is mostly clearing after downgrading python-urlllib3 and python-requests.

halucigenia
Junior
Posts: 89
Joined: Tue Nov 11, 2014 11:03 am
Great Britain

Re: Metadata lookup started failing (v30, Devuan Linux)

Post by halucigenia » Fri Sep 06, 2019 12:28 pm

I have the same issue, however Metadata is not working on on machine with Kubuntu 19.04 but is working on another machine with Xubuntu 19.04.
Both machines have identical versions of the packages python-future, python-requests, python-requests-cache, python-urllib3.

Kubuntu

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.16.0-1          all          single-source support for Python 3 and 2 - Python 2.x
ii  python-requests       2.21.0-1          all          elegant and simple HTTP library for Python2, built for human beings
ii  python-requests-cache 0.4.13-2          all          persistent cache for requests library
ii  python-urllib3        1.24.1-1ubuntu0.1 all          HTTP library with thread-safe connection pooling for Python
Xubuntu

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.16.0-1          all          single-source support for Python 3 and 2 - Python 2.x
ii  python-requests       2.21.0-1          all          elegant and simple HTTP library for Python2, built for human beings
ii  python-requests-cache 0.4.13-2          all          persistent cache for requests library
ii  python-urllib3        1.24.1-1ubuntu0.1 all          HTTP library with thread-safe connection pooling for Python
The Kubuntu machine did not have the package python-simplejson initially so I installed that but it made no difference.

pvrmine please let me know if you managed to get this sorted.

halucigenia
Junior
Posts: 89
Joined: Tue Nov 11, 2014 11:03 am
Great Britain

Re: Metadata lookup started failing (v30, Devuan Linux)

Post by halucigenia » Fri Sep 06, 2019 2:57 pm

After a bit more internet searching I found a reference to downgrading using pip
The example given was

Code: Select all

pip install urllib3==1.23
which I ran and hey presto ttvdb.py started working again...

Post Reply