-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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: Unable to authenticate with UniFi OS 4 #117100
Comments
Hey there @AngellusMortis, @bdraco, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) unifiprotect documentation |
I was able to get the debug, not much:
If I try to load
I have a Kubernetes cluster where I have SSL enabled for my pods and one of the services I run there is one to setup domains and redirects traffic to the service. So I have a local domain with SSL enabled and that worked for me. Debug log below (removed sensitive data).
|
Looks like this is related to the latest update. Unifi OS was just updated from v3.2.12 to v4.0.3 and HA is not able to authenticate anymore. |
LOL--ok. Just ignore it. In a week or so it'll be a production version. |
Maybe someone should modify the bug template to mention that so people don't waste their time reporting bugs in the wrong place. I'm using early access to help test not only Ubiquiti's software and provide feedback, but to also help test with things like Home Assistant integration. |
For me it is failing with OS 3.2, which is not EA. Changing to a SSL domain with a valid SSL worked fine. |
Do you have a dot (.) in the username by any chance? I've ran into the same issues with my Unifi Protect integration after updating to 4.0.3 Unifi OS. It seems the integration fails when the username of the account includes a dot. After changing the username to one without a dot, it worked again. |
When I tested yesterday I was still on OS 3.2. I upgraded to OS 4.0.3 this morning and using a domain with a valid SSL still works. |
You are an extremely rude person. If you don't like the community, don't write code for the community. Either way, I was replying to other folks comments, not to you. If you have a problem with it, I don't care. Go be rude to someone else. |
I have the same problem for the past 2 days on Protect 3.0.26 on UniFi OS v3.2.17 both on the Official Release Channel |
I mentioned how I fixed it. It is STILL failing on OS 3.2, I just tested again. Someone else just commented that it's also failing for them. I also decided to run HASS and UniFi OS in a separate environment and it also failed to auth. Once I created a self signed certificate and made sure HASS trusted that certificate, then it worked. Again, this is how I fixed it. If it's different for anyone else, then it's different for them. |
The error is the same either on 3.2 or 4.0. I didn't check anything, I know how to read. I am not your typical person that is just using HASS and comes here often to ask for help. What I find absurd is how HASS allows you to be a contributor when you like to curse at people, be rude, just because you wrote an integration that is being used by HASS. |
@AngellusMortis, I hope you don't speak like this in a professional setting. |
Thanks for the report! Opening this issue back up for visibility (to avoid duplicate issues being created) and to help with tracking this for other contributors. I want to note again that EA versions (of UniFi Protect and UniFi OS) are not supported by the HA integration. And just a reminder: if you're experiencing the same issue but don't have new information to add to the issue, please just upvote the original post. "+1" comments only cause unnecessary notifications. |
I see that the fix for the authentication issue was in >6.0.0 of the pyunifiprotect library but there has been a falling out with the author of that library and the Nabu Casa devs leading to a license change and >6.0.0 not being merged. @bdraco I am wondering if there is a near term solution for this or if the suggestion at the moment will be to not upgrade? Just hoping for a message to the community to assure us. Thanks! |
I have the same problem now. Using 192.168.x.x doesn't work anymore for unifi protect. |
Yeah...what the heck is that? That license change is pretty hostile....from the same @AngellusMortis who had some pretty angry/hateful comments in this thread. Not sure if he deleted his own comments or someone from Home Assistant deleted them, but he apparently decided to change the license for pyunifiprotect to specifically target home assistant for exclusion: https://github.com/AngellusMortis/pyunifiprotect/commit/2fcc0f61778767cb4db86f6b6b48ef5510e6faae It's sad, but oh well. |
Nowhere in my previous commend did I call you an "idiot developer that does not know what they are doing and a clown". I'm not sure why you are so angry over a user requesting help. Regardless, it's your code, so do as you wish. If I had the time, I'd fork the MIT licensed code and support it myself. But I don't have the time. If you're struggling with anger issues, please seek professional help. If I personally angered you, my apologies. That was never my intent. |
Again, I apologize. |
You're better than this man. The situation sucks for everyone involved at this point and you making yourself look worse effects you the most. Go enjoy some free time man this isn't the way to get even or whatever. |
@darkpixel can you try using a valid SSL when configuring the integration? |
|
At the risk of further...annoying a certain user...I replaced the cert on my UNVR Pro with one trusted by Home Assistant and my local box and it immediately reconnected. Thanks @CajuCLC EDIT: And the files on the UNVR Pro are |
Users are reaching out to me out of band (and a bit too invasively for my taste) for help with this integration. As I do not have the bandwidth to be the primary code owner, remove myself. see #117100 (comment)
I tried deleting and creating a new local user, but the HA Plugin keeps saying "Invalid authentication" |
For me, I had to delete the integration and then add it back in with the new username and password. For me i used my NVR IP without a Valid SSL and it re-added it just fine. I did revert my doorbell image back to the default though, I don't see the option in the integration yet to have a custom so assume its still not supported. But atleast its back up and running again. If you have any automations etc setup they should be retained, mine were anyway. |
Can someone running Unifi OS confirm that #119308 fixes this issue? You can test that PR as a custom component using this one liner:
Be sure to delete the custom component it will generate after upgrading to 2024.6.2 |
@bdraco: works for me! Thanks! Unifi OS v4.0.4, Protect v4.0.26, G4 Doorbell Pro v4.71.94 |
I applied as well, and working so far with 1 minor exception, the camera preview on the area card isn't pulling up the picture. |
Just had the authentication expired issue recur |
I'll leave this issue open in that case as it looks like more work is needed on the library. Hopefully someone can contribute a followup fix. I don't have anything running 4.x yet, but I'll take a look after I upgrade if it's not solved by then. That could be a while before I do upgrade my production so please don't wait for me. |
For those with problems still, what’s in the logs? |
Which specific log, i'm not familiar with where HA keeps that |
https://www.home-assistant.io/docs/configuration/troubleshooting/#enabling-debug-logging |
I've got it enabled now, but its been a crapshoot on how often it happens and i'm not able to cause it on command, so might be a bit. |
Should be fixed by Home Assistant 2024.6.2 |
Still no recurrence of the issue so not sure if the error message i had before was a false positive or not |
Please keep monitoring and report back, as it may not be fully fixed. There might be an issue where the cookie isn't properly stored and reauthentication takes place leading to rate limiting at some point. |
Its also possible that i had to re-auth once after the fix was in place, i've only had it pop-up the once time |
Was told to provide my feedback here instead of #119308 so posting my same comment here (hope that is ok, and what I was expected to do) with a few minor tweaks: I have a UNVR running 4.0.5 OS and Protect 4.0.33. I had several log messages related to authentication since I updated to the unsupported OS. I was able to somewhat mitigate the issue by re-authenticating using a new local user (the previous one would no longer work) and that stopped the repair issue about Unifi Protect Authentication however I still had several log messages about Protect. Today, after updating to the latest core 2024.6.2 release that includes this fix, I deleted the Unifi Protect integration and added it back (for testing purposes) with the same HA local user and it worked flawlessly. I rebooted HA to check for Unifi Protect related logs, and there are none. If this is a sufficient test, I'd say the issue appears fixed. If not, please let me know what I need to do to test it. Glad to help. |
i just deleted the unifiprotect in my custom_components and updated to 2024.6.2 everything seems to work on my system. only minor issue now is that the EA-warning always reappear. there is already another issue opened #118134 |
There is another cookie fix coming in #119436. |
Unless anyone is still have a problem after reauth, I think we can close out this issue. |
Been working great since latest release. Thank you everyone for contributing and working through this! |
The problem
I have been unable to authenticate to UniFi Protect over the last few releases of Home Assistant.
If I use the same username and password to sign in to the console, it works fine....even from an incognito window which means this probably isn't related to their cloud / 2FA stuff.
What version of Home Assistant Core has the issue?
core-2024.5.2
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
Unfortunately I removed my Protect integration and tried to re-add it as part of troubleshooting, but it fails to add--so I can't enable debug logging for the unifiprotect integration and drag and drop the file here. You'll have to settle for a snippet I copied earlier.
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: