Metadata agents for exported XBMC library

@SlrG said:
@ChuckPa:
He won’t see the season posters and correct thumbnails until the bug in plex that keeps third party agents from adding those correctly to the database is resolved. Imho what you posted until now still shows the error is on the plex side and needs to be fixed by the plex devs, or do you conclude otherwise from your research results until now? Then I need a clear statement on what I can chance in the agent to make it work again.

@Afullmark:
With the current version 1.3.3.3148 the agents should appear normally. If they are not, something is wrong with your installation. This is not the bug we are talking about.

I’m really puzzled by the

He won’t see the season posters and correct thumbnails until the bug in plex that keeps third party agents from adding those correctly to the database is resolved.

I can demonstrate, without any plug-ins whatsoever, Series, Season, and/or Episode posters work as documented.

Please clarify?

@ChuckPa:
While I think I provided a lot of that info already above, I can try to sum it up again. As I’m on a tight time budget again, it might take some time. So if anybody is quicker than me, please fire away.

I got pinged into this somehow. Normally not my area and my time is stretchhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhed thin too :smiley:

As long as we get a concise , reproducible issue, I don’t care how we get there. Team effort :thumbs_up:

@SlrG said:
@ChuckPa:
He won’t see the season posters and correct thumbnails until the bug in plex that keeps third party agents from adding those correctly to the database is resolved. Imho what you posted until now still shows the error is on the plex side and needs to be fixed by the plex devs, or do you conclude otherwise from your research results until now? Then I need a clear statement on what I can chance in the agent to make it work again.

@Afullmark:
With the current version 1.3.3.3148 the agents should appear normally. If they are not, something is wrong with your installation. This is not the bug we are talking about.

Look:

I have deleted the bundles; restarted plex. Deleted plex; download PMS fresh. Still the XBMC agents are not showing.

File permissions / ownership of the bundle itself?

On linux (my area of expertise), PMS runs as user plex:plex. ALL plug-ins in the Plug-ins directory must be owned by plex:plex

If that is ok, then the init python module (which PMS calls (?) ) isn’t speaking to it correctly. … Right here is where I am no longer of technical use. I have yet to master python.

@ChuckPa said:
File permissions / ownership of the bundle itself?

On linux (my area of expertise), PMS runs as user plex:plex. ALL plug-ins in the Plug-ins directory must be owned by plex:plex

If that is ok, then the init python module (which PMS calls (?) ) isn’t speaking to it correctly. … Right here is where I am no longer of technical use. I have yet to master python.

I’m on a mac. Permissions fine.

@ChuckPa:
Sorry, but I have to ask. Did you have a look at all the links I posted for you?

Since versions above 1.2.7 there seems to be a bug in plex, that prevents third party agents from correctly adding tv shows season posters and episode thumbnails to the plex database. This seems not to affect a stock plex install without any third party plugins. There was no change in the XBMCnfoTVImporter. With version 1.2.7 it worked and still works. It stops working as soon as a newer plex version is installed. So something has to have changed on the plex side, to make things go wrong.

So what you will need to test is installing XBMCnfoTVImporter or HAMA (see links above) setup a small tvshow library with locally saved nfo files and artwork and try to import that.

You will see, that instead of the season posters only the generic series poster appears for each season and that instead of locally saved episode thumbnails only plex generated ones appear.

There are users, that want to tune their library to exactly show what they want (the exact poster, fanart, season posters, thumbnails, themes, plot, rating, …) and have a guarantee this will stay the way it is on every single scan no matter the state of an internet connection or online services (e.g. TheTVDB), that might stop working or change artwork, descriptions or whatever anytime. Also databases get broken for various reasons and nothing sucks more, than having to fine tune a library again and again. The first time around, it is okay to use a web frontend to change posters and whatever, but let the library break. You do a rescan and all your work is down the drain as a rescan will only provide you the things other users deem right. So there are people that start using third party media managers to save their metadata alongside their media, where is it always available and always in the exact state the user wants.

@Afullmark:
I believe you. :slight_smile: But all I can say is that it is working on my system and until now you are the only one reporting this. Like @ChuckPa I would have suspected permission issues as the root of your problem. As you checked that and it is okay and even deleted and reinstalled plex, I’m somewhat out of ideas. Please check again that you are really installing the agents in the correct directory! Please try to install another agent. If this is also not showing up, you are probably using the wrong plugins directory.

IOError: [Errno 20] Not a directory: ‘/Users/AfullmarkPlex/Library/Application Support/Plex Media Server/Plug-ins/XBMCnfoTVImporter.bundle/Contents/Info.plist’

    2017-01-23 22:36:39,128 (70000f394000) :  CRITICAL (bundleservice:141) - Exception adding bundle: XBMCnfoTVImporter.bundle (most recent call last):

 File "/Applications/Plex Media Server.app/Contents/Resources/Plug-ins-b38628e/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/parsekit.py", line 22, in check_size
    if len(data) > max_size:
TypeError: object of type 'NoneType' has no len()

2017-01-23 22:36:39,128 (70000f394000) :  CRITICAL (storage:60) - Exception reading file /Users/AfullmarkPlex/Library/Application Support/Plex Media Server/Plug-ins/XBMCnfoMoviesImporter.bundle/Contents/Info.plist (most recent call last):
  File "/Applications/Plex Media Server.app/Contents/Resources/Plug-ins-b38628e/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/storage.py", line 55, in load
    f = open(filename, mode)
IOError: [Errno 20] Not a directory: '/Users/AfullmarkPlex/Library/Application Support/Plex Media Server/Plug-ins/XBMCnfoMoviesImporter.bundle/Contents/Info.plist'

2017-01-23 22:36:39,128 (70000f394000) :  CRITICAL (bundleservice:141) - Exception adding bundle: XBMCnfoMoviesImporter.bundle (most recent call last):
  File "/Applications/Plex Media Server.app/Contents/Resources/Plug-ins-b38628e/System.bundle/Contents/Code/bundleservice.py", line 128, in update_bundles
    bundle = BundleInfo(self.system, path, plugin)

This doesn’t look right?

And they are in the right place too:

And:

2017-01-23 22:36:39,128 (70000f394000) :  CRITICAL (storage:60) - Exception reading file /Users/AfullmarkPlex/Library/Application Support/Plex Media Server/Plug-ins/XBMCnfoMoviesImporter.bundle/Contents/Info.plist (most recent call last):
  File "/Applications/Plex Media Server.app/Contents/Resources/Plug-ins-b38628e/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/storage.py", line 55, in load
    f = open(filename, mode)
IOError: [Errno 20] Not a directory: '/Users/AfullmarkPlex/Library/Application Support/Plex Media Server/Plug-ins/XBMCnfoMoviesImporter.bundle/Contents/Info.plist'

2017-01-23 22:36:39,128 (70000f394000) :  CRITICAL (bundleservice:141) - Exception adding bundle: XBMCnfoMoviesImporter.bundle (most recent call last):
  File "/Applications/Plex Media Server.app/Contents/Resources/Plug-ins-b38628e/System.bundle/Contents/Code/bundleservice.py", line 128, in update_bundles
    bundle = BundleInfo(self.system, path, plugin)
  File "/Applications/Plex Media Server.app/Contents/Resources/Plug-ins-b38628e/System.bundle/Contents/Code/bundleservice.py", line 18, in __init__
    self.load_plist()



2017-01-23 22:36:39,126 (70000ef91000) :  DEBUG (runtime:1117) - Created a thread named 'remove_unavailable_agents'
2017-01-23 22:36:39,127 (70000f394000) :  CRITICAL (storage:60) - Exception reading file /Users/AfullmarkPlex/Library/Application Support/Plex Media Server/Plug-ins/XBMCnfoTVImporter.bundle/Contents/Info.plist (most recent call last):
  File "/Applications/Plex Media Server.app/Contents/Resources/Plug-ins-b38628e/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/storage.py", line 55, in load
    f = open(filename, mode)
IOError: [Errno 20] Not a directory: '/Users/AfullmarkPlex/Library/Application Support/Plex Media Server/Plug-ins/XBMCnfoTVImporter.bundle/Contents/Info.plist'

@Afullmark:
Are you sure you have them extracted correctly? For now I’m off to bed. Have to wake in 4 hours and I know I will regret it. Will be back later.

@SlrG said:
@Afullmark:
Are you sure you have them extracted correctly? For now I’m off to bed. Have to wake in 4 hours and I know I will regret it. Will be back later.

I’m an idiot! Because I’m crazy busy I just renamed the .zip direct to bundle without unzipping. Heck. To many nights up late (squeezing things in is never that good, for too many nights in a row).

@SlrG

Yes, I did look at what you provided. That’s why I went digging into the release notes, both internal and public, to find out what changed.

The sqlite3 change and the python change are the only two core deps I can see so far.

I’ve looked further today. There is a possibly (i have no level of certainty in what I’m about to say so please bare with me), media match scoring might have regressed. The data might be going into the db correctly but when PMS goes to pull posters, etc… it comes up blank. This is being seen?

If we can create a single example of: 1.2.7 OK - 1.3.3 FAIL (or at what point it might FAIL) this is the ‘smoking gun’ which will save me hours of trying to read through every code change made from 1.2.7 until now (literally hundreds). It is, at this point a proverbial ‘needle in the haystack’ search.

I’m trying to work through this along with my other duties. Doing my best but I’m just one person.

@Afullmark said:

@SlrG said:
@Afullmark:
Are you sure you have them extracted correctly? For now I’m off to bed. Have to wake in 4 hours and I know I will regret it. Will be back later.

I’m an idiot! Because I’m crazy busy I just renamed the .zip direct to bundle without unzipping. Heck. To many nights up late (squeezing things in is never that good, for too many nights in a row).

Is this where we give you the proverbial “up the backside of your head” ? :smiley:

@ChuckPa said:

@Afullmark said:

@SlrG said:
@Afullmark:
Are you sure you have them extracted correctly? For now I’m off to bed. Have to wake in 4 hours and I know I will regret it. Will be back later.

I’m an idiot! Because I’m crazy busy I just renamed the .zip direct to bundle without unzipping. Heck. To many nights up late (squeezing things in is never that good, for too many nights in a row).

Is this where we give you the proverbial “up the backside of your head” ? :smiley:

And with my messing some of the libraries that had the xBmc agent have now lost it; and edit wont show an option to bring it back.

restart PMS

@ChuckPa said:
restart PMS

That did it. No cake for me :frowning:

Logs please (Settings - Server - Help - Download Logs) Attach the ZIP here.

@ChuckPa said:
Logs please (Settings - Server - Help - Download Logs) Attach the ZIP here.

Tis all working now.

@ChuckPa:
Thank you very much for helping us debug the issue. I really appreciate the help!

I have compiled the info you requested:

  • Description of issue (short 1 liner)
    After plex version 1.2.7 season posters and episode thumbs imported by third party agents don’t work.

  • Expected behavior (details/logs/screenshots included)

  • Observed behavior (details/logs/screenshots included)

  • Steps to reproduce procedure (showing a regression / deviation between specific versions is allowed and very much appreciated as it helps them isolate)
    Install e.g . XBMCnfoTVImporter on 1.2.7 and use it to scan a TVShow with locally saved metadata like season posters and episode thumbnails. This will work and produce the correct results.

Install a newer version than 1.2.7 and redo the steps. As posters for the seasons only the tvshows poster will show. Instead of the user provided episoded thumbnails only plex generated ones will be shown.

Other third party agents like HAMA should be affected, too.

If a testing library is needed, I can provide that, too. Please excuse the wrong background fanart for Alias, it is part of my testing library.

@SlrG

Would you be kind enough to take a look at this?

First is PMS 1.2.7 Showing Framework core 2.6.3 build 1bef33a (1.2.7) Which you say works.

2017-01-24 19:21:10,735 (2b2483a6d480) :  DEBUG (accessor:68) - Creating a new model access point for provider com.plexapp.agents.thetvdb in namespace 'metadata'
2017-01-24 19:21:10,739 (2b2483a6d480) :  DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes'
2017-01-24 19:21:10,746 (2b2483a6d480) :  ERROR (networking:219) - Error opening URL 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes'
2017-01-24 19:21:10,747 (2b2483a6d480) :  CRITICAL (runtime:1299) - Exception getting hosted resource hashes (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-1bef33a/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 1293, in get_resource_hashes
    json = self._core.networking.http_request("http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes", timeout=10).content
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-1bef33a/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 265, in content
    return self.__str__()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-1bef33a/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 243, in __str__
    self.load()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-1bef33a/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 181, in load
    f = self._opener.open(req, timeout=self._timeout)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-1bef33a/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 444, in open
    response = meth(req, response)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-1bef33a/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 557, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-1bef33a/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 482, in error
    return self._call_chain(*args)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-1bef33a/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 416, in _call_chain
    result = func(*args)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-1bef33a/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 565, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found

2017-01-24 19:21:10,753 (2b248bc35700) :  DEBUG (services:265) - Plug-in is not daemonized - loading services from system
2017-01-24 19:21:10,754 (2b2483a6d480) :  DEBUG (runtime:1117) - Created a thread named 'load_all_services'
2017-01-24 19:21:10,755 (2b2483a6d480) :  DEBUG (runtime:1117) - Created a thread named 'get_server_info'

Now we compare against: Framework core - Version: 2.6.3, Build: b38628e (1.3.3) Which is ‘broken’ ??

2017-01-24 21:24:47,170 (2b10c2e57480) :  DEBUG (accessor:68) - Creating a new model access point for provider com.plexapp.agents.thetvdb in namespace 'metadata'
2017-01-24 21:24:47,174 (2b10c2e57480) :  DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes'
2017-01-24 21:24:47,187 (2b10cbb0a700) :  DEBUG (services:265) - Plug-in is not daemonized - loading services from system
2017-01-24 21:24:47,187 (2b10c2e57480) :  DEBUG (runtime:1117) - Created a thread named 'load_all_services'
2017-01-24 21:24:47,188 (2b10cbb0a700) :  DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_'
2017-01-24 21:24:47,188 (2b10c2e57480) :  DEBUG (runtime:1117) - Created a thread named 'get_server_info'
2017-01-24 21:24:47,188 (2b10f4200700) :  DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400'
2017-01-24 21:24:47,189 (2b10c2e57480) :  DEBUG (core:150) - Finished starting framework core
2017-01-24 21:24:47,189 (2b10c2e57480) :  DEBUG (core:560) - Loading plug-in code
2017-01-24 21:24:47,567 (2b10c2e57480) :  DEBUG (core:566) - Finished loading plug-in code
2017-01-24 21:24:47,568 (2b10c2e57480) :  DEBUG (agentkit:1104) - Creating new agent class called TVDBAgent
2017-01-24 21:24:47,569 (2b10c2e57480) :  DEBUG (agentkit:922) - Updating agent information: [{'media_types': ['TV_Show'], 'accepts_from': None, 'fallback_agent': None, 'contributes_to': None, 'languages': ['en', 'fr', 'zh', 'sv', 'no', 'da', 'fi', 'nl', 'de', 'it', 'es', 'pl', 'hu', 'el', 'tr', 'ru', 'he', 'ja', 'pt', 'cs', 'ko', 'sl', 'hr'], 'persist_stored_files': True, 'version': 0, 'primary_provider': True, 'prefs': True, 'name': 'TheTVDB'}]
2017-01-24 21:24:47,570 (2b10c2e57480) :  DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0FnZW50U2VydmljZTpVcGRhdGVJbmZv/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQo1CmRpY3QKbGlzdApkaWN0Cmxpc3QKbGlzdAoyCnMyNgpjb20ucGxleGFwcC5hZ2VudHMudGhldHZkYnMxMAppZGVudGlmaWVycjEKczEwCmFnZW50X2luZm8xCnIyCjEwCnIzCnMxMQptZWRpYV90eXBlc25zMTIKYWNjZXB0c19mcm9tbnMxNApmYWxsYmFja19hZ2VudG5zMTQKY29udHJpYnV0ZXNfdG9yNApzOQpsYW5ndWFnZXNiMXMyMApwZXJzaXN0X3N0b3JlZF9maWxlc2kwCnM3CnZlcnNpb25iMXMxNgpwcmltYXJ5X3Byb3ZpZGVyYjFzNQpwcmVmc3M3ClRoZVRWREJzNApuYW1lMQpzNwpUVl9TaG93MjMKczIKZW5zMgpmcnMyCnpoczIKc3ZzMgpub3MyCmRhczIKZmlzMgpubHMyCmRlczIKaXRzMgplc3MyCnBsczIKaHVzMgplbHMyCnRyczIKcnVzMgpoZXMyCmphczIKcHRzMgpjc3MyCmtvczIKc2xzMgpocnIwCg__'
2017-01-24 21:24:47,572 (2b10f4200700) :  DEBUG (core:538) - Machine identifier is 8ce0915ce4e5595f7ca4a14d601404e39f398f7f
2017-01-24 21:24:47,572 (2b10f4200700) :  DEBUG (core:539) - Server version is 1.3.3.3148-b38628e
2017-01-24 21:24:47,650 (2b10cbb0a700) :  DEBUG (services:362) - Loaded services
2017-01-24 21:24:47,653 (2b10cbecb700) :  DEBUG (services:438) - No shared code to load
2017-01-24 21:24:47,654 (2b10c2e57480) :  INFO (core:611) - Started plug-in
2017-01-24 21:24:47,654 (2b10c2e57480) :  DEBUG (socketinterface:160) - Starting socket server
2017-01-24 21:24:47,655 (2b10c2e57480) :  DEBUG (runtime:1117) - Created a thread named 'start'
2017-01-24 21:24:47,655 (2b10c2e57480) :  INFO (socketinterface:184) - Socket server started on port 45095
2017-01-24 21:24:47,655 (2b10c2e57480) :  INFO (pipeinterface:25) - Entering run loop

Is what we are seeing a side effect of the tvdb agent being fixed?