PiotrMachowski / Home-Assistant-custom-components-Google-Keep

This sensor uses gkeepapi library to download a list of notes from https://keep.google.com/.
MIT License
66 stars 8 forks source link

Parse error in <class 'gkeepapi.node.NodeTimestamps'> #11

Closed mikaellindemann closed 4 years ago

mikaellindemann commented 4 years ago

After updating to the new version from HACS this morning, I still have a lot of errors in my HA logs:

Logger: homeassistant.helpers.entity
Source: custom_components/google_keep/sensor.py:85
First occurred: 6.34.32 (51 occurrences)
Last logged: 7.00.53

Update for sensor.google_keep_164fa6865c fails

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/gkeepapi/node.py", line 213, in load self._load(raw)
File "/usr/local/lib/python3.7/site-packages/gkeepapi/node.py", line 622, in _load self._created = self.str_to_dt(raw['created']) 
KeyError: 'created'

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

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/google_keep/sensor.py", line 85, in update self._keep.sync()
File "/usr/local/lib/python3.7/site-packages/gkeepapi/__init__.py", line 1034, in sync self._parseNodes(changes['nodes'])
File "/usr/local/lib/python3.7/site-packages/gkeepapi/__init__.py", line 1064, in _parseNodes node.load(raw_node)
File "/usr/local/lib/python3.7/site-packages/gkeepapi/node.py", line 213, in load self._load(raw)
File "/usr/local/lib/python3.7/site-packages/gkeepapi/node.py", line 1192, in _load super(TopLevelNode, self)._load(raw)
File "/usr/local/lib/python3.7/site-packages/gkeepapi/node.py", line 1045, in _load self.timestamps.load(raw['timestamps'])
File "/usr/local/lib/python3.7/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.7/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.NodeTimestamps'>

It typically refreshes successfully on HA start, but never updates after that.

tamas-czirjak-epam commented 4 years ago

I have the same problem with a very simple configuration:

- platform: google_keep
  username: hiddenemail@gmail.com
  password: "hiddenpassword"
  labels:
    - 'Home Assistant'
  pinned: true
PiotrMachowski commented 4 years ago

Please check if error still exists in the v1.0.2

mikaellindemann commented 4 years ago

Seems to have solved the issue for me, thanks 😊