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

Getting Missing KeyError 'email' in self._collaborators #19

Closed
gpitel opened this issue Oct 15, 2021 · 4 comments
Closed

Getting Missing KeyError 'email' in self._collaborators #19

gpitel opened this issue Oct 15, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@gpitel
Copy link

gpitel commented Oct 15, 2021

Last week the Google Keep integration stopped working. I have uninstalled a installed again a few times without luck, and rebooted HA even more. The yaml settings and log output are provided below. I am using:

SYSTEM (10/15/2021)
core-2021.10.4
supervisor-2021.10.0
Home Assistant OS 6.5

Great work with the plugin by the way. My family uses this for a HA dashboard, which from the looks of the key error (collaborator + email), maybe Google changed their API regarding Keep Collaborators on their side?

CONFIG

  - platform: google_keep
    username: [email protected]
    password: secret
    titles:
      - 'Home Tasks'
    pinned: false

ERROR LOG

Logger: homeassistant.components.sensor
Source: custom_components/google_keep/sensor.py:39
Integration: Sensor (documentation, issues)
First occurred: October 14, 2021, 2:05:48 AM (1 occurrences)
Last logged: October 14, 2021, 2:05:48 AM

Error while setting up google_keep platform for sensor
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/node.py", line 213, in load
    self._load(raw)
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/node.py", line 1200, in _load
    self.collaborators.load(
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/node.py", line 837, in load
    self._collaborators[collaborator['email']] = RoleValue(collaborator['role'])
KeyError: 'email'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/google_keep/sensor.py", line 39, in setup_platform
    login_success = keep.login(username, password)
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/__init__.py", line 695, in login
    self.load(auth, state, sync)
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/__init__.py", line 741, in load
    self.sync(True)
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/__init__.py", line 994, in sync
    self._sync_notes(resync)
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/__init__.py", line 1042, in _sync_notes
    self._parseNodes(changes['nodes'])
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/__init__.py", line 1078, in _parseNodes
    node = _node.from_json(raw_node)
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/node.py", line 1856, in from_json
    node.load(raw)
  File "/usr/local/lib/python3.9/site-packages/gkeepapi/node.py", line 215, in load
    raise_from(exception.ParseException('Parse error in %s' % (type(self)), raw), e)
  File "/usr/local/lib/python3.9/site-packages/future/utils/__init__.py", line 403, in raise_from
    exec(execstr, myglobals, mylocals)
  File "<string>", line 1, in <module>
gkeepapi.exception.ParseException: Parse error in <class 'gkeepapi.node.Note'>
@gpitel gpitel changed the title Getting Missing Key Error Getting Missing KeyError 'email' in self._collaborators Oct 15, 2021
@PiotrMachowski PiotrMachowski self-assigned this Oct 15, 2021
@PiotrMachowski PiotrMachowski added the bug Something isn't working label Oct 15, 2021
@PiotrMachowski
Copy link
Owner

Could you try to update manifest to the following version and restart your HA?

{
  "domain": "google_keep",
  "name": "Google Keep",
  "documentation": "https://github.com/PiotrMachowski/Home-Assistant-custom-components-Google-Keep",
  "dependencies": [],
  "codeowners": ["@PiotrMachowski"],
  "requirements": ["gkeepapi==0.13.6"],
  "version": "v1.1.1"
}

@gpitel
Copy link
Author

gpitel commented Oct 16, 2021

I changed the manifest located in directory

\\xx.168.1.xx\config\custom_components\google_keep

The json before was:

{
  "domain": "google_keep",
  "name": "Google Keep",
  "documentation": "https://github.com/PiotrMachowski/Home-Assistant-custom-components-Google-Keep",
  "dependencies": [],
  "codeowners": ["@PiotrMachowski"],
  "requirements": ["gkeepapi==0.11.16"],
  "version": "v1.1.1"
}

Upon reset I am still getting the same email/collaborator error.

@PiotrMachowski
Copy link
Owner

Ok, so it seems like an issue with gkeepapi

@gpitel
Copy link
Author

gpitel commented Jun 29, 2022

I got around this problem a while ago. Not sure what the exact fix was... rolling back to an older version, re-installing, etc.
#26 is the more immediate issue I am dealing with now

@gpitel gpitel closed this as completed Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants