robweber / xbmcbackup

Backup Addon for Kodi
MIT License
113 stars 48 forks source link

Backup restore fails on 1.7.0 - Kodi V21.0 final (android) #235

Closed cods69 closed 7 months ago

cods69 commented 7 months ago

Describe the problem Posted for visibility for dev - Has been discussed by other users here - https://forum.kodi.tv/showthread.php?tid=129499&pid=3193729#pid3193729 Backed up fine as normal compressed archive (I've done this backup/restore many, many times), but the zipped file is not visible after transferring to the destination, from the Backup addon.

NOTE- restore attempt was done on clean install (v21.0) with only addon Backup installed, restoring to 5 profiles (already created and empty, as per 19.5 process I've used for a long time).

Platform and Kodi version Kodi v21.0 final - Android (NVidia Shield 2019 pro, also 2017 pro tested)

Link to Debug Log https://paste.kodi.tv/tomijoneqe

craigehicks commented 7 months ago

Backup/Restore to external server using SMB. Using compressed zip. After upgrade to Kodi 21, Kodi backup works, Kodi Restore fails with error:

2024-04-28 13:58:23.015 T:23654   error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--                                                     - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!                                                    Error Type: <class 'KeyError'>                                                    Error Contents: 'is_dir'                                                    Traceback (most recent call last):                                                      File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/default.py", line 136, in                                                        backup.restore()                                                      File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 235, in restore                                                        self._copyFiles(zipFile, self.remote_vfs, self.xbmc_vfs)                                                      File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 424, in _copyFiles                                                        if(aFile['is_dir']):                                                           ~^^^^^^^^^^                                                    KeyError: 'is_dir'                                                    -->End of Python script error report<--

Kodi running on Android TV OS 10 Kernel: 4.19.75 ​​​​​​​Build: BRAVIA_UR2_4K_PA-user 10 QTG3.200305.006.S44

brozikcz commented 7 months ago

the same issue

2024-04-28 14:30:32.499 T:21675   error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'KeyError'>
                                                   Error Contents: 'is_dir'
                                                   Traceback (most recent call last):
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/default.py", line 136, in <module>
                                                       backup.restore()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 235, in restore
                                                       self._copyFiles(zipFile, self.remote_vfs, self.xbmc_vfs)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 424, in _copyFiles
                                                       if(aFile['is_dir']):
                                                          ~~~~~^^^^^^^^^^
                                                   KeyError: 'is_dir'
                                                   -->End of Python script error report<--
robweber commented 7 months ago

Looks like this is a consequence from 780f0f8401f1b40a0fb8a7df7c6c1ffa11ce8f52. When adding the zip file the is_dir attribute needs to be set. Surprised this didn't show during testing but I probably just missed restoring from a zip.