Same issue with 401 authentication error when trying switch clients or portforwarding rules off and on. No issue adding integration.
Need some help getting this fixed.
fumper
(fumper)
August 1, 2024, 6:31pm
11
Also running into this issue, tried new user, only local, both view only on network and superadmin for the user, to no avail
jeleniain
(Jeleniain)
August 8, 2024, 10:07am
12
Same issue for me with local user only and only read rights.
Tried:
restarted the Unifi console/ controller and HA
removed the integration and re-added it with a new Unifi local user (could not re-add the integration with the previous user)
made sure SSL is not checked in the integration
am only using Unifi Network application
My UniFi OS version is 4.0.6
Home Assistant 2024.8.0
Robban
August 8, 2024, 3:44pm
13
You who still have issues; what UniFi gateway are you running?
jeleniain
(Jeleniain)
August 8, 2024, 9:51pm
14
Am using the relatively new Cloud Gateway Max .
Thanks for looking into this man and the integration. Its great
Robban
August 9, 2024, 6:43am
15
Ok, then you have this issue Authentication error 429/421 with controls but status sensors are working · Issue #122438 · home-assistant/core · GitHub
We’re trying to figure out what the difference is when doing a toggle on the UniFi app and through the integration.
jeleniain
(Jeleniain)
August 10, 2024, 6:25am
16
Thank Robban, I looked through the linked GitHub thread and the issue seem to be with HA toggle not acting the same way as using the button in the browser UI directly hence causing this issue. Interestingly, I see the same logs on more or less the same hardware (gateway ultra vs max) but I only use a local “READ” only admin account for UniFi. I only intend to read values hence did I not create and entities to control directly from HA. Ill test what happens if I use an admin account.
Edit: just tested with Unifi rights Full Management for both OS and Network and same warning shows in the logs. Ill Continue in Github thread to keep this a bit more clean here
duemes
(Joshua)
August 10, 2024, 1:08pm
17
I’m seeing this in the logs
Logger: homeassistant.components.unifi
Source: components/unifi/hub/entity_loader.py:94
integration: UniFi Network (documentation, issues)
First occurred: 8:52:11 AM (93 occurrences)
Last logged: 9:07:31 AM
Exception on update Call https://192.168.7.1:443/api/auth/login received 429: b’{“code”:“AUTHENTICATION_FAILED_LIMIT_REACHED”,“message”:“You've reached the login attempt limit”,“level”:“debug”}’
Exception on update Call https://192.168.7.1:443/proxy/network/v2/api/site/default/trafficrules received 401 Unauthorized
Robban
August 10, 2024, 1:45pm
18
Robban
August 16, 2024, 7:19pm
20
The issue has been resolved and a fix is out with 2024.8.2 release, the cause was a new type of cookie metadata not yet supported in python
1 Like
Robban
August 17, 2024, 9:59pm
22
I cant really take any Credit. Rsvi had hinted to the change in the unifi protect integration that solved the issue. I just copied it
tivoo
(Timo)
December 4, 2024, 9:59pm
23
Hey unfortunately this exact same error seems to have returned on HA 2024.12.0. Anyone else experiencing this error?
2 Likes
Yes, I have been getting this error since updating to 2024.12.0.
Sensors seem to be working.
I can’t see an option in the settings to reconfigure the user login.
Same failure for me on an Cloud Gateway Ultra
Completely deleted the unifi integration and restarted everything - still same error.
Sensors work - but all switches dont
Can you replicate this error?
@Robban
Same error here after last update. Swiches are not working anymore
Robban
December 6, 2024, 7:26am
27
I will check, I remember someone saying that the expected fix in the new python 3.13 wouldn’t get merged in time, and the fix in the library does not take effect on python 3.13 because it where supposed to be fixed
Thank, a fix would be appreaciated. I reverted back the update and now it works fine again.
Robban
December 7, 2024, 10:56pm
29
Fix has been merged and targets 2024.12.2 release
home-assistant:dev
← Kane610:unifi-bump_to_v81
opened 08:47AM - 07 Dec 24 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Breaking change
<!--
If your PR contains a breaking change for existing users, it is important
to tell them what breaks, how to make it work again and why we did this.
This piece of text is published with the release notes, so it helps if you
write it towards our users, not us.
Note: Remove this section if this PR is NOT a breaking change.
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
https://github.com/Kane610/aiounifi/compare/v80...v81
The previous fix expected partitioned cookies to be fixed in python 3.13 which didn't happen
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [x] Dependency upgrade
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #132518
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [ ] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [x] There is no commented out code in this PR.
- [x] I have followed the [development checklist][dev-checklist]
- [x] I have followed the [perfect PR recommendations][perfect-pr]
- [x] The code has been formatted using Ruff (`ruff format homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr