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

A lot of "raw_decode raise JSONDecodeError" errors #461

Closed
bieniu opened this issue Nov 11, 2019 · 2 comments
Closed

A lot of "raw_decode raise JSONDecodeError" errors #461

bieniu opened this issue Nov 11, 2019 · 2 comments

Comments

@bieniu
Copy link

bieniu commented Nov 11, 2019

Describe the bug
I have a lot this errors in log:

2019-11-11 21:31:35 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py", line 278, in _handle_event
    await _refresh_if_no_audiopush(already_refreshed)
  File "/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py", line 194, in _refresh_if_no_audiopush
    await self.async_update()
  File "/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py", line 565, in async_update
    no_throttle=True)
  File "/home/homeassistant/.homeassistant/custom_components/alexa_media/helpers.py", line 143, in wrapper
    result = await func(*args, **kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py", line 362, in refresh
    session = await self.alexa_api.get_state()
  File "/srv/homeassistant/lib/python3.7/site-packages/alexapy/alexaapi.py", line 457, in get_state
    return await response.json(content_type=None)
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 1040, in json
    return loads(stripped.decode(encoding))
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Expected behavior
No errors

System details

  • Home-assistant (version): 0.101.3
  • Hassio (Yes/No): No
  • alexa_media (version from const.py or HA startup): 2.3.4
  • alexapy (version from pip show alexapy or HA startup): 1.3.2
@alandtse
Copy link
Owner

This looks like your cookie file has expired. Delete and relogin. If you are using config flow, you can just remove and readd the integration with no need to restart.

I'll separately figure out why it's not properly forcing a relogin when it sees this.

@bieniu
Copy link
Author

bieniu commented Nov 13, 2019

After restart HA there are no errors in log and component works without relogin or any other action.

alandtse added a commit that referenced this issue Dec 31, 2019
fix: add additional catches for login errors
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

No branches or pull requests

2 participants