robweber / xbmcbackup

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

Error authorizing Dropbox #200

Closed megazone23 closed 3 years ago

megazone23 commented 3 years ago

Before working on a new issue I'm probably going to ask you all this stuff anyway, probably just easier to provide it now.....

Describe the problem When the Authorize Now is selected a popup is displayed

Dropbox Developer Code Needed Visit https://www.dropbox.com/developers

Platform and Kodi version 19.0.0

Link to Debug Log Not much in the log the authorize url never shows up.

2021-06-20 10:01:37.665 T:10160 DEBUG : script.xbmcbackup-1.6.7: launcher 2021-06-20 10:01:37.666 T:10160 DEBUG : script.xbmcbackup-1.6.7: authorize_cloud 2021-06-20 10:01:37.666 T:10160 DEBUG : script.xbmcbackup-1.6.7: dropbox 2021-06-20 10:01:37.680 T:10160 DEBUG : requested setting (auth_google_button) was not found. 2021-06-20 10:01:37.680 T:10160 DEBUG : requested setting (backup_custom_dir_1) was not found. 2021-06-20 10:01:37.680 T:10160 DEBUG : requested setting (backup_custom_dir_2) was not found. 2021-06-20 10:01:37.680 T:10160 DEBUG : requested setting (custom_dir_1_enable) was not found. 2021-06-20 10:01:37.680 T:10160 DEBUG : requested setting (custom_dir_2_enable) was not found. 2021-06-20 10:01:37.680 T:10160 DEBUG : requested setting (google_drive_id) was not found. 2021-06-20 10:01:37.680 T:10160 DEBUG : requested setting (google_drive_secret) was not found. 2021-06-20 10:01:37.681 T:10160 DEBUG : script.xbmcbackup-1.6.7: Starting 2021-06-20 10:01:37.687 T:38840 DEBUG : ------ Window Init (DialogConfirm.xml) ------

robweber commented 3 years ago

How are you setting up the Dropbox authorization? Did you follow the steps from the wiki and still have issues? The part most people slip up on is that you have to put in your Dropbox information, hit save, then re-enter the settings to authorize. Kodi has to save the values before the authorize app can pull them to use in the authorization flow. The prompt you are seeing is likely because it can't find the settings.

megazone23 commented 3 years ago

I tried it again, the key and secret are in the dialog. When I select "Authorize Now", a popup message appears which says "Authorize this remote service in the settings first". The log file does not contain the tiny url as mentioned in the wiki.

The only thing which shows up in the log when the "Authorize Now" is selected is the following:

2021-07-05 14:50:50.689 T:28060 INFO <general>: Loading skin file: DialogAddonSettings.xml, load type: KEEP_IN_MEMORY 2021-07-05 14:51:00.038 T:13688 INFO <general>: CPythonInvoker(6, C:\Users\rk609048\AppData\Roaming\Kodi\addons\service.xbmc.versioncheck\resources\lib\runner.py): script successfully run 2021-07-05 14:51:00.175 T:13688 INFO <general>: Python interpreter stopped 2021-07-05 14:51:45.849 T:23792 INFO <general>: initializing python engine. 2021-07-05 14:51:48.900 T:28060 INFO <general>: Loading skin file: DialogConfirm.xml, load type: KEEP_IN_MEMORY

megazone23 commented 3 years ago

Here is what happens right after clicking "Authorize Now" with debug turned on...

2021-07-05 14:59:36.910 T:28060 DEBUG : CInputManager::ProcessMouse: trying mouse action leftclick 2021-07-05 14:59:36.911 T:2352 DEBUG : Thread LanguageInvoker start, auto delete: false 2021-07-05 14:59:36.911 T:2352 INFO : initializing python engine. 2021-07-05 14:59:36.912 T:2352 DEBUG : CPythonInvoker(12, C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.xbmcbackup\default.py): start processing 2021-07-05 14:59:37.064 T:2352 DEBUG : -->Python Interpreter Initialized<-- 2021-07-05 14:59:37.065 T:2352 DEBUG :

2021-07-05 14:59:37.065 T:2352 DEBUG : CPythonInvoker(12, C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.xbmcbackup\default.py): the source file to load is "C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.xbmcbackup\default.py" 2021-07-05 14:59:37.065 T:2352 DEBUG : CPythonInvoker(12, C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.xbmcbackup\default.py): setting the Python path to C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.xbmcbackup;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.certifi\lib;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.chardet\lib;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.dateutil\lib;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.dropbox\lib;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.future\lib;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.idna\lib;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.pyqrcode\lib;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.requests\lib;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.six\lib;C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.module.urllib3\lib;C:\Program Files\WindowsApps\XBMCFoundation.Kodi_19.0.500.0_x644n2hpmxwrvr6p\system\python\Lib;C:\Program Files\WindowsApps\XBMCFoundation.Kodi_19.0.500.0_x644n2hpmxwrvr6p\python3.8.zip;C:\Program Files\WindowsApps\XBMCFoundation.Kodi_19.0.500.0_x644n2hpmxwrvr6p\system\python\DLLs;C:\Program Files\WindowsApps\XBMCFoundation.Kodi_19.0.500.0_x644n2hpmxwrvr6p;C:\Program Files\WindowsApps\XBMCFoundation.Kodi_19.0.500.0_x644n2hpmxwrvr6p\system\python;C:\Program Files\WindowsApps\XBMCFoundation.Kodi_19.0.500.0_x644n2hpmxwrvr6p\system\python\lib\site-packages 2021-07-05 14:59:37.065 T:2352 DEBUG : CPythonInvoker(12, C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.xbmcbackup\default.py): entering source directory C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.xbmcbackup 2021-07-05 14:59:37.073 T:2352 DEBUG : CPythonInvoker(12, C:\Users\rk609048\AppData\Roaming\Kodi\addons\script.xbmcbackup\default.py): instantiating addon using automatically obtained id of "script.xbmcbackup" dependent on version 3.0.0 of the xbmc.python api 2021-07-05 14:59:39.909 T:2352 DEBUG : script.xbmcbackup-1.6.7: launcher 2021-07-05 14:59:39.910 T:2352 DEBUG : script.xbmcbackup-1.6.7: authorize_cloud 2021-07-05 14:59:39.910 T:2352 DEBUG : script.xbmcbackup-1.6.7: dropbox 2021-07-05 14:59:39.920 T:2352 DEBUG : requested setting (auth_google_button) was not found. 2021-07-05 14:59:39.920 T:2352 DEBUG : requested setting (backup_custom_dir_1) was not found. 2021-07-05 14:59:39.920 T:2352 DEBUG : requested setting (backup_custom_dir_2) was not found. 2021-07-05 14:59:39.920 T:2352 DEBUG : requested setting (custom_dir_1_enable) was not found. 2021-07-05 14:59:39.920 T:2352 DEBUG : requested setting (custom_dir_2_enable) was not found. 2021-07-05 14:59:39.920 T:2352 DEBUG : requested setting (google_drive_id) was not found. 2021-07-05 14:59:39.920 T:2352 DEBUG : requested setting (google_drive_secret) was not found. 2021-07-05 14:59:39.927 T:28060 DEBUG : ------ Window Init (DialogConfirm.xml) ------ 2021-07-05 14:59:43.613 T:28060 DEBUG : ------ Window Deinit (Pointer.xml) ------

robweber commented 3 years ago

Thanks for doing that additional testing. I did confirm based on your info that there was sort of a weird "catch22" situation happening during the authorization flow. The main Backup program was trying to initialize the Dropbox file system prior to the authorization flow being given a chance to run. I moved this to later in the flow to fix the issue so authorization can happen first without error. Pushing to the GitHub now and will get it in the Kodi repo soon.

robweber commented 2 years ago

There is a PR open for this, will close when it's merged: https://github.com/xbmc/repo-scripts/pull/2198