xbmclibraryautoupdate icon indicating copy to clipboard operation
xbmclibraryautoupdate copied to clipboard

Crash on Manual run of version 1.2.5

Open dwardor opened this issue 1 year ago • 2 comments

I'm using version 1.2.5 on Kodi 20.2.0.

Manual launching [from addons/program addons/Library Auto Update/Yes] says 'Library Auto Update erro : Check the log for more information".

Here is what the log says:

2023-12-17 13:56:37.465 T:4254    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'NoneType' object has no attribute 'screensaver_running'
                                                   Traceback (most recent call last):
                                                     File "/home/dwardo/.kodi/addons/service.libraryautoupdate/manual.py", line 21, in <module>
                                                       autoUpdate.evalSchedules(True)
                                                     File "/home/dwardo/.kodi/addons/service.libraryautoupdate/resources/lib/service.py", line 77, in evalSchedules
                                                       if(not utils.getSettingBool('run_on_idle') or (utils.getSettingBool('run_on_idle') and (self.monitor.screensaver_running or manual))):
                                                                                                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                   AttributeError: 'NoneType' object has no attribute 'screensaver_running'
                                                   -->End of Python script error report<--

Available for any extra information or testing

Thanky ou for the Addon

dwardor avatar Dec 17 '23 13:12 dwardor

I'm getting the same issue with 1.2.5

It seems to me that this commit caused the problem:- https://github.com/robweber/xbmclibraryautoupdate/commit/1c8b1d780b66461409ca940019532767bc526775#diff-5e11fb413379dbd7a2601ee5f54ce83d00120ce75c140610e99aef4433f6f24b

Moving self.monitor from init to runProgram(self) means that the attribute self.monitor.screensaver_running is not initialized properly and therefore returns 'monitor = None' when performing a manual run via autoUpdate.evalSchedules(True) in manual.py

Apologies if my diagnosis is worded badly - I'm not a Python programmer. I've reverted to 1.2.4 and the problem is not there. It would be good to get this fixed ;)

Alan111S avatar Aug 15 '24 09:08 Alan111S

Thanks for pointing this out. Moving the monitor initialization was done to stop it from being setup when not needed (and then sitting in memory) however now it looks like that's introduced a whole new problem. I think you're right this is probably the root of the issue though.

robweber avatar Aug 15 '24 15:08 robweber