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

Update for Sensor Fails #9

Closed
austwhite opened this issue May 7, 2020 · 13 comments
Closed

Update for Sensor Fails #9

austwhite opened this issue May 7, 2020 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@austwhite
Copy link

austwhite commented May 7, 2020

I have just started noticing this since updating to Home Assistant 0.109.x I am unsure if it was present before as I had not kept a close eye on the logs.
Getting an error "Update for sensor sensor.google_keep_xxxxx fails" fairly regularly.

Logger: homeassistant.helpers.entity
Source: custom_components/google_keep/sensor.py:85
First occurred: 4:22:37 PM (1 occurrences)
Last logged: 4:22:37 PM

 Update for sensor.google_keep_30d2008fe5 fails

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 1019, in sync
    labels=[i.save() for i in self._labels.values()] if labels_updated else None,
  File "/usr/local/lib/python3.7/site-packages/gkeepapi/__init__.py", line 359, in changes
    json=params
  File "/usr/local/lib/python3.7/site-packages/gkeepapi/__init__.py", line 221, in send
    response = self._send(**req_kwargs).json()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Any advice on what may be causing this?

Edit: Should have noted, I have installed the component via HACS and it is at version 1.0.0. HACS does not report any update available for the component.

@remdot
Copy link

remdot commented May 7, 2020

I'm getting the same error, started this morning.

@yguns31
Copy link

yguns31 commented May 7, 2020

I just tried installing this integration last night for the first time and saw the same errors in the logs as you have.

@yguns31
Copy link

yguns31 commented May 8, 2020

According to this thread: kiwiz/gkeepapi#83, the issue appears to be Google rejecting requests with gkeepapi in the User Agent. It appears gkeepapi has been updated recently to fix this. Does anybody know how to update to the most recent gkeepapi. I'm not too familiar with python.

@ChocoTonic
Copy link

what do you all use this API for? @austwhite @remdot @yguns31

@wizpig64
Copy link

wizpig64 commented May 9, 2020

Does anybody know how to update to the most recent gkeepapi.

@yguns31 Assuming you installed with pip in the first place, you could do:

pip install --upgrade gkeepapi

@austwhite
Copy link
Author

austwhite commented May 9, 2020

@ChocoTonic I use the API for lists / google keep.

I can't use pip to update as I am using Home Assistant (Previously HASSIO) on a Raspberry Pi 3B+ and using HACS to install the this integration.

@austwhite
Copy link
Author

I noted the issue only seems to have started since updating Home Assistant, but I didn't check the logs much in 0.108.x. The latest HA's have had a lot of patches so I tend to wait for a bit before updating.

@yguns31
Copy link

yguns31 commented May 10, 2020

The latest version (0.11.14) of gkeepapi has fixed the issue. Changing the requirements in the manifest.json from "gkeepapi" to "gkeepapi==0.11.14" should allow the integration to work again.

@austwhite
Copy link
Author

@yguns31
I use Home Assistant (formerly Hassio).
How did you change the API or is this something that still needs a permanent fix by the developer?

@matisaul
Copy link

The latest version (0.11.14) of gkeepapi has fixed the issue. Changing the requirements in the manifest.json from "gkeepapi" to "gkeepapi==0.11.14" should allow the integration to work again.

@yguns31 Hi! I tried to do that, but it doesn't work...

@bevosangryghost
Copy link

@yguns31 Thanks, that fixed it for me.

@PiotrMachowski PiotrMachowski self-assigned this May 14, 2020
@PiotrMachowski PiotrMachowski added the bug Something isn't working label May 14, 2020
@PiotrMachowski
Copy link
Owner

I have upgraded used version of gkeepapi, it should fix this issue

@austwhite
Copy link
Author

Confirmed that bug is fixed

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

8 participants