robweber / xbmcbackup

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

No module named apiclient.discovery #120

Closed alexhass closed 6 years ago

alexhass commented 6 years ago

I always get this error in logs since I installed the backup software. It also complains on every system reboot about an error.

17:53:46.317 T:140682517800704   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ImportError'>
                                            Error Contents: No module named apiclient.discovery
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/script.xbmcbackup/scheduler.py", line 9, in <module>
                                                from resources.lib.backup import XbmcBackup
                                              File "/storage/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 7, in <module>
                                                from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem,GoogleDriveFilesystem
                                              File "/storage/.kodi/addons/script.xbmcbackup/resources/lib/vfs.py", line 9, in <module>
                                                from pydrive.auth import GoogleAuth
                                              File "/storage/.kodi/addons/script.xbmcbackup/resources/lib/pydrive/auth.py", line 6, in <module>
                                                from apiclient.discovery import build
                                            ImportError: No module named apiclient.discovery
                                            -->End of Python script error report<--
rhermsen commented 6 years ago

@robweber @alexhass

Everyone has this issue (see post 1526 and later on the kodi form). Got the impression that two people solved the issue with using latest git release. (see post 1531, 1535, 1536, but the posts have changed...) Someone mentions that the following 3 add-ons have been receiving updates, just before the issue started (see post 1533):

Googleapi
IMDb scraper
Oauth2client 
robweber commented 6 years ago

Correct, the update to the GoogleAPI caused this. Fix will be pushed tomorrow. Sorry for the issues however it was kind of a chicken and the egg problem regarding dependencies. Just need to cleanup a few things in repo and issue a pull request. I'll try to get it done tonight if possible.

oomasoo commented 6 years ago

Thanks ☺👍

robweber commented 6 years ago

Merge request for repo opened https://github.com/xbmc/repo-scripts/pull/692

seanboy201 commented 6 years ago

How do I fix the error please I'm so stuck on programming my boxes without being able to install my back ups.. I've looked everywhere and I'm at a huge loss if I can't figure this out .. Please help me

robweber commented 6 years ago

Best case would be to just install the lastest zip file from the "master" branch of the repo. I've fixed the issues and issued the pull request for the Kodi repo, kind of just waiting on that approval now for it to replicate out.

seanboy201 commented 6 years ago

Hi rob.. Is it possible u could provide me a download link. For. That adon.. Please cause I'm not sure how to find a different version other then the one that is already installed.. Any help would be great thanks...

On Dec 6, 2017 9:08 AM, "Rob" notifications@github.com wrote:

Best case would be to just install the lastest zip file from the "master" branch of the repo. I've fixed the issues and issued the pull request for the Kodi repo, kind of just waiting on that approval now for it to replicate out.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/robweber/xbmcbackup/issues/120#issuecomment-349649800, or mute the thread https://github.com/notifications/unsubscribe-auth/AgsvsnN-tKLPs4bwXNFX9k8dwIuEsDAzks5s9p_RgaJpZM4Qzf4l .

robweber commented 6 years ago

https://github.com/robweber/xbmcbackup/archive/master.zip

tchirou commented 6 years ago

Hello I have updated using the master zip But I still have an error when I launch kodi I don’t have an error when I manually launch the addon though I haven’t tried to do a backup yet, I will check it makes a planned backup during the night as usual and report back Thanks

tknorris commented 6 years ago

There's also a bug in this build in scheduler.py where if next_run.txt doesn't exist and the scheduler is turned on then nr doesn't get initialized so you get a UnboundLocalError.

                                        Error Type: <type 'exceptions.UnboundLocalError'>
                                        Error Contents: local variable 'nr' referenced before assignment
                                        Traceback (most recent call last):
                                          File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/scheduler.py", line 189, in <module>
                                            BackupScheduler().start()
                                          File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/scheduler.py", line 38, in __init__
                                            if(0 < nr <= time.time() and utils.getSetting('schedule_miss') == 'true'):
                                        UnboundLocalError: local variable 'nr' referenced before assignment
                                        -->End of Python script error report<--

This fix, of course, is to set nr to 0 earlier in the method so this case is covered.

seanboy201 commented 6 years ago

Hi rob I read all that but I don't understand. When I try to make the restore now it won't see the backup file that I have always used to restore my stuff... In stuck any ideas brother?

On Dec 6, 2017 8:50 PM, "tknorris" notifications@github.com wrote:

There's also a bug in this build in scheduler.py where if next_run.txt doesn't exist and the scheduler is turned on then nr doesn't get initialized so you get a UnboundLocalError.

                                    Error Type: <type 'exceptions.UnboundLocalError'>
                                    Error Contents: local variable 'nr' referenced before assignment
                                    Traceback (most recent call last):
                                      File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/scheduler.py", line 189, in <module>
                                        BackupScheduler().start()
                                      File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/scheduler.py", line 38, in __init__
                                        if(0 < nr <= time.time() and utils.getSetting('schedule_miss') == 'true'):
                                    UnboundLocalError: local variable 'nr' referenced before assignment
                                    -->End of Python script error report<--

This fix, of course, is to set nr to 0 earlier in the method so this case is covered.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/robweber/xbmcbackup/issues/120#issuecomment-349836083, or mute the thread https://github.com/notifications/unsubscribe-auth/Agsvsr9xv0ZWPztue5j2fTxyqkbPUpsjks5s90RogaJpZM4Qzf4l .

tchirou commented 6 years ago

Ok the add on did nothing at 3am like if there was no planification

robweber commented 6 years ago

@tknorris - created issue #124 . This feature was added in the newest release.

For other issues please post a debug log if you're continuing to get errors. You should not be getting the same apiclient.discovery error with this version (assuming deps are updated on your system). I'm getting lots of "yes this works" messages via the Kodi forum using the same zip file.

tchirou commented 6 years ago

Hello

Please find the log when I laucnh Kodi with the updated zip version

`15:46:30.470 T:138418295888 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

Thanks

EDIT : allright just saw that this was the same error than above, So I downloaded the latest zip and I willl update Kodi when I come back home

Thanks

seanboy201 commented 6 years ago

Its still not working. For me blahhh

On Dec 7, 2017 9:56 AM, "tchirou" notifications@github.com wrote:

Hello

Please find the log when I laucnh Kodi with the updated zip version

15:46:30.470 T:138418295888 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.UnboundLocalError'> Error Contents: local variable 'nr' referenced before assignment Traceback (most recent call last): File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/. kodi/addons/script.xbmcbackup/scheduler.py", line 189, in BackupScheduler().start() File "/storage/emulated/0/Android/ data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/scheduler.py", line 38, in init if(0 < nr <= time.time() and utils.getSetting('schedule_miss') == 'true'): UnboundLocalError: local variable 'nr' referenced before assignment -->End of Python script error report<--``

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/robweber/xbmcbackup/issues/120#issuecomment-349991267, or mute the thread https://github.com/notifications/unsubscribe-auth/AgsvslI36ljEEIe3GcPC9tRS-J1GkAVNks5s9_yvgaJpZM4Qzf4l .

robweber commented 6 years ago

Did you pull the latest git? I pushed some fixes for the scheduler just yesterday.

seanboy201 commented 6 years ago

Yes i installed. The newest one u gave. Me but problem im having is that when i got to restore it says the directory i chose is empty. Even though its the same directory i always use to compleate the backup

On Dec 9, 2017 10:01 PM, "Rob" notifications@github.com wrote:

Did you pull the latest git? I pushed some fixes for the scheduler just yesterday.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/robweber/xbmcbackup/issues/120#issuecomment-350521608, or mute the thread https://github.com/notifications/unsubscribe-auth/AgsvsoPP99GB29_niaYRZnjDA46e1SQ9ks5s-0mhgaJpZM4Qzf4l .

robweber commented 6 years ago

The fix for this is merged so closing now. @seanboy201 - I created issue #125 to work on your problem as that is not related to this error.