# Help with error on metadata update

**URL:** <https://forums.plex.tv/t/help-with-error-on-metadata-update/14845>\
**Category:** Dev/API Corner\
**Tags:** scanner-agent-dev\
**Created:** [February 8, 2012, 7:36pm UTC](https://forums.plex.tv/t/help-with-error-on-metadata-update/14845 "2012-02-08T19:36:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tuffo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tuffo/32/2847_2.png) [@Tuffo](https://forums.plex.tv/u/Tuffo)\
**Post date:** [February 8, 2012, 7:36pm UTC](https://forums.plex.tv/t/help-with-error-on-metadata-update/14845/1 "2012-02-08T19:36:09Z")

</div>

I’m trying to wrap up the final pieces to get my metadata agent for AniDB working, but there are still some issues I cannot solve. The agent works just fine in my Linux/Plex server, but just to be a good boy I decided to test it on OSX as well. Bad idea. I end up with a strange error when the update method is called, after the metadata has been set and Plex is trying to save it (I think). This is what I get in the logs - if anyone can help me with this I’d be really grateful.  
  
  
  
Thanks!  
  
  
  
2012-02-08 20:23:42,712 (-4faed000) : CRITICAL (model:181) - Exception serializing TV\_Show with guid ‘com.plexapp.agents.anidb://1081?lang=en’ (most recent call last):  
  
File “/Users/xxx/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/modelling/model.py”, line 179, in \_write  
  
self.\_serialize(os.path.join(self.\_storage\_path, subdir))  
  
File “/Users/xxx/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/modelling/model.py”, line 208, in \_serialize  
  
attr\_el = attr.\_serialize(os.path.join(path, name))  
  
File “/Users/xxx/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/modelling/attributes.py”, line 289, in \_serialize  
  
item\_el = item.\_serialize(os.path.join(path, item.\_name))  
  
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py”, line 60, in join  
  
AttributeError: ‘int’ object has no attribute ‘startswith’

---

<div class="post-metadata">

**Author:** ![Tuffo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tuffo/32/2847_2.png) [@Tuffo](https://forums.plex.tv/u/Tuffo)\
**Post date:** [February 14, 2012, 11:01am UTC](https://forums.plex.tv/t/help-with-error-on-metadata-update/14845/2 "2012-02-14T11:01:32Z")

</div>

Seriously, no one? It’s a bit hard to use an API that behaves differently on different platforms. Might have to do with the fact that the python version in Plex differs  
  
  
  
Linux (Qnap embedded) - 2.7  
  
Windows - 2.6  
  
OSX - 2.5  
  
  
  
…?

---

<div class="post-metadata">

**Author:** ![sander1](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@sander1](https://forums.plex.tv/u/sander1)\
**Post date:** [February 15, 2012, 9:39pm UTC](https://forums.plex.tv/t/help-with-error-on-metadata-update/14845/3 "2012-02-15T21:39:10Z")

</div>

Can you Log() some stuff from within your agent code to track where the problem occurs?

---

<div class="post-metadata">

**Author:** ![Tuffo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tuffo/32/2847_2.png) [@Tuffo](https://forums.plex.tv/u/Tuffo)\
**Post date:** [February 16, 2012, 8:41am UTC](https://forums.plex.tv/t/help-with-error-on-metadata-update/14845/4 "2012-02-16T08:41:55Z")

</div>

Sander, thanks for you reply. The problem was that the error occurred when Plex was trying to serialise the metadata - ie. after the update method had returned so there was no way for me to log anything more than I already did. I tried adding log statements in the framework code but that was seen as bad by Plex so it was either replaced or the framework wouldn’t start. A bit more tracing in the framework would have been nice.  
  
  
  
I finally solved the problem - iterating the seasons by number (int) seemed to work but when serializing it raised an exception when trying to convert the int to a string (as per my first message).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 9:40pm UTC](https://forums.plex.tv/t/help-with-error-on-metadata-update/14845/5 "2019-12-20T21:40:06Z")

</div>

Closed on December 20, 2019, 9:40pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
