Situation
Sentry Issue: NUXEO-DRIVE-54E
KeyError: 'local_folder' File "nxdrive\gui\api.py", line 945, in create_account UnboundLocalError: local variable 'local_folder' referenced before assignment File "nxdrive\gui\application.py", line 1694, in _handle_connection File "nxdrive\gui\application.py", line 1649, in _handle_nxdrive_url File "nxdrive\gui\api.py", line 938, in handle_token File "nxdrive\gui\api.py", line 965, in create_account
To reproduce:
- Add an account.
- The browser is opened to login page, the user enters credentials and is redirected to the Nuxeo Drive special startup page.
- The app handles the requests and adds the account.
- Quit the app.
- Refresh the Nuxeo Drive startup page.
- See the crash.
Analysis
It happens when the app is not started. The handling of the custom protocol URL (nxdrive://token/95f2af16-4ff8-4c58-92c6-0441fdca3286/user/Administrator for instance) is done with empty callback_params.
callback_params are set by the app before opening the loging page and here, as the app has not initiated the process itself, it are empty.
Note: the bug was present before 5.2.0 but it was silently suppressed.
Solution
Do nothing when callback_params are empty.
- Is referenced in