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

Unifi Protect Error on startup #119534

Closed
bmf7777 opened this issue Jun 12, 2024 · 6 comments · Fixed by #119653
Closed

Unifi Protect Error on startup #119534

bmf7777 opened this issue Jun 12, 2024 · 6 comments · Fixed by #119653

Comments

@bmf7777
Copy link

bmf7777 commented Jun 12, 2024

The problem

Unifi Protect error on startup. was working on 2024.5.x and possibly 2024.6.1 (see traceback)

What version of Home Assistant Core has the issue?

core-2024.6.2

What was the last working version of Home Assistant Core?

core-2024.5.x

What type of installation are you running?

Home Assistant Core

Integration causing the issue

https://www.home-assistant.io/integrations/unifiprotect/

Link to integration documentation on our website

https://www.home-assistant.io/integrations/unifiprotect/

Diagnostics information

2024-06-12 11:51:14.600 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UDM-SE for unifiprotect
Traceback (most recent call last):
File "/srv/homeassistant_3.12/lib/python3.12/site-packages/homeassistant/config_entries.py", line 594, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant_3.12/lib/python3.12/site-packages/homeassistant/components/unifiprotect/init.py", line 72, in async_setup_entry
bootstrap = await protect.get_bootstrap()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant_3.12/lib/python3.12/site-packages/uiprotect/api.py", line 1134, in get_bootstrap
return Bootstrap.from_unifi_dict(**data, api=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant_3.12/lib/python3.12/site-packages/uiprotect/data/base.py", line 139, in from_unifi_dict
return cls.construct(**data)
^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant_3.12/lib/python3.12/site-packages/uiprotect/data/base.py", line 149, in construct
values[key] = unifi_objs[key].construct(**values[key])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant_3.12/lib/python3.12/site-packages/uiprotect/data/base.py", line 636, in construct
obj = super().construct(_fields_set=_fields_set, **values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant_3.12/lib/python3.12/site-packages/uiprotect/data/base.py", line 149, in construct
values[key] = unifi_objs[key].construct(**values[key])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant_3.12/lib/python3.12/site-packages/uiprotect/data/base.py", line 168, in construct
obj._api = api
^^^^^^^^
File "/srv/homeassistant_3.12/lib/python3.12/site-packages/pydantic/main.py", line 357, in setattr
raise ValueError(f'"{self.class.name}" object has no field "{name}"')
ValueError: "PortConfig" object has no field "_api"

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

@bdraco
Copy link
Member

bdraco commented Jun 13, 2024

This looks like the broken pydantic v1.10.16 release we saw in #119430

@bdraco
Copy link
Member

bdraco commented Jun 13, 2024

pydantic/pydantic#9656 might be related

@bdraco
Copy link
Member

bdraco commented Jun 13, 2024

Not sure that is the source but I expect you have pydandic 1.10.16 and downgrading to 1.10.15 will fix it

@bdraco
Copy link
Member

bdraco commented Jun 14, 2024

changing it to setattr seems to make it work. I'll do a patch to do that

@bdraco
Copy link
Member

bdraco commented Jun 14, 2024

I think #119653 will fix this, but if it doesn't after updating to 2024.6.3, please let me know, and I'll reopen this issue

@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants