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

Attempt to decode JSON with unexpected mimetype: text/plain #326

Open
IMakeTP opened this issue Apr 19, 2024 · 7 comments
Open

Attempt to decode JSON with unexpected mimetype: text/plain #326

IMakeTP opened this issue Apr 19, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@IMakeTP
Copy link

IMakeTP commented Apr 19, 2024

The problem

Unknown pynest exception.

What version of this integration (ha-nest-protect) has the issue?

0.4.0b4

What version of Home Assistant Core has the issue?

2024.4.3

Device / Model

Nest Protect Battery

Diagnostics information

No response

Home Assistant log

Logs

This error originated from a custom integration.

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/init.py:168
integration: Nest Protect (documentation, issues)
First occurred: 6:51:07 PM (4 occurrences)
Last logged: 9:54:12 PM

Unknown pynest exception. Please create an issue on GitHub with your logfile. Updates paused for 1 minute.
Traceback (most recent call last):
File "/config/custom_components/nest_protect/pynest/client.py", line 298, in subscribe_for_data
result = await response.json()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 73, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1176, in json
raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe73-front01-iad01.transport.home.nest.com/v6/subscribe')

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

Traceback (most recent call last):
File "/config/custom_components/nest_protect/init.py", line 168, in _async_subscribe_for_data
result = await entry_data.client.subscribe_for_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nest_protect/pynest/client.py", line 302, in subscribe_for_data
raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 200 error while subscribing -

Additional information

No response

@IMakeTP IMakeTP added the bug Something isn't working label Apr 19, 2024
@martymart8864
Copy link

Having the same issue and device/versions as @IMakeTP

@bmos
Copy link
Contributor

bmos commented Apr 30, 2024

I have this issue also

Logs

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/init.py:168
integration: Nest Protect (documentation, issues)
First occurred: 1:00:23 PM (1 occurrences)
Last logged: 1:00:23 PM

Unknown pynest exception. Please create an issue on GitHub with your logfile. Updates paused for 1 minute.
Traceback (most recent call last):
File "/config/custom_components/nest_protect/pynest/client.py", line 298, in subscribe_for_data
result = await response.json()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 73, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1176, in json
raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe74-front01-iad01.transport.home.nest.com/v6/subscribe')

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

Traceback (most recent call last):
File "/config/custom_components/nest_protect/init.py", line 168, in _async_subscribe_for_data
result = await entry_data.client.subscribe_for_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nest_protect/pynest/client.py", line 302, in subscribe_for_data
raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 500 error while subscribing -

@iMicknl
Copy link
Owner

iMicknl commented Jun 15, 2024

Please update to v0.4.0b5 and let me know if this issue is still present.

@iMicknl iMicknl closed this as completed Jun 15, 2024
@martymart8864
Copy link

Hi @iMicknl, thanks for the update but stupid question. How do I upgrade? I uninstalled the v0.4.0b4 package from HA, went to the integration again but it reinstalled v0.4.0b4 and not v0.4.0b5. I'm obviously doing something wrong here.. thanks!

@iMicknl
Copy link
Owner

iMicknl commented Jun 16, 2024

@martymart8864 have you pressed "Update information"? Selecting "Redownload" should show the latest version.

image

@martymart8864
Copy link

Thanks again @iMicknl, got it now. I'll let it run for a a few days and check if I still get the error!

@martymart8864
Copy link

Hi @iMicknl

Still given me an error message running version 0.4.0b5


Logger: custom_components.nest_protect
Source: custom_components/nest_protect/init.py:169
integration: Nest Protect (documentation, issues)
First occurred: 1:36:35 PM (1 occurrences)
Last logged: 1:36:35 PM

Unknown pynest exception. Please create an issue on GitHub with your logfile. Updates paused for 1 minute.
Traceback (most recent call last):
File "/config/custom_components/nest_protect/pynest/client.py", line 309, in subscribe_for_data
result = await response.json()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 79, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1176, in json
raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe09-front01-iad01.transport.home.nest.com/v6/subscribe')

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

Traceback (most recent call last):
File "/config/custom_components/nest_protect/init.py", line 169, in _async_subscribe_for_data
result = await entry_data.client.subscribe_for_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nest_protect/pynest/client.py", line 313, in subscribe_for_data
raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 200 error while subscribing -

@iMicknl iMicknl reopened this Jun 19, 2024
@iMicknl iMicknl changed the title Unknown pynest exception. Attempt to decode JSON with unexpected mimetype: text/plain Jun 19, 2024
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

4 participants