Serialization ERROR

I am receiving a serialization error when plex is trying to serialize some of the tv_show objects during my scan and metadata retrieval using custom scanner and agent.  can anyone think of why or what could cause a serialization issue?

 

could it be the way i am setting metadata

could it be special characters in the metadata itself

a bug with standard plex py scripts?

 

The error is random and occurs for about 10 - 15% of my items

 

There are actually 2 errors listed in the code below.  1 in search and then 1 in the serialization.  the search error has been going on for a while for me, and i can't fix that one, but the serialization is new.

 

I am receiving a serialization error when plex is trying to serialize some of the tv_show objects during my scan and metadata retrieval using custom scanner and agent.  can anyone think of why or what could cause a serialization issue?

could it be the way i am setting metadata
could it be special characters in the metadata itself
a bug with standard plex py scripts?

The error is random and occurs for about 10 - 15% of my items

There are actually 2 errors listed in the code below. 1 in search and then 1 in the serialization. the search error has been going on for a while for me, and i can’t fix that one, but the serialization is new.

2013-06-10 22:31:23,431 (-4faed000) : DEBUG (networking:172) - Requesting ‘http://127.0.0.1:32400/library/metadata/551/tree
2013-06-10 22:31:23,436 (-4faed000) : DEBUG (init:157) - ****STARTTTTTTTT
2013-06-10 22:31:23,436 (-4faed000) : DEBUG (init:85) - ***cwdddddddddddd=/Users/michaelreid/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.agents.bmtagenttvshows
2013-06-10 22:31:23,436 (-4faed000) : DEBUG (init:95) - ***propertiesFilePath=/Users/michaelreid/Library/Application Support/Plex Media Server/Plug-ins/BMTAgentTVShows.bundle/Contents/Code/BMTAgent.properties
2013-06-10 22:31:23,437 (-4faed000) : DEBUG (init:110) - ***Properties file key=SAGEX_HOST; value=http://192.168.1.110:8500
2013-06-10 22:31:23,437 (-4faed000) : DEBUG (init:110) - ***Properties file key=PLEX_HOST; value=http://localhost:32400
2013-06-10 22:31:23,437 (-4faed000) : DEBUG (init:162) - ****media.id=551; media.filename=%2FVolumes%2FAllF%2Frecordingsf%2FRescueRenovation-S03E05-BallardMasterBedroom-15922703-0%2Empg
2013-06-10 22:31:23,437 (-4faed000) : DEBUG (init:166) - ****unquotedFilepathAndName=/Volumes/AllF/recordingsf/RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:23,438 (-4faed000) : DEBUG (init:167) - ****unquotedFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:23,438 (-4faed000) : DEBUG (init:169) - ****filename = RescueRenovation-S03E05-BallardMasterBedroom-15922703-0
2013-06-10 22:31:23,438 (-4faed000) : DEBUG (init:71) - **** URL to Call = http://192.168.1.110:8500
/sagex/api?c=plex:GetMediaFileForName&1=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0&encoder=json
2013-06-10 22:31:25,559 (-4faed000) : DEBUG (runtime:911) - Response: [200] str, 644 bytes
2013-06-10 22:31:25,592 (-4faed000) : DEBUG (runtime:714) - Handling request GET /:/plugins/com.plexapp.agents.bmtagenttvshows/messaging/function/X0FnZW50S2l0OlVwZGF0ZU1ldGFkYXRh/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKNwpzMgplbnM0CmxhbmdiMXM1CmZvcmNlbnMxMApwYXJlbnRHVUlEczcKVFZfU2hvd3MxMAptZWRpYV90eXBlczMKNTUxczQKZGJpZHM1Mwpjb20ucGxleGFwcC5hZ2VudHMuYm10YWdlbnR0dnNob3dzOi8vMTU5NjY2Njk%40bGFuZz1lbnM0Cmd1aWRzOAoxNTk2NjY2OXMyCmlkcjAK
2013-06-10 22:31:25,594 (-4faed000) : DEBUG (runtime:811) - Found route matching /:/plugins/com.plexapp.agents.bmtagenttvshows/messaging/function/X0FnZW50S2l0OlVwZGF0ZU1ldGFkYXRh/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKNwpzMgplbnM0CmxhbmdiMXM1CmZvcmNlbnMxMApwYXJlbnRHVUlEczcKVFZfU2hvd3MxMAptZWRpYV90eXBlczMKNTUxczQKZGJpZHM1Mwpjb20ucGxleGFwcC5hZ2VudHMuYm10YWdlbnR0dnNob3dzOi8vMTU5NjY2Njk@bGFuZz1lbnM0Cmd1aWRzOAoxNTk2NjY2OXMyCmlkcjAK
2013-06-10 22:31:25,595 (-4faed000) : DEBUG (model:32) - Loading model with GUID com.plexapp.agents.bmtagenttvshows://15966669?lang=en
2013-06-10 22:31:25,596 (-4faed000) : ERROR (model:194) - Cannot read model from /Users/michaelreid/Library/Application Support/Plex Media Server/Metadata/TV Shows/6/f9637085ffd0bdc8500a06d9c2c761203a2553d.bundle/Contents/com.plexapp.agents.bmtagenttvshows
2013-06-10 22:31:25,596 (-4faed000) : DEBUG (networking:172) - Requesting ‘http://127.0.0.1:32400/library/metadata/551/tree
2013-06-10 22:31:25,603 (-4faed000) : CRITICAL (agentkit:973) - Exception in the update function of agent named ‘SageTV BMT Agent (TV Shows)’, called with guid ‘com.plexapp.agents.bmtagenttvshows://15966669?lang=en’ (most recent call last):
File “/Users/michaelreid/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py”, line 971, in _update
agent.update(obj, media, lang)
TypeError: update() takes exactly 3 arguments (4 given)

2013-06-10 22:31:25,604 (-4faed000) : DEBUG (model:218) - Serializing to /Users/michaelreid/Library/Application Support/Plex Media Server/Metadata/TV Shows/6/f9637085ffd0bdc8500a06d9c2c761203a2553d.bundle/Contents/com.plexapp.agents.bmtagenttvshows/Info.xml
2013-06-10 22:31:25,605 (-4faed000) : DEBUG (model:32) - Loading model with GUID com.plexapp.agents.bmtagenttvshows://15966669?lang=en
2013-06-10 22:31:25,606 (-4faed000) : DEBUG (model:223) - Deserializing from /Users/michaelreid/Library/Application Support/Plex Media Server/Metadata/TV Shows/6/f9637085ffd0bdc8500a06d9c2c761203a2553d.bundle/Contents/com.plexapp.agents.bmtagenttvshows/Info.xml
2013-06-10 22:31:25,607 (-4faed000) : DEBUG (networking:172) - Requesting ‘http://127.0.0.1:32400/library/metadata/551/tree
2013-06-10 22:31:25,612 (-4faed000) : DEBUG (init:186) - ***UPDATE CALLEDDDDDDDDDDDDDDDDDDDDDDDD
2013-06-10 22:31:25,623 (-4faed000) : DEBUG (init:198) - series={‘SeriesID’: ‘1283553’, ‘SeriesTitle’: ‘Rescue Renovation’, ‘SeriesSubCategory’: ‘Home improvement’, ‘SeriesDayOfWeek’: ‘’, ‘NumberOfCharactersInSeries’: 1, ‘IsSeriesInfoObject’: True, ‘SeriesDescription’: “Home renovations usually start with careful preparation, but it doesn’t take much for the best-laid plan to quickly derail. For those Bob Vila wannabes who encountered unexpected electrical wires or just slammed a sledgehammer into a load-bearing wall, licensed contractor Kayleen McCabe comes to the rescue. In this series, McCabe and her crew bail out rookie renovators by determining what caused their errors and, more importantly, how to fix the mistakes. In only seven days, homeowners find their disaster zones transformed into beautiful, finished projects.”, ‘SeriesImage’: ‘’, ‘SeriesHistory’: ‘’, ‘SeriesNetwork’: ‘DIY’, ‘SeriesPremiereDate’: ‘2010-07-27’, ‘SeriesHourAndMinuteTimeslot’: ‘’, ‘SeriesCategory’: ‘How-to’, ‘SeriesFinaleDate’: ‘’}
2013-06-10 22:31:25,623 (-4faed000) : DEBUG (init:204) - ***seriesPremiere=2010-07-27
2013-06-10 22:31:25,624 (-4faed000) : DEBUG (init:206) - ***airDate=2010-07-27 00:00:00
2013-06-10 22:31:25,624 (-4faed000) : DEBUG (init:222) - METADATA.ID = None
2013-06-10 22:31:25,624 (-4faed000) : DEBUG (init:223) - COMPLETED SETTING SERIES-LEVEL METADATA;metadata.title=Rescue Renovation;metadata.summary=Home renovations usually start with careful preparation, but it doesn’t take much for the best-laid plan to quickly derail. For those Bob Vila wannabes who encountered unexpected electrical wires or just slammed a sledgehammer into a load-bearing wall, licensed contractor Kayleen McCabe comes to the rescue. In this series, McCabe and her crew bail out rookie renovators by determining what caused their errors and, more importantly, how to fix the mistakes. In only seven days, homeowners find their disaster zones transformed into beautiful, finished projects.;metadata.originally_available_at=2010-07-27;metadata.studio=DIY
2013-06-10 22:31:25,624 (-4faed000) : DEBUG (init:60) - UNQUOTED getMediaFilesForShow URL=http://192.168.1.110:8500
/sagex/api?c=EvaluateExpression&1=FilterByMethod(GetMediaFiles(“T”), “GetShowTitle”, “Rescue Renovation”, true)&encoder=json
2013-06-10 22:31:25,625 (-4faed000) : DEBUG (init:62) - QUOTED getMediaFilesForShow URL=http://192.168.1.110:8500
/sagex/api?c=EvaluateExpression&1=FilterByMethod(GetMediaFiles(“T”)%2C%20%22GetShowTitle%22%2C%20%22Rescue%20Renovation%22%2C%20true)&encoder=json
2013-06-10 22:31:25,648 (-4faed000) : DEBUG (init:230) - LOOKING FOR METADATA FOR metadata.seasons[3].episodes[5]
2013-06-10 22:31:25,649 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S02E06-DelancyBasement-15757856-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,649 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S02E07-VitaleBarn-15757857-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,649 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S03E10-MatthewsKitchen-15785916-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,650 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S03E08-AdamsBasement-15785915-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,650 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S03E06-GonclavesPatio-15815903-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,650 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S03E04-MejiaKitchen-15815902-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,651 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S03E12-FriarBasement-15827556-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,651 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S01E02-MillerForbesKitchen-15827554-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,651 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S03E03-WalkerBackyard-15849773-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,652 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S01E04-JankowiakBathroom-15868803-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,652 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S01E06-SarvestaniBasement-15868804-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,652 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S01E08-RittKitchen-15898146-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,653 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S01E10-ParrisBaconKitchen-15898147-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,653 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S01E12-RiversKitchen-15922698-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,654 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S01E13-GoodeMusicRoom-15922699-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,654 (-4faed000) : DEBUG (init:242) - mfFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg;plexFilename=RescueRenovation-S03E05-BallardMasterBedroom-15922703-0.mpg
2013-06-10 22:31:25,654 (-4faed000) : DEBUG (init:246) - ****plexName = RescueRenovation-S03E05-BallardMasterBedroom-15922703-0
2013-06-10 22:31:25,655 (-4faed000) : DEBUG (init:247) - ****sageName = RescueRenovation-S03E05-BallardMasterBedroom-15922703-0
2013-06-10 22:31:25,655 (-4faed000) : DEBUG (init:248) - SHOW OBJECT FOR MATCHED SHOW: {‘ShowYear’: ‘’, ‘ShowEpisode’: ‘Ballard Master Bedroom’, ‘ShowCategoriesList’: [‘How-to’, ‘Home improvement’], ‘ShowSeasonNumber’: 3, ‘ShowSubCategory’: ‘Home improvement’, ‘ShowCategoriesString’: ‘How-to / Home improvement’, ‘ShowExternalID’: ‘EP012835530031’, ‘ShowEpisodeNumber’: 5, ‘IsShowEPGDataUnique’: True, ‘ShowDescription’: ‘A couple who bought an old printing press studio have a completely blank canvas for their renovation.’, ‘OriginalAiringDate’: 1320278400000L, ‘RolesInShow’: [‘Host’], ‘PeopleListInShow’: [‘Kayleen McCabe’], ‘PeopleAndCharacterListInShow’: [‘Kayleen McCabe’], ‘ShowExpandedRatings’: ‘’, ‘ShowRated’: ‘’, ‘ShowLanguage’: ‘’, ‘ShowCategory’: ‘How-to’, ‘ShowTitle’: ‘Rescue Renovation’, ‘ShowMisc’: ‘’, ‘ShowParentalRating’: ‘’, ‘IsShowObject’: True, ‘PeopleInShow’: ‘Kayleen McCabe’, ‘ShowDuration’: 0}
2013-06-10 22:31:25,655 (-4faed000) : DEBUG (init:249) - UPDATING METADATA FOR SEASON: 3; EPISODE: 5
2013-06-10 22:31:25,656 (-4faed000) : DEBUG (init:274) - ***posterurl = http://192.168.1.110:8500
/sagex/media/fanart?mediafile=15966669&artifact=poster && season poster = http://192.168.1.110:8500
/sagex/media/fanart?mediafile=15966669&artifact=poster&season=3
2013-06-10 22:31:25,680 (-4faed000) : DEBUG (init:306) - COMPLETED SETTING EPISODE-LEVEL METADATA FOR SEASON: 3; EPISODE: 5;;;;episode.title=Ballard Master Bedroom;episode.summary=A couple who bought an old printing press studio have a completely blank canvas for their renovation.;episode.originally_available_at=2011-11-02;episode.duration=1799998;episode.season=3;metadata.content_rating=None;
2013-06-10 22:31:25,681 (-4faed000) : CRITICAL (model:181) - Exception serializing TV_Show with guid ‘com.plexapp.agents.bmtagenttvshows://15966669?lang=en’ (most recent call last):
File “/Users/michaelreid/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/michaelreid/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/modelling/model.py”, line 204, in _serialize
el.set(‘id’, self._id)
File “lxml.etree.pyx”, line 641, in lxml.etree._Element.set (src/lxml/lxml.etree.c:9596)
File “apihelpers.pxi”, line 416, in lxml.etree._setAttributeValue (src/lxml/lxml.etree.c:31761)
File “apihelpers.pxi”, line 1144, in lxml.etree._utf8 (src/lxml/lxml.etree.c:37278)
TypeError: Argument must be string or unicode.

2013-06-10 22:31:25,682 (-4faed000) : DEBUG (runtime:911) - Response: [200] str, 16 bytes

 

nobody has any ideas on this serialization issue?

I just wanted to close this thread out.  I figured out what was going on and wanted to share for anyone else having this issue.

Issue:

1) receiving errors on update and errors on search indicating that there were the wrong number of args being passed in.

1 Solution) I noticed that there were 2 classes defined in the same exact file which was most likely due to mutliple people working on the same code.  Removing this redundant definition of the same class solved this error

2) Serialiaztion Error when plex was done retrieving metadata for the current item.

2 solution) This was actually being caused by the what I was passing to the plexthememusic agent.  When I added in the code to set the metadata.id so that plexthememusic could contribute to my code I DID NOT check for the existence of the ID in my source before setting it.  What happens then is the agent code tries to serialize the object in order to pass it to the thememusic agent.  when trying to serialize the metadata.id that is not a string or unicode (in my case blank or null) it throws a serialization error and ultimately prohibits ANY metadata from being added to the current item.

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