iMicknl / ha-nest-protect

Nest Protect integration for Home Assistant. This will allow you to integrate your smoke, heat, co and occupancy status real-time in HA.
MIT License
339 stars 64 forks source link

Unknown pynest exception. Please create an issue on GitHub with your logfile #103

Open swests opened 2 years ago

swests commented 2 years ago

The problem

Seen this error in my HA log: Unknown pynest exception. Please create an issue on GitHub with your logfile. Updates paused for 1 minute.

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

0.3.8

What version of Home Assistant Core has the issue?

2022.9.5

Device / Model

Protect wired (Topaz-2.7 and Topaz-2.9), Firmware 3.4.1rc1

Diagnostics information

Logger: custom_components.nest_protect Source: custom_components/nest_protect/pynest/client.py:270 Integration: Nest Protect (documentation, issues) First occurred: 30 September 2022 at 16:49:02 (18 occurrences) Last logged: 30 September 2022 at 17:52:38

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 266, in subscribe_for_data result = await response.json() File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 52, in json return await super().json(*args, loads=loads, **kwargs) File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1103, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe30-front01-iad01.transport.home.nest.com/v6/subscribe')

During handling of the above exception, another exception occurred:

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

Home Assistant log

Logs ``` Copy/paste any log here, between the starting and ending backticks (`) ```

Additional information

No response

itsadamslife commented 1 year ago

I am receiving a similar error but it is showing "error 200" instead of 400.

This error originated from a custom integration.

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/pynest/client.py:305
Integration: Nest Protect (documentation, issues)
First occurred: 07:14:12 (1 occurrences)
Last logged: 07:14:12

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 301, in subscribe_for_data
    result = await response.json()
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 52, in json
    return await super().json(*args, loads=loads, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1103, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe53-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 165, in _async_subscribe_for_data
    result = await entry_data.client.subscribe_for_data(
  File "/config/custom_components/nest_protect/pynest/client.py", line 305, in subscribe_for_data
    raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 200 error while subscribing - 
jasonpstokes commented 1 year ago

Seeing this on Core 2023.4.

2023-04-07 05:11:16.116 ERROR (MainThread) [custom_components.nest_protect] 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 266, in subscribe_for_data
result = await response.json()
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 67, in json
return await super().json(*args, loads=loads, **kwargs)
File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1104, in json
raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe57-front01-iad01.transport.home.nest.com/v6/subscribe')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/nest_protect/__init__.py", line 145, in _async_subscribe_for_data
result = await entry_data.client.subscribe_for_data(
File "/config/custom_components/nest_protect/pynest/client.py", line 270, in subscribe_for_data
raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 400 error while subscribing -

config_entry-nest_protect-6248a3e70954c72188fdd2141a4328e5.json.txt

Oshuma commented 1 year ago

Same here with HA v2023.3.6 (docker image 929548ebbeec). Using the https://github.com/nicoinch/ha-nest-protect fork (commit https://github.com/nicoinch/ha-nest-protect/commit/1e62797b9464a85001bf231b7c9e44eb6eda964c as of this comment).

Log entry:

2023-04-23 07:06:37.108 ERROR (MainThread) [custom_components.nest_protect] 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 301, in subscribe_for_data
    result = await response.json()
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 67, in json
    return await super().json(*args, loads=loads, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1104, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe110-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 165, in _async_subscribe_for_data
    result = await entry_data.client.subscribe_for_data(
  File "/config/custom_components/nest_protect/pynest/client.py", line 305, in subscribe_for_data
    raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 200 error while subscribing -
douginoz commented 1 year ago

This same error just popped up after installing the 2023.07.1 update. Exact same stack as above, slightly different line numbers. Also using the fork for the cookie method.