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
333 stars 62 forks source link

4 Different Errors at Once. Unknown pynest exception. Could not interpret nest response. Authentication Error. #267

Open TonyMontuna opened 11 months ago

TonyMontuna commented 11 months ago

The problem

Hello,

I consistently have gotten these alerts and notifications that say

"Login attempt or request with invalid authentication from sonoszp.lan (IP Address). See the log for details."

Then when I check the logs, I got 4 different alerts, 2 are the same but show up more than 50 times. This is what I have:

This error originated from a custom integration.

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/__init__.py:163
Integration: Nest Protect (documentation, issues)
First occurred: October 15, 2023 at 10:22:55 AM (59 occurrences)
Last logged: 8:46:36 AM

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 217, in authenticate
    self.nest_session = NestResponse(**nest_response)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: NestResponse.__init__() got an unexpected keyword argument 'error_description'

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 163, in _async_subscribe_for_data
    entry_data.client.nest_session = await entry_data.client.authenticate(auth)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nest_protect/pynest/client.py", line 224, in authenticate
    raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 400 error while authenticating - {"error":"invalid_request","error_description":"missing user credentials"}. Please create an issue on GitHub.

AND

This error originated from a custom integration.

Logger: custom_components.nest_protect.pynest
Source: custom_components/nest_protect/pynest/client.py:214
Integration: Nest Protect (documentation, issues)
First occurred: October 15, 2023 at 10:22:55 AM (59 occurrences)
Last logged: 8:46:36 AM

Authentication error: invalid_request

AND

This error originated from a custom integration.

Logger: custom_components.nest_protect.pynest
Source: custom_components/nest_protect/pynest/client.py:222
Integration: Nest Protect (documentation, issues)
First occurred: October 15, 2023 at 10:22:55 AM (59 occurrences)
Last logged: 8:46:36 AM

Could not interpret Nest response

AND

This error originated from a custom integration.

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/__init__.py:166
Integration: Nest Protect (documentation, issues)
First occurred: October 15, 2023 at 10:21:55 AM (44 occurrences)
Last logged: 8:45:35 AM

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 72, in json
    return await super().json(*args, loads=loads, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/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://czfe18-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 166, 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 - 

I see it's related to a media file I have in my HA IO system. Unsure how it's related from these logs.

Any help is appreciated.

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

0.3.12

What version of Home Assistant Core has the issue?

HA OS - Home Assistant 2023.10.3

Device / Model

Nest Protect (Battery)

Diagnostics information

No response

Home Assistant log

No response

Additional information

I cannot input the logs or dianostic information because it is too long

iMicknl commented 11 months ago

Are you using the cookie method or the old authentication method?

TonyMontuna commented 11 months ago

Are you using the cookie method or the old authentication method?

I’m not entirely sure, how would I check that?

iMicknl commented 11 months ago

How did you login / setup the integration? Did you just login on your Google account, or did you had to do manual steps where you retrieved cookies etc.

TonyMontuna commented 11 months ago

How did you login / setup the integration? Did you just login on your Google account, or did you had to do manual steps where you retrieved cookies etc.

Login on my Google account

TonyMontuna commented 11 months ago

How did you login / setup the integration? Did you just login on your Google account, or did you had to do manual steps where you retrieved cookies etc.

Login on my Google account

any suggestions?

iMicknl commented 11 months ago

Does your integration still work? If so; just ignore the errors for now. At the moment I am really busy and don't have time to work a lot on this.

TonyMontuna commented 11 months ago

No, it doesn’t work

stiltjack commented 11 months ago

I have the same errors. Beta version of the integration set up using the cookie method. The integration still appears to be working (changes to the configuration switches in HA are reflected in the Nest app).

I'm ignoring them!

silenceleaf commented 11 months ago

Same error here

mbhforum commented 10 months ago

Same error here, but integration appears to be working. I am just going through the logs to try and eliminate any errors I am seeing ATM.

SoccerCore11 commented 9 months ago

Working, but errors. I used Cookie auth IIRC.

This error originated from a custom integration.

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/__init__.py:163
Integration: Nest Protect (documentation, issues)
First occurred: 10:54:49 AM (5 occurrences)
Last logged: 4:00:28 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 217, in authenticate
    self.nest_session = NestResponse(**nest_response)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: NestResponse.__init__() got an unexpected keyword argument 'error_description'

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 163, in _async_subscribe_for_data
    entry_data.client.nest_session = await entry_data.client.authenticate(auth)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nest_protect/pynest/client.py", line 224, in authenticate
    raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 400 error while authenticating - {"error":"invalid_request","error_description":"missing user credentials"}. Please create an issue on GitHub.