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

Unknown Exception - 'list' object has no attribute 'object_key' #338

Closed
Matsuo3rd opened this issue Jun 17, 2024 · 24 comments
Closed

Unknown Exception - 'list' object has no attribute 'object_key' #338

Matsuo3rd opened this issue Jun 17, 2024 · 24 comments
Labels
bug Something isn't working

Comments

@Matsuo3rd
Copy link

The problem

Under v0.4.0b5 / HA 2024.6.3, every 5 minutes, the following error pops:

2024-06-17 19:21:10.772 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/nest_protect/init.py", line 208, in _async_subscribe_for_data
dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'
2024-06-17 19:26:11.491 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/nest_protect/init.py", line 208, in _async_subscribe_for_data
dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'
2024-06-17 19:31:12.226 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/nest_protect/init.py", line 208, in _async_subscribe_for_data
dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'

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

0.4.0b5

What version of Home Assistant Core has the issue?

2024.6.3

Device / Model

No response

Diagnostics information

No response

Home Assistant log

Logs
2024-06-17 19:21:10.772 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/nest_protect/__init__.py", line 208, in _async_subscribe_for_data
    dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
                          ^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'
2024-06-17 19:26:11.491 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/nest_protect/__init__.py", line 208, in _async_subscribe_for_data
    dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
                          ^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'
2024-06-17 19:31:12.226 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/nest_protect/__init__.py", line 208, in _async_subscribe_for_data
    dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
                          ^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'

Additional information

No response

@Matsuo3rd Matsuo3rd added the bug Something isn't working label Jun 17, 2024
@styphonthal
Copy link

I have similar error:
2024-06-17 16:41:37.516 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
File "/config/custom_components/nest_protect/init.py", line 208, in _async_subscribe_for_data
dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'

@iMicknl
Copy link
Owner

iMicknl commented Jun 19, 2024

Thanks both! I indeed can reproduce this, but haven't been able to figure out yet what is going wrong exactly.

@B-double-U
Copy link

FYI:

Same here.
Just sharing in case this might help.

This error originated from a custom integration.

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/init.py:208
integration: Nest Protect (documentation, issues)
First occurred: June 17, 2024 at 10:53:26 (2240 occurrences)
Last logged: 11:42:57

Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
File "/config/custom_components/nest_protect/init.py", line 208, in _async_subscribe_for_data
dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'

@meanaverage
Copy link

meanaverage commented Jun 21, 2024

Disregard this message, thought GPT4o fixed, did not...

Also, I am having this issue. 😢

2nd edit: I think it's fixed. Will report back if changes work in about 10 minutes.

Nope. nevermind, i'm only as good as AI and it's not that good.

@iMicknl
Copy link
Owner

iMicknl commented Jun 21, 2024

This is a known issue. Hopefully I can have a look soon to fix this. No need to reply with 'same issue', feel free to do a thumbs up on original post if you face the same issue.

@iSteve-O
Copy link

iSteve-O commented Aug 16, 2024

This issue resolves itself on my system every time after a reboot, but always requires a full reboot of home assistant. The error that pauses updates for 1 minute seems to correct itself and doesn't require a restart to begin to function again.

I made an automation that restarts HA when the "updates paused for 5 minutes" text appears in the log and this is working for now but is not a viable solution long term. It would be a lot less destructive if I could simply reload the integration but that doesn't resolve this error.

@janusn

This comment was marked as spam.

@Matsuo3rd
Copy link
Author

Issue fixed once upgraded to latest beta (including #355)

@lordbah
Copy link

lordbah commented Sep 30, 2024

Really? I didn't see any new release notes and couldn't even find any new commits when I looked yesterday.

@Matsuo3rd
Copy link
Author

See https://github.com/iMicknl/ha-nest-protect/tree/beta (beta branch)
You need to change HACS repo link to the beta one.

@lordbah
Copy link

lordbah commented Oct 2, 2024

What I mean by that is the HA Settings update looks like this:
Screenshot from 2024-10-01 20-42-00
It's for v0.4.0b6 but that's the same "What's changed" text it's had for a couple of years and doesn't mention anything new, right? If that version has a potential fix for issues I would expect to see it there, to encourage people facing issues to install it.
About the commits you are of course correct, when I change from "main" to "beta" on github I can see very recent commits.
I can't find anywhere in HACS to change the URL of a repository. Do I have to Remove it and add it back again, selecting a different version? On the other hand, if it's already offering me v0.4.0b6 then maybe I don't need to change it.

@iMicknl iMicknl reopened this Oct 5, 2024
@iMicknl
Copy link
Owner

iMicknl commented Oct 5, 2024

Reopened this issue due to issues with the fix. Would be good to update as soon as possible to v0.4.0b7 (see release information).

@lordbah
Copy link

lordbah commented Oct 5, 2024

With v0.4.0b7:

2024-10-05 18:21:45.782 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 317, in subscribe_for_data
    result = await response.json()
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 80, in json
    return await super().json(*args, loads=loads, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1199, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 200, message='Attempt to decode JSON with unexpected mimetype: text/plain', url='https://czfe50-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 321, in subscribe_for_data
    raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 200 error while subscribing -

@Maarc
Copy link

Maarc commented Oct 10, 2024

Hi there,

I have similar issues with v0.4.0b7 on Home Assistant Core 2024.10.1 / Supervisor 2024.10.0 / OS 13.1 / Frontend 20241002.2.

Every 5 minutes, I get the following error in my home assistant log file:

2024-10-10 15:35:27.004 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
  File "/config/custom_components/nest_protect/__init__.py", line 208, in _async_subscribe_for_data
    dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
                          ^^^^^^^^^^^^

I hope this helps.

@puterboy
Copy link

I also have this issue running v0.4.0b7
Is there any solution in sight?

@iMicknl
Copy link
Owner

iMicknl commented Oct 14, 2024

@puterboy I don't have time to fix this, however it is only a warning and shouldn't influence the working of the integration. Happy to accept any (tested) PRs.

@ScottESanDiego
Copy link

Isn't that the same root cause as #364 and the like (delayed presence notifications)?

@iMicknl
Copy link
Owner

iMicknl commented Oct 16, 2024

@ScottESanDiego not sure if I understand your question? The revert in #364 was because this contributed fix did cause side effects and hit the Nest servers massively.

@genehand
Copy link

genehand commented Oct 16, 2024

The HA error message says "Updates paused for 5 minutes". I confirmed that my HA occupancy sensor doesn't trigger for up to a few minutes while homebridge-nest picks it up almost immediately.

@ScottESanDiego
Copy link

@ScottESanDiego not sure if I understand your question? The revert in #364 was because this contributed fix did cause side effects and hit the Nest servers massively.

I was replying to your ( @iMicknl ) statement above of "owever it is only a warning and shouldn't influence the working of the integration.". I don't believe that is true - it's an error and changes the working of the integration at least insomuch as notifications are delayed.

I agree, the fix to #364 wasn't a good fix and you were right to revert it, just think the issue in this bug is the same root case and impact as the other bugs (like #364 ).

@Mark612
Copy link

Mark612 commented Oct 23, 2024

2024-10-23 14:27:17.710 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
File "/config/custom_components/nest_protect/init.py", line 208, in _async_subscribe_for_data
dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'

@dtremere
Copy link

I have been getting it for a while now also:

This error originated from a custom integration.

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/init.py:208
integration: Nest Protect (documentation, issues)
First occurred: 11:58:29 AM (24 occurrences)
Last logged: 2:00:54 PM

Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
File "/config/custom_components/nest_protect/init.py", line 208, in _async_subscribe_for_data
dict(b, **buckets.get(b.object_key, {})) for b in [data.updated_buckets]
^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'object_key'

@ScottESanDiego
Copy link

FWIW, the error is different after recent HA updates. Still doesn't work, and errors in the same geenral area...but a slightly different error.

2024-11-23 14:56:25.545 ERROR (MainThread) [custom_components.nest_protect] Unknown exception. Please create an issue on GitHub with your logfile. Updates paused for 5 minutes.
Traceback (most recent call last):
  File "/config/custom_components/nest_protect/__init__.py", line 213, in _async_subscribe_for_data
    dict(item, **buckets.get(b.object_key, {}))
ValueError: dictionary update sequence element #0 has length 13; 2 is required

@iMicknl
Copy link
Owner

iMicknl commented Dec 17, 2024

Should be fixed in the latest beta. Please update to the latest version and create a new issue if you face any issues.

@iMicknl iMicknl closed this as completed Dec 17, 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