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

Cannot Log in to UniFi Protect After Migrating to UCG-Max #137433

Closed
hcaiano opened this issue Feb 5, 2025 · 6 comments
Closed

Cannot Log in to UniFi Protect After Migrating to UCG-Max #137433

hcaiano opened this issue Feb 5, 2025 · 6 comments

Comments

@hcaiano
Copy link

hcaiano commented Feb 5, 2025

The problem

I am unable to log in to the UniFi Protect integration after migrating from a Cloud Key to a UCG-Max. When trying to set up the integration in Home Assistant, I get the error:

"Unknown error occurred"

There are no clear logs explaining why authentication fails.

What I Have Tried

  • Confirmed that my local user works: I can log in to UniFi Protect via the web UI at https://192.168.1.1:443/protect.
  • Ensured my user has local access and admin permissions in UniFi OS.
  • Tested the UniFi Protect API manually:
    • GET https://192.168.1.1:443/proxy/protect/api/bootstrap → Returns an HTTP 302 redirect instead of JSON.
    • POST https://192.168.1.1:443/api/auth/login → Returns 401 Unauthorized even though the credentials are correct.
  • Restarted both Home Assistant and UniFi Protect multiple times.
  • Created a new local user with admin access, but the same error persists.
  • Checked Home Assistant logs, but no useful error messages were found.

Home Assistant Version

  • Home Assistant 2025.x.x
  • Running on Home Assistant OS
  • UniFi Protect integration version 5.2.46

UniFi Protect Setup

  • Device: UCG-Max
  • How I Migrated: Backed up from Cloud Key → Restored on UCG-Max

Image

Image

Any guidance on resolving this would be appreciated. Thanks!

What version of Home Assistant Core has the issue?

core-2025.1.4

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

unifiprotect

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

## **Logs from UniFi Protect**
Here are some logs from `journalctl -u unifi-protect --no-pager --since "1 hour ago"`:

`Feb 05 11:18:06 UCG-Max su[1482663]: (to postgres) root on none Feb 05 11:18:07 UCG-Max pre-start[1482669]: createuser: error: creation of new role failed: ERROR: role "unifi-protect" already exists Feb 05 11:18:07 UCG-Max pre-start[1482695]: Read Only file system check Feb 05 11:19:07 UCG-Max bash[1482758]: (node:1482758) MaxListenersExceededWarning: Possible EventEmitter memory leak detected.`

Additional information

  • I cannot enable debug mode in the Home Assistant integration because it never completes setup.
  • The API works on the web UI, but authentication fails via direct API calls.
@home-assistant
Copy link

home-assistant bot commented Feb 5, 2025

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)

@faithless11
Copy link

Hey,

i've got the same issue after upgrading to HA 2025.02. Unfortunatelly theres nothing in the Logs anywhere.

Unifi Protect: 5.2.49

@RaHehl
Copy link
Contributor

RaHehl commented Feb 5, 2025

GET https://192.168.1.1:443/proxy/protect/api/bootstrap → Returns an HTTP 302 redirect instead of JSON.
That sounds strange, what is the target of the 302?

@faithless11
Copy link

In my Case GET https://uckp.home.local/proxy/protect/api/bootstrap returns JSON

@hcaiano
Copy link
Author

hcaiano commented Feb 5, 2025

GET https://192.168.1.1:443/proxy/protect/api/bootstrap → Returns an HTTP 302 redirect instead of JSON.
That sounds strange, what is the target of the 302?

When I access it directly it returns a json but when I was trying to do a request to the api using postman I always got auth problems. I'll try again later today and report back.

@hcaiano
Copy link
Author

hcaiano commented Feb 5, 2025

@RaHehl Not sure if anything was changed on your end, but after updating to HAOS 2025.2.0 the issue is now resolved! I used the same credentials and everything worked perfectly.

Really appreciate the quick response and your help. Thank you!

@hcaiano hcaiano closed this as completed Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants