Bug in the framework

Guess this is more or less a direct Q for Sander1 here, but others are free to chime in as well

 

 

I got a broken database, that is missing some mandatory elements of a movie....

 

When I browse to:

 

http://:32400/sections/3/all it will show an xml dump without any errors logged.

 

If I from within code, do the following:

	try:
		myMedias = XML.ElementFromURL('http://:32400/sections/3/all').xpath('//Video')
		Log.Debug("Retrieved myMedias okay")
	except:
		print 'opened failed'
	print 'continuing'

An exception will be raised.

 

And above is all the code that my little test app contains! 

 

As such, I suspect that there's a bug in the XML object of the framework, or?

 

Best Regards

 

Tommy

And running without a try clause, the following showed in the bundle log

File "/share/MD0_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/parsekit.py", line 345, in ElementFromURL

    ).content, encoding=encoding, max_size=max_size)
  File "/share/MD0_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/parsekit.py", line 300, in ElementFromString
    check_size(string, max_size)
  File "/share/MD0_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/parsekit.py", line 23, in check_size
    raise Framework.exceptions.APIException("Data of size %d is greater than the maximum size %d" % (len(data), max_size))
APIException: (2103, 'Data of size 8133895 is greater than the maximum size 5242880')

So in my book, the framework does create an exception in check_size function, if the database is corrupted....

Now above is fine for me, but....

Since it simply throw an exception, I have sadly no way of tracking down the defective element  :(

Would be nice, if the exception @ least told us where it choked, or ?

/T

http://:32400/sections/3/all

Should it not be

http://:32400/library/sections/3/all 

http://:32400/sections/3/all

Should it not be

http://:32400/library/sections/3/all 

Hehehe.....And yes.....When posting, I was typing from memory  :rolleyes:

Code is how ever correct, and framework still has a limit defined as max_size for an element size, which make sense, but leaves 3.Party in the dark here.....

/T

Sorry, I have 0 python knowledge.  I do not understand what you were trying, just saw the bad path.

Sounds like you are trying to determine if there is a bad entry in the database?

Sounds like you are trying to determine if there is a bad entry in the database?

Yes, and track it down, so I can tell the user about it....

And adding:

In order for the user to fix it, so neither PMS, clients nor 3.Party plugin's breaks down, and we end up with a sad user, leaving the Plex sphere, since "It simply doesn't work"

/T

Could you accomplish the same using sqlite and just doing a select statement and seeing where (if) it fails.

Could you accomplish the same using sqlite and just doing a select statement and seeing where (if) it fails.

SQLite is not an option for a bundle on all platforms, sadly.....

It's only accessible from the Windows and the Mac platform, but sadly, all Linux platforms, AFAIK, can't use it....

(And confirmed not working on QNAP)

And trust me...I've been hammering on the mighty Plex door with that for a long time now, since that indeed would open up the Pandora's box

/T

If Linux does not support sqlite, how does it handle it's database?

Well.....For at least QNAP, and Synology as well, Plex hasn't provided an so file req. to include the sqlite library within python.

How they do it, I don't know

I apologize for the silly questions.  I like learning new things.  Just tell me to stop if I'm getting out of hand with these questions.   :D

Looking in the install package for the Synology versions I see sqlite files.  Maybe because the extension is different it looks like the so file is not there?  Or the installer is not installing them properly?  Can you just extract the file and place it in the Plex folder to give you the feature you need?

Synology Intel - libsqlite3.so.0

Synology ARM - libsqlite3.so, libsqlite3.so.0, and libsqlite3.so.0.8.6

Can not check the QNAP version.

Edit:  This is in the 9.11.1 versions.

We need an _sqlite3.so file in the /Resources/Python/lib/python2.7/lib-dynload directory.

Once it's there, all is good. But if not there, you can't do an import

And an update here, if anybody besides MovieFan is following this thread:

As said, I did have an entry that was buggy in the database, but after removing that, my Plex2CSV still refused to work, due to a framework created exception.

So I made a change in the framework, and made the max_size bigger for a small test, and bingo......Plex2CSV could now complete an export  :)

My request does however still stand here.....

Please show in the log the data that the framework chokes on, when generating an exception

Also maybe reevaluate the value of max_size default value

/Tommy

And sad news is, that moving away from the framework, and using native Python calls, made things work....SIGH...

https://forums.plex.tv/topic/103115-rel-plex2csv/?p=763378

/T

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