[RELEASE] Texture Cache Maintenance utility
(2019-02-14, 12:35)Yuren Wrote: log files


It seems to me that I don't have problem with file systems.
However I ran your script with administrator privileges

This night I ran the script for 6 hours with the same result

I don't think your tc.log file is complete as I don't see anything logged for the final request which is the cause of the problem.

For some reason Kodi is not able to parse one of your directory paths - based on the kodi.log, Kodi is choking on on the following Files.GetDirectory request:

2019-02-14 11:16:38.141 T:11528 ERROR: JSONRPC: Failed to parse '{"method": "Files.GetDirectory", "params": {"directory": "W:\\torrent\\[TV Rip ITA}Alla Ricerca Della Valle Incantata 2 - Le Avventure Della Grande Vallata\\", "media": "files", "properties": ["file", "lastmodified"]}'

In the tc.log you submitted I don't see this request being logged (and the request is logged before it is sent to kodi), or any response. If Kodi did not return any response then that might explain why the script is hung, as it is waiting for a response it will never receive.

In my own testing I see this:

[email protected]:~/projects/texturecache.py$ ./texturecache.py directory "W:\\torrent\\[TV Rip ITA}Alla Ricerca Della Valle Incantata 2 - Le Avventure Della Grande Vallata\\"
^C
[email protected]:~/projects/texturecache.py$ tail -10 /tmp/tc.log
"extrajson.tvshows.tvshow": "plot, rating, cast, file, imdbnumber",
"extrajson.vgenres": null
}
}
2019-02-14 23:17:04.353676:MainThread: libDirectory.JSON SOCKET REQUEST: [{"jsonrpc": "2.0", "params": {"directory": "W:\\torrent\\[TV Rip ITA}Alla Ricerca Della Valle Incantata 2 - Le Avventure Della Grande Vallata\\", "media": "files", "properties": ["file", "lastmodified"]}, "method": "Files.GetDirectory", "id": "libDirectory"}]
2019-02-14 23:17:04.355099:MainThread: RPC connection established with IPv4
2019-02-14 23:17:04.356254:MainThread: libDirectory.BUFFER RECEIVED (len 76)
2019-02-14 23:17:04.356328:MainThread: libDirectory.PARSING JSON DATA: {"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"}
2019-02-14 23:17:04.356375:MainThread: libDirectory.PARSING COMPLETE, elapsed time: 0.000056 seconds
2019-02-14 23:17:04.356412:MainThread: libDirectory.READING SOCKET FOR A RESPONSE...

The important part of the response is "id":null which means that the texturecache.py script is not able to match the response with the request, so the script continues waiting for the response with "id": "libDirectory" (which never comes).

It does appear that the JSON-RPC interface cannot parse requests with properties that include }, for example the following will cause a Kodi parse failure exactly as you have found:

[email protected]:~/projects/texturecache.py$ ./texturecache.py directory "/storage/json/ab}c"
^C
[email protected]:~/projects/texturecache.py$ tail -10 /tmp/tc.log
"extrajson.tvshows.tvshow": "plot, rating, cast, file, imdbnumber",
"extrajson.vgenres": null
}
}
2019-02-14 23:31:48.705037:MainThread: libDirectory.JSON SOCKET REQUEST: [{"jsonrpc": "2.0", "params": {"directory": "/storage/json/ab}c", "media": "files", "properties": ["file", "lastmodified"]}, "method": "Files.GetDirectory", "id": "libDirectory"}]
2019-02-14 23:31:48.706518:MainThread: RPC connection established with IPv4
2019-02-14 23:31:48.707869:MainThread: libDirectory.BUFFER RECEIVED (len 76)
2019-02-14 23:31:48.707951:MainThread: libDirectory.PARSING JSON DATA: {"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"}
2019-02-14 23:31:48.707999:MainThread: libDirectory.PARSING COMPLETE, elapsed time: 0.000068 seconds
2019-02-14 23:31:48.708039:MainThread: libDirectory.READING SOCKET FOR A RESPONSE...

Yet the same request to the Kodi web server succeeds:

$ curl -s --data-binary '{"jsonrpc": "2.0", "params": {"directory": "/storage/json/ab}c", "media": "files", "properties": ["file", "lastmodified"]}"method": "Files.GetDirectory", "id": "libDirectory"}' -H 'content-type: application/json;' http://192.168.0.18:8080/jsonrpc; echo
{"id":"libDirectory","jsonrpc":"2.0","result":{"files":[{"file":"/storage/json/ab}c/testfile2.txt","filetype":"file","label":"testfile2.txt","lastmodified":"2019-02-14 22:44:13","type":"unknown"}],"limits":{"end":1,"start":0,"total":1}}}

So this looks like a Kodi/JSON-RPC bug.

I would suggest you open an issue on the Kodi github as Kodi should be parsing this request, but fails because it contains } which doesn't require escaping in JSON, so this looks like a parsing bug in Kodi.

Edit: This doesn't appear to be a Kodi 18 bug, as it is also present in Kodi 17.6 (LibreELEC 8.2.5).
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
 
Thread Rating:
  • 17 Vote(s) - 4.76 Average


Messages In This Thread
Crash on Gotham on OS X - by desepticon - 2014-05-29, 17:57
Cleaning - by AleisterHH - 2018-05-28, 22:03
RE: Cleaning - by Milhouse - 2018-05-28, 22:16
qax genre not updated - by Just-Me_A-User - 2018-06-12, 22:06
RE: qax genre not updated - by Milhouse - 2018-06-12, 23:40
RE: [RELEASE] Texture Cache Maintenance utility - by Milhouse - 2019-02-15, 01:40


Logout Mark Read Team Forum Stats Members Help
[RELEASE] Texture Cache Maintenance utility4.7617