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 Not working with UniFi Protect Application 2.9.16 #99707

Closed
holdestmade opened this issue Sep 6, 2023 · 12 comments
Closed

UniFi Protect Not working with UniFi Protect Application 2.9.16 #99707

holdestmade opened this issue Sep 6, 2023 · 12 comments

Comments

@holdestmade
Copy link

holdestmade commented Sep 6, 2023

The problem

UniFi Protect Not working with UniFi Protect Application 2.9.16
Integration fails to start after updating UniFi Protect Application to 2.9.16

What version of Home Assistant Core has the issue?

2023.8.4

What was the last working version of Home Assistant Core?

2023.8.4

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

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.unifiprotect.data
Source: components/unifiprotect/data.py:134
Integration: UniFi Protect (documentation, issues)
First occurred: 08:21:27 (1 occurrences)
Last logged: 08:21:27

Auth error while updating
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 134, in async_refresh
    updates = await self.api.update(force=force)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 600, in update
    self._bootstrap = await self.get_bootstrap()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 763, in get_bootstrap
    data = await self.api_request_obj("bootstrap")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 328, in api_request_obj
    data = await self.api_request(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 311, in api_request
    data = await self.api_request_raw(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 286, in api_request_raw
    raise NotAuthorized(msg % (url, response.status, reason))
pyunifiprotect.exceptions.NotAuthorized: Request failed: /proxy/protect/api/bootstrap - Status: 401 - Reason: Unauthorized

Logger: pyunifiprotect.utils
Source: components/unifiprotect/data.py:134
First occurred: 08:21:32 (636 occurrences)
Last logged: 08:30:45

Unknown video mode: sport
Unknown video mode: slowShutter
Logger: homeassistant.components.unifiprotect
Source: components/unifiprotect/data.py:134
Integration: UniFi Protect (documentation, issues)
First occurred: 08:30:15 (2 occurrences)
Last logged: 08:30:47

Error setting up UniFi Protect integration: No modelKey
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/__init__.py", line 105, in async_setup_entry
    await _async_setup_entry(hass, entry, data_service)
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/__init__.py", line 137, in _async_setup_entry
    await data_service.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 114, in async_setup
    await self.async_refresh()
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 134, in async_refresh
    updates = await self.api.update(force=force)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 612, in update
    events = await self.get_events(start=self._last_update_dt or max_event_dt, end=now_dt)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 731, in get_events
    event = create_from_unifi_dict(event_dict, api=self)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/convert.py", line 61, in create_from_unifi_dict
    raise DataDecodeError("No modelKey")
pyunifiprotect.exceptions.DataDecodeError: No modelKey

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Sep 6, 2023

Hey there @AngellusMortis, @bdraco, 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.

(message by CodeOwnersMention)


unifiprotect documentation
unifiprotect source
(message by IssueLinks)

@AngellusMortis

This comment was marked as abuse.

@AngellusMortis

This comment was marked as abuse.

@home-assistant home-assistant bot closed this as completed Sep 6, 2023
@holdestmade
Copy link
Author

holdestmade commented Sep 6, 2023

I know that, I was just posting so you'd be ready for when they release it. I won't bother you again

@disruptivepatternmaterial

Well the real issue is someone decided to put in a setting "Allow Early Access versions of Protect (WARNING: Will mark your integration as unsupported)" and that doesn't work. So this is truly a bug. I would suggest reopening this and repair this setting, at the least.

@RaHehl
Copy link

RaHehl commented Sep 8, 2023

Or UI not having a Versioned API
Or the lib exploding 100% on seeing a unknown event instead just ignoring this and logging a error
😆

@holdestmade
Copy link
Author

holdestmade commented Sep 8, 2023

"Allow Early Access versions of Protect"

This normally works fine with EA versions but every now and again it doesn't. I use the EA version of protect so need this setting.

Simple enough to roll back and wait for HA to update to the full version when it's released.

@realbradley
Copy link

"Allow Early Access versions of Protect"

This normally works fine with EA versions but every now and again it doesn't. I use the EA version of protect so need this setting.

Simple enough to roll back and wait for HA to update to the full version when it's released.

Were you able to roll back to 2.8.35? I'm having the toughest time get it back up and running. Any advice?

@holdestmade
Copy link
Author

holdestmade commented Sep 11, 2023

Yes just followed instructions here using SSH. Replace the 1.14.10 with 2.8.35

https://community.ui.com/releases/UniFi-Protect-1-16-0/eb8cc90d-7ecd-456f-ba98-fb6f288bc091#comment/069aae81-966a-4cbd-97ed-659a8cac6365

@realbradley
Copy link

I was able to roll back to 9.8.35 using those instructions but Protect on HA is still not working.

I'll be starting a new discussion.

Thanks for your help.

@holdestmade
Copy link
Author

OK, I had to reload the integration and it came back online.

@realbradley
Copy link

OK, I had to reload the integration and it came back online.

Def did that plenty of times. Created new discussion.

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

No branches or pull requests

6 participants