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

UnpicklingError of the OAuth key #736

Closed
charlesg opened this issue Sep 9, 2024 · 2 comments · Fixed by #737
Closed

UnpicklingError of the OAuth key #736

charlesg opened this issue Sep 9, 2024 · 2 comments · Fixed by #737
Milestone

Comments

@charlesg
Copy link

charlesg commented Sep 9, 2024

This was working very well for months and started failing, sometime in the last 10 days I would think. I checked the GCP project and the credentials are still there, but I now get an UnpicklingErrors trying to run gcalcli. I'm dumping the stack trace below.
I was using the homebrew version, the test below is a freshly installed git clone. I'm getting the same error.

This is running on a MBP M2 Max running Sonoma 14.6.1.

Traceback (most recent call last):
  File "/Users/cgagnon/anaconda3/bin/gcalcli", line 8, in <module>
    sys.exit(main())
  File "/Users/cgagnon/anaconda3/lib/python3.10/site-packages/gcalcli/cli.py", line 151, in main
    gcal.AgendaQuery(start=parsed_args.start, end=parsed_args.end)
  File "/Users/cgagnon/anaconda3/lib/python3.10/site-packages/gcalcli/gcal.py", line 1190, in AgendaQuery
    return self._display_queried_events(start, end)
  File "/Users/cgagnon/anaconda3/lib/python3.10/site-packages/gcalcli/gcal.py", line 1134, in _display_queried_events
    event_list = self._search_for_events(start, end, search)
  File "/Users/cgagnon/anaconda3/lib/python3.10/site-packages/gcalcli/gcal.py", line 1096, in _search_for_events
    event_list.extend(
  File "/Users/cgagnon/anaconda3/lib/python3.10/site-packages/gcalcli/gcal.py", line 1041, in _GetAllEvents
    self.get_events()
  File "/Users/cgagnon/anaconda3/lib/python3.10/site-packages/gcalcli/gcal.py", line 183, in get_events
    return self.get_cal_service().events()
  File "/Users/cgagnon/anaconda3/lib/python3.10/site-packages/gcalcli/gcal.py", line 178, in get_cal_service
    credentials=self._google_auth())
  File "/Users/cgagnon/anaconda3/lib/python3.10/site-packages/gcalcli/gcal.py", line 135, in _google_auth
    self.credentials = pickle.load(gcalcli_oauth)
_pickle.UnpicklingError: invalid load key, '{'.
@dbarnett
Copy link
Collaborator

Good news is I think this was already addressed in #733, bad news is there's not a seamless fix and you'll probably need to redo authentication to get it working again (that change just provides a better error message to explain how to fix it).

@dbarnett
Copy link
Collaborator

Alright, so this wrinkle was still really bugging me so I hacked together a fallback so that people who upgrade and still have the old gcalcli_oauth file should get it converted automatically without having to redo auth.

@dbarnett dbarnett added this to the 4.5 milestone Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants