Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traceback on startup when wrong CalDAV password is stored in preferences #901

Open
symphorien opened this issue Jun 4, 2022 · 2 comments
Labels
bug low-hanging-fruit "Easy picks" suitable for new contributors to tackle plugins Plugins and extra backends priority:high

Comments

@symphorien
Copy link

symphorien commented Jun 4, 2022

When opening gtg0.6 for some reason the caldav password is reset to empty (this is another issue that I will open shortly).

This triggers the following traceback:

GNOME keyring not found, passwords will be not stored after restarting GTG
2022-06-04 15:03:50,119 - INFO - backend_caldav:_do_periodic_import:137 - Running periodic import
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/nix/store/553d7c4xcwp9j1a1gb9cb1s9ry3x1pi9-python3-3.9.13/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/nix/store/553d7c4xcwp9j1a1gb9cb1s9ry3x1pi9-python3-3.9.13/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/core/datastore.py", line 499, in __backend_startup
    backend.start_get_tasks()
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/core/datastore.py", line 694, in start_get_tasks
    self.backend.start_get_tasks()
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/core/interruptible.py", line 38, in new
    return fn(*args)
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/backends/periodic_import_backend.py", line 79, in start_get_tasks
    self._start_get_tasks()
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/backends/periodic_import_backend.py", line 98, in _start_get_tasks
    self.do_periodic_import()
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/core/interruptible.py", line 38, in new
    return fn(*args)
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/backends/backend_caldav.py", line 111, in do_periodic_import
    self._do_periodic_import()
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/backends/backend_caldav.py", line 139, in _do_periodic_import
    self._refresh_calendar_list()
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/backends/backend_caldav.py", line 227, in _refresh_calendar_list
    raise error
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/backends/backend_caldav.py", line 218, in _refresh_calendar_list
    principal = self._dav_client.principal()
  File "/nix/store/q0wikq9am3rm1vg70ky1lxyz8mhcc26y-python3.9-caldav-0.9.1/lib/python3.9/site-packages/caldav/davclient.py", line 362, in principal
    self._principal = Principal(client=self, *largs, **kwargs)
  File "/nix/store/q0wikq9am3rm1vg70ky1lxyz8mhcc26y-python3.9-caldav-0.9.1/lib/python3.9/site-packages/caldav/objects.py", line 404, in __init__
    cup = self.get_property(dav.CurrentUserPrincipal())
  File "/nix/store/q0wikq9am3rm1vg70ky1lxyz8mhcc26y-python3.9-caldav-0.9.1/lib/python3.9/site-packages/caldav/objects.py", line 175, in get_property
    foo = self.get_properties([prop], **passthrough)
  File "/nix/store/q0wikq9am3rm1vg70ky1lxyz8mhcc26y-python3.9-caldav-0.9.1/lib/python3.9/site-packages/caldav/objects.py", line 198, in get_properties
    response = self._query_properties(props, depth)
  File "/nix/store/q0wikq9am3rm1vg70ky1lxyz8mhcc26y-python3.9-caldav-0.9.1/lib/python3.9/site-packages/caldav/objects.py", line 142, in _query_properties
    return self._query(root, depth)
  File "/nix/store/q0wikq9am3rm1vg70ky1lxyz8mhcc26y-python3.9-caldav-0.9.1/lib/python3.9/site-packages/caldav/objects.py", line 160, in _query
    ret = getattr(self.client, query_method)(
  File "/nix/store/q0wikq9am3rm1vg70ky1lxyz8mhcc26y-python3.9-caldav-0.9.1/lib/python3.9/site-packages/caldav/davclient.py", line 410, in propfind
    return self.request(url or self.url, "PROPFIND", props,
  File "/nix/store/q0wikq9am3rm1vg70ky1lxyz8mhcc26y-python3.9-caldav-0.9.1/lib/python3.9/site-packages/caldav/davclient.py", line 590, in request
    raise error.AuthorizationError(url=str(url), reason = reason)
caldav.lib.error.AuthorizationError: AuthorizationError at 'https://radicale.xlumurb.eu', reason Unauthorized
Traceback (most recent call last):
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/gtk/browser/main_window.py", line 1624, in on_backend_needing_interaction
    infobar.set_interaction_request(description, interaction_type, callback)
AttributeError: 'NoneType' object has no attribute 'set_interaction_request'

gtg should handle the authentication error gracefully.

Context: Global generic exception

Traceback (most recent call last):
  File "/nix/store/yj93k4i7pa3klm7bzvvnrmkxajkbp7sk-gtg-0.6/lib/python3.9/site-packages/GTG/gtk/browser/main_window.py", line 1624, in on_backend_needing_interaction
    infobar.set_interaction_request(description, interaction_type, callback)
AttributeError: 'NoneType' object has no attribute 'set_interaction_request'

Software versions:

  • Getting Things GNOME! 0.6.0
  • CPython 3.9.13 (main, May 17 2022, 14:19:07) [GCC 11.3.0]
  • GTK 3.24.34, GLib 2.72.1
  • PyGLib 3.42.1, PyGObject 3.42.1
  • Linux-5.15.41-x86_64-with-glibc2.34
@Neui
Copy link
Contributor

Neui commented Jun 4, 2022

I agree, GTG should handles errors more gracefully in general (like the hamster plugin problem things).

Looking at the last exception, infobar is None, which according to the code is returned by self._new_infobar(), except that it only returns None if self.vbox_toolbars is falsy (such as None), and self.vbox_toolbars is set to an builder object of the same name. Doing a grep for vbox_toolbars just shows me results in the used main_window.py file, but not in any other file (like main_window.ui which I would have expected).
Did something accidentally lost while working on that main_window.ui file?

@nekohayo nekohayo added bug priority:low low-hanging-fruit "Easy picks" suitable for new contributors to tackle plugins Plugins and extra backends labels Jul 10, 2022
@nekohayo nekohayo pinned this issue Aug 24, 2022
@nekohayo nekohayo changed the title Traceback when opening gtg with wrong caldav password stored in preferences Traceback on startup when wrong CalDAV password is stored in preferences Feb 26, 2024
@nekohayo
Copy link
Member

Somewhat related, but presumably not the same: #845

@nekohayo nekohayo unpinned this issue Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug low-hanging-fruit "Easy picks" suitable for new contributors to tackle plugins Plugins and extra backends priority:high
Projects
None yet
Development

No branches or pull requests

3 participants