Comments (16)
Hey there @Kane610, mind taking a look at this issue as it has been labeled with an integration (unifi
) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of unifi
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 unifi
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)
unifi documentation
unifi source
(message by IssueLinks)
from core.
I am seeing the same failed to connect issue in the June release of HAOS/HA. My Unifi controller is remote, but I'm giving the correct credentials as verified by logging into the same hostname on my controller's web GUI.
This is my first time installing it. I've never tried to install the Unifi Integration previously.
Also, I recommend some documentation or a greyed out text in the host field showing example.com because its not clear if a leading https:// is needed in the hostname field.
Thanks for posting this OP.
from core.
I noticed that I forgot to mention that I am running the UniFi controller as a HA Add-on
from core.
I also meet this problem even I have create a local authentication account. Any tips to resolve this problem?
from core.
In my case, the issue has been solved. I have logged in into both the Unifi controller and HA using the local IP address. Then I have created a local user in the Unifi controller. I deleted the Unifi Network integration in the local HA and afterwards added it again with the credentials of the local administrator account of the Unifi controller. Now I have both 1 local Unifi administrator and 1 remote Unifi administrator, of which the latter has to use the 2FA.
from core.
Do you see any errors in the logs?
from core.
@BlackRockCity and @leeaash , this is a question for your issues as for me the issue has been resolved
from core.
I've been hitting the same issue recently - however - it seems like my integration got in a bad state and was hitting the login endpoint on the controller too much. From the integration logs, the controller is now returning a 429 Too Many Requests
error:
2024-06-21 16:35:17.775 DEBUG (MainThread) [aiounifi.interfaces.connectivity] data (from https://192.168.4.1:443) b'<!doctype html><html lang="en"><head><meta charset="utf-8"><link rel="icon" href="/favicon.ico?v3" sizes="any"><link rel="icon" href="/favicon.svg?v3" type="image/svg+xml"><link rel="apple-touch-icon" href="/apple-touch-icon.png?v3"><title>UniFi OS</title><meta name="viewport" content="width=device-width,initial-scale=1"><script>window.UNIFI_OS_MANIFEST = {"model":{"id":"UDW","shortName":"UDW","longName":"UniFi Dream Wall"},"images":{"small":"/assets/images/small.png?udw-2.0.0","medium":"/assets/images/medium.png?udw-2.0.0","large":"/assets/images/large.png?udw-2.0.0","huge":"/assets/images/huge.png?udw-2.0.0"}}</script><script defer="defer" src="/main.1f13cbe8ee4a4f1a0848.js"></script><link href="/main.0e9197a3.css" rel="stylesheet"></head><body><div id="root"></div></body></html>'
2024-06-21 16:35:17.775 DEBUG (MainThread) [aiounifi.interfaces.connectivity] Talking to UniFi OS device: True
2024-06-21 16:35:17.775 DEBUG (MainThread) [aiounifi.interfaces.connectivity] sending (to https://192.168.4.1:443/api/auth/login) post, {'username': 'viewonly', 'password': 'OMITTED', 'rememberMe': True}, {}
2024-06-21 16:35:17.792 DEBUG (MainThread) [aiounifi.interfaces.connectivity] received (from https://192.168.4.1:443/api/auth/login) 429 application/json <ClientResponse(https://192.168.4.1:443/api/auth/login) [429 Too Many Requests]>
<CIMultiDictProxy('Server': 'nginx', 'Date': 'Fri, 21 Jun 2024 20:35:17 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '113', 'Connection': 'keep-alive', 'X-Response-Time': '12ms', 'Access-Control-Allow-Credentials': 'false', 'Referrer-Policy': 'no-referrer', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Content-Type-Options': 'nosniff', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '1; mode=block')>
2024-06-21 16:35:17.792 DEBUG (MainThread) [aiounifi.interfaces.connectivity] data (from https://192.168.4.1:443/api/auth/login) b'{"code":"AUTHENTICATION_FAILED_LIMIT_REACHED","message":"You\'ve reached the login attempt limit","level":"debug"}'
2024-06-21 16:35:17.792 ERROR (MainThread) [homeassistant.components.unifi] Error connecting to the UniFi Network at 192.168.4.1: Call https://192.168.4.1:443/api/auth/login received 429: b'{"code":"AUTHENTICATION_FAILED_LIMIT_REACHED","message":"You\'ve reached the login attempt limit","level":"debug"}'
2024-06-21 16:35:18.257 ERROR (MainThread) [homeassistant.components.unifiprotect.data] Auth error while updating
Traceback (most recent call last):
File "/nix/store/sq3by8r3524slnqjm5cj09abg3q455zx-homeassistant-2024.6.3/lib/python3.12/site-packages/homeassistant/components/unifiprotect/data.py", line 133, in async_refresh
updates = await self.api.update(force=force)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 799, in update
self._bootstrap = await self.get_bootstrap()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 1127, in get_bootstrap
data = await self.api_request_obj("bootstrap")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 427, in api_request_obj
data = await self.api_request(
^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 406, in api_request
data = await self.api_request_raw(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 381, in api_request_raw
raise NotAuthorized(msg % (url, response.status, reason))
uiprotect.exceptions.NotAuthorized: Request failed: /proxy/protect/api/bootstrap - Status: 401 - Reason: {'code': 401, 'message': 'Unauthorized'}
I suspect something happened to my integration and got stuck in a tight auth loop. This manifests in the UI as Failed to connect
Not sure if this is what others are hitting but check your logs. We could consider doing some backoff in the integration if we see a 429.
from core.
I'm having this issue. I'm trying to connect using the local IP address of the UDM and port 443. I'm able to log into unifi on a browser using that IP and the local user account I created. I tried deleting and creating a new local user account on Unifi and still I get the same issue.
Logs only show one line: "Error connecting to the UniFi Network at " (my local IP)
from core.
Can you enable/download the diagnostic logs, restart the integration and post the resulting logs here? (Be sure to remove your password in the logs!)
from core.
I can't get the integration to actually enable to the point that I can access the page and download the diagnostic logs. Basically, when I search for Protect and add the integration, it prompts me to enter host, username, password etc. but the submit form fails, and the integration never gets added.
Relevant: I'm using Protect application 4.0.33. I was in Early Access but I changed back to stable. I believe this is the official release
from core.
I can't get the integration to actually enable to the point that I can access the page and download the diagnostic logs.
Same here!
from core.
I can't get the integration to actually enable to the point that I can access the page and download the diagnostic logs. Basically, when I search for Protect and add the integration, it prompts me to enter host, username, password etc. but the submit form fails, and the integration never gets added.
Relevant: I'm using Protect application 4.0.33. I was in Early Access but I changed back to stable. I believe this is the official release
Please open a separate issue for protect
from core.
I've been hitting the same issue recently - however - it seems like my integration got in a bad state and was hitting the login endpoint on the controller too much. From the integration logs, the controller is now returning a
429 Too Many Requests
error:2024-06-21 16:35:17.775 DEBUG (MainThread) [aiounifi.interfaces.connectivity] data (from https://192.168.4.1:443) b'<!doctype html><html lang="en"><head><meta charset="utf-8"><link rel="icon" href="/favicon.ico?v3" sizes="any"><link rel="icon" href="/favicon.svg?v3" type="image/svg+xml"><link rel="apple-touch-icon" href="/apple-touch-icon.png?v3"><title>UniFi OS</title><meta name="viewport" content="width=device-width,initial-scale=1"><script>window.UNIFI_OS_MANIFEST = {"model":{"id":"UDW","shortName":"UDW","longName":"UniFi Dream Wall"},"images":{"small":"/assets/images/small.png?udw-2.0.0","medium":"/assets/images/medium.png?udw-2.0.0","large":"/assets/images/large.png?udw-2.0.0","huge":"/assets/images/huge.png?udw-2.0.0"}}</script><script defer="defer" src="/main.1f13cbe8ee4a4f1a0848.js"></script><link href="/main.0e9197a3.css" rel="stylesheet"></head><body><div id="root"></div></body></html>' 2024-06-21 16:35:17.775 DEBUG (MainThread) [aiounifi.interfaces.connectivity] Talking to UniFi OS device: True 2024-06-21 16:35:17.775 DEBUG (MainThread) [aiounifi.interfaces.connectivity] sending (to https://192.168.4.1:443/api/auth/login) post, {'username': 'viewonly', 'password': 'OMITTED', 'rememberMe': True}, {} 2024-06-21 16:35:17.792 DEBUG (MainThread) [aiounifi.interfaces.connectivity] received (from https://192.168.4.1:443/api/auth/login) 429 application/json <ClientResponse(https://192.168.4.1:443/api/auth/login) [429 Too Many Requests]> <CIMultiDictProxy('Server': 'nginx', 'Date': 'Fri, 21 Jun 2024 20:35:17 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '113', 'Connection': 'keep-alive', 'X-Response-Time': '12ms', 'Access-Control-Allow-Credentials': 'false', 'Referrer-Policy': 'no-referrer', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Content-Type-Options': 'nosniff', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '1; mode=block')> 2024-06-21 16:35:17.792 DEBUG (MainThread) [aiounifi.interfaces.connectivity] data (from https://192.168.4.1:443/api/auth/login) b'{"code":"AUTHENTICATION_FAILED_LIMIT_REACHED","message":"You\'ve reached the login attempt limit","level":"debug"}' 2024-06-21 16:35:17.792 ERROR (MainThread) [homeassistant.components.unifi] Error connecting to the UniFi Network at 192.168.4.1: Call https://192.168.4.1:443/api/auth/login received 429: b'{"code":"AUTHENTICATION_FAILED_LIMIT_REACHED","message":"You\'ve reached the login attempt limit","level":"debug"}' 2024-06-21 16:35:18.257 ERROR (MainThread) [homeassistant.components.unifiprotect.data] Auth error while updating Traceback (most recent call last): File "/nix/store/sq3by8r3524slnqjm5cj09abg3q455zx-homeassistant-2024.6.3/lib/python3.12/site-packages/homeassistant/components/unifiprotect/data.py", line 133, in async_refresh updates = await self.api.update(force=force) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 799, in update self._bootstrap = await self.get_bootstrap() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 1127, in get_bootstrap data = await self.api_request_obj("bootstrap") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 427, in api_request_obj data = await self.api_request( ^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 406, in api_request data = await self.api_request_raw( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/v1x8g45h8ywwifv4jq4v5pdzh0svrl2y-python3.12-uiprotect-1.7.2/lib/python3.12/site-packages/uiprotect/api.py", line 381, in api_request_raw raise NotAuthorized(msg % (url, response.status, reason)) uiprotect.exceptions.NotAuthorized: Request failed: /proxy/protect/api/bootstrap - Status: 401 - Reason: {'code': 401, 'message': 'Unauthorized'}
I suspect something happened to my integration and got stuck in a tight auth loop. This manifests in the UI as
Failed to connect
Not sure if this is what others are hitting but check your logs. We could consider doing some backoff in the integration if we see a 429.
Have you gotten it back to running?
from core.
I had the same issue, the integration was working, then it wasn't I was complaining abut too many failed authentication attempts, however credentials had not changed, I removed the UDM controller from the integration and tried to re-add it, this failed to get past the add box with failed to connect. I removed the user from the local controller and waited a few hours, then re-added it all back and it worked.
from core.
For the 429 - yes. Try disabling the integration and restarting the controller. Then re-enable the integration worked for me.
from core.
Related Issues (20)
- Dexcom: last_updated time should change even if the state is the same between updates. HOT 2
- Fronius Integration Missing Device Ohmpilot after Fronius Firmware Update to 1.32.5-1 HOT 3
- New Ecovac DEEBOT NEO 2.0 PLUS does not work with ecovac integration HOT 1
- Tuya: Unknown error occurred upon integration configuration
- Weather .get_forecasts for NWS station returns Failed to call service weather.get_forecasts. Unknown error HOT 6
- Detected blocking call to open inside the event loop by integration 'local_todo' HOT 1
- Detected blocking call inside the event loop by integration 'adguard' HOT 2
- `integration` calls `async_listen` with run_immediately which is deprecated HOT 2
- AirGradient temperature sensor below absolute zero HOT 2
- iCloud Integration requires reauth on every reboot/reload HOT 1
- Detected blocking call to listdir with args HOT 2
- Detected blocking call to listdir with args HOT 4
- Meteoclimatic HOT 1
- 'MpdDevice' object has no attribute '_playlists' HOT 1
- Support for Tuya smart universal IR with integrated temperature/humidity sensor HOT 1
- Failed login attemtps return HTTP 200, should return 401 HOT 1
- Apple TV entity picture HOT 1
- Beta 2004.7 breaks integration HOT 2
- 2024.6.4 cannot not start up HACS HOT 1
- AirTouch 5 Integration stopped working after AirTouch update HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.