• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 11
[Release] Common plugin cache
#61
Hello jarryd,
thanks for that. I will try your proposal ;-).
regards,

Andre

Unfortunately it didnt help. Here is the debug extract with your patch. But at least the error in SotrageServer.py is gone:

13:21:58 T:2957119488 INFO: -->Python script returned the following error<--
13:21:58 T:2957119488 ERROR: Error Type: <type 'exceptions.IndentationError'>
13:21:58 T:2957119488 ERROR: Error Contents: ('unexpected indent', ('/Users/andrkuhn/Library/Application Support/XBMC/addons/script.common.plugin.cache/lib/StorageServer.py', 142, 16, ' if self.xbmcvfs.exists(self.socket) and check_stale:\n'))
13:21:58 T:2957119488 ERROR: Traceback (most recent call last):
File "/Users/andrkuhn/Library/Application Support/XBMC/addons/script.common.plugin.cache/default.py", line 40, in <module>
run()
File "/Users/andrkuhn/Library/Application Support/XBMC/addons/script.common.plugin.cache/default.py", line 31, in run
import StorageServer
IndentationError: ('unexpected indent', ('/Users/andrkuhn/Library/Application Support/XBMC/addons/script.common.plugin.cache/lib/StorageServer.py', 142, 16, ' if self.xbmcvfs.exists(self.socket) and check_stale:\n'))
13:21:58 T:2957119488 INFO: -->End of Python script error report<--
Reply
#62
Because you didn't change it it like it should
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#63
Ok, Python wasnt working as expected as I commented out the original line. This seem to be not working. I deleted the commeted line, now it works. What the heck *wondering*. Commenting works on other lines...
Anyway, thanks for the help!
Reply
#64
will the maintainer of this addon please FIXIT Smile
Reply
#65
(2013-01-05, 14:18)bigcookie Wrote: 13:21:58 T:2957119488 ERROR: Error Contents: ('unexpected indent', ('/Users/andrkuhn/Library/Application Support/XBMC/addons/script.common.plugin.cache/lib/StorageServer.py', 142, 16, ' if self.xbmcvfs.exists(self.socket) and check_stale:\n'))

There's your clue as to what's wrong. Line indentations in Python are not merely cosmetic, they are functional. Don't mess with the original indentation of the line you were modifying (or with any other line in that script).

Reply
#66
Guys,

What's the current status of the addon? I was looking to include it in mine, but not if it broken, or prone to extended periods of being broken.

I see lots of issues, but I'm not sure whether this is a issue with the current version, or some testing version.
Reply
#67
I use this a lot, it's a god send :-), there were some issues the past week or so but I think it's all good now. Only once, I think it was the second revision, I had to make updates to my code.
Reply
#68
Thanks - I'll put some time aside then to integrating this into my addon.
Reply
#69
I am running Frodo stable on Linux (Ubuntu), and I was experiencing the "Operation not permitted" error on "sock.bind(self.socket)".

It turns out that I caused this error by locating my ~/.xbmc user directory on a FAT32 partition.

(I had moved my ~/.xbmc folder to a FAT32 drive to save space. Now, I have moved only ~/.xbmc/userdata, keeping the rest of the ~/.xbmc directory on an EXT4 partition and all is working well.)

I'm posting this in case anybody has a similar error.

I believe the check for win32 in StorageServer._sock_init is for this reason. Perhaps this check could be made more robust to avoid this problem.
Reply
#70
Is there anyway to invalidate the cache, so I can force a refresh. I've started using caching, but would like to have the option of performing a refresh before the cache has expired?
Add-on:PleXBMC (wiki) - Play Plex media through XBMC
PleXBMC Helper - Integrate Official/Unoffical Plex remote control apps into PleXBMC
PleXBMC Repository - install and manage all PleXBMC addons
Quartz3 PleXBMC - Integrate PleXBMC into home menus
Reply
#71
I'll answer my own questions - depends.

If you use the cache to store individual pieces of information - yes.
But if you use the cacheFunction.- no.

It looks like the issue would be to reconstruct the hash value, as it's based on the arguments passed to the function.

So you can either delete all items for a function, or delete the cache for a specific instance of that function.

I've written a patch for the latter - introducing a new function - but I'm not sure who owns this plugins? Or whether it's still actively in development?
Add-on:PleXBMC (wiki) - Play Plex media through XBMC
PleXBMC Helper - Integrate Official/Unoffical Plex remote control apps into PleXBMC
PleXBMC Repository - install and manage all PleXBMC addons
Quartz3 PleXBMC - Integrate PleXBMC into home menus
Reply
#72
Since updating to Frodo I get a script error on every start of XBMC:
NameError: global name 'sqlite' is not defined

Full log with "debug" activated in the Common Plugin Cache:
http://pastebin.com/h1psRPNJ


Any ideas how to fix that?
Reply
#73
I get the exact same error on raspberry pi
Reply
#74
I have an issue with this script, when xbmc is started while UMS or PMS is already running, it tries to use the same socketadress:

21:40:07 T:4132 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'socket.error'>
Error Contents: (10048, 'Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden')
Traceback (most recent call last):
File "C:\Users\a\AppData\Roaming\XBMC\addons\script.common.plugin.cache\default.py", line 40, in <module>
run()
File "C:\Users\a\AppData\Roaming\XBMC\addons\script.common.plugin.cache\default.py", line 35, in run
s.run()
File "C:\Users\a\AppData\Roaming\XBMC\addons\script.common.plugin.cache/lib\StorageServer.py", line 197, in run
sock.bind(self.socket)
File "<string>", line 1, in bind
error: (10048, 'Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden')
-->End of Python script error report<--


how could this be fixed?

I fixed it for me by modifying StorageServer.py, that before creating a server socket it first checks if the default port is available - if not it increments the port..
I'm sure there are better ways to accomplish this, since i'm not used to python, maybe this could be added in the next version.
Here is solution working for me:

def _sock_init(self, check_stale=False):
self._log("", 2)
if not self.socket or check_stale:
self._log("Checking", 4)
if self.platform == "win32":
self._log("Windows", 4)
port = 59994
#201303 Test, ob Port bereits angelegt ist....
for sp in range(0, 10):
st = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
if st.connect_ex(("127.0.0.1", port)) == 0:
self._log("Port: " + str(port) + "bereits verwendet!", 4)
st.close()
# nächster Port versuchen
port = port + 1
else:
self._log("Port: " + str(port) + "noch frei!", 4)
st.close()
break
#201303 Ende Port-Test entweder erfolgreich, oder nach 10 Versuchen aufgegeben...
self.socket = ("127.0.0.1", port)
else:
self._log("POSIX", 4)
self.socket = os.path.join(self.xbmc.translatePath('special://temp/').decode("utf-8"), 'commoncache.socket')
if self.xbmcvfs.exists(self.socket) and check_stale:
self._log("Deleting stale socket file : " + self.socket)
self.xbmcvfs.delete(self.socket)

self._log("Done: " + repr(self.socket), 2)
Reply
#75
@Domin (and others who get the "NameError: global name 'sqlite' is not defined" error): The "problem" is, that we use sqlite3 and not sqlite anymore and the devlopers missed to rewrite the "except" to cover that. So the first thing that needs to be done is change line 116 of the StorageServer.py from
Code:
except sqlite.Error, e:
to
Code:
except Exception, e:
This fixes the crash shown in our logs that the "sqlite" name is not defined.

After changing the code restart XBMC and you should now see a new message in your logs (the cause why it catched an Exception in the first place).
In my case the new exception was this:
Code:
[StorageServer-2.5.0] '_startDB' : 'sql3 - C:\Users\My Username\AppData\Roaming\XBMC\userdata\addon_data\script.common.plugin.cache\commoncache.db'
[StorageServer-2.5.0] '_startDB' : 'Exception: OperationalError('unable to open database file',)'

The problem here is that the database file could not be created, but I wasn't able to find the error in the code. Still was able to get rid of this error by simply creating the folder mentioned above manually (C:\Users\My Username\AppData\Roaming\XBMC\userdata\addon_data\script.common.plugin.cache). After that everything worked as expected.

tl;dr: In line 116 of StorageServer.py replace "sqlite.Error" with "Exception" and create a folder called "script.common.plugin.cache" in your "addon_data" folder.
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 11

Logout Mark Read Team Forum Stats Members Help
[Release] Common plugin cache1