core icon indicating copy to clipboard operation
core copied to clipboard

Unifi Protect fails to configure when adding integration

Open Steven-Burns opened this issue 7 months ago • 1 comments

The problem

steps: attempt to add unifi protect integration to core 2025-05-01 Fill in UI form for creds: unsure local unifi account and all that according to integration docs result: "unknown error" expected: success.

What version of Home Assistant Core has the issue?

core-2025.5.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

unifi protect

Link to integration documentation on our website

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

Diagnostics information

home-assistant_2025-05-11T22-57-22.877Z.log

Example YAML snippet


Anything in the logs that might be useful for us?

looks like a null ref in the auth pathway:

  File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 516, in ensure_authenticated
    await self._load_session()
  File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 605, in _load_session
    session_cookie = await self._read_auth_config()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 627, in _read_auth_config
    session = config.get("sessions", {}).get(session_hash)
              ^^^^^^
UnboundLocalError: cannot access local variable 'config' where it is not associated with a value

Additional information

No response

Steven-Burns avatar May 11 '25 23:05 Steven-Burns

Hey there @rahehl, mind taking a look at this issue as it has been labeled with an integration (unifiprotect) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of unifiprotect can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign unifiprotect Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


unifiprotect documentation unifiprotect source (message by IssueLinks)

home-assistant[bot] avatar May 11 '25 23:05 home-assistant[bot]

@Steven-Burns I was facing this issue myself as well since updating to 2025.5.1. I restarted my HASS box after removal and resetup didnt fix it then walked away to get lunch. When I came back 15 minutes later it was fixed so assuming a restart fixed it if you havent tried that yet (despite the "failure" message during setup!)

Iamthemedic avatar May 15 '25 18:05 Iamthemedic

Maybe some config in .storage/unifiprotect/ is broken

RaHehl avatar May 15 '25 21:05 RaHehl