core: Unifi : No longer able to control Block/Unblock of network clients with latest HA Core.
The problem
HA no longer able to Block/Unblock network clients. Unifi configuration unchanged, controller version has not changed.
Environment
- RUnning on ver : Home Assistant 0.107.1
- Last working Home Assistant release (if known): Not Known
- Operating environment (Hass.io/Docker/Windows/etc.): Win10 hosting HASSIO VM.
- Integration causing this issue: Unifi COntroller
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/unifi
Problem-relevant configuration.yaml
Traceback/Error logs
Additional information
Integration Removed and Readded. No effect.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 61 (23 by maintainers)
I’ve been able to replicate the issue.
The session is expiring and being logged out AFAICT.
I tried to figure out what the root cause for “404 unauthorized” messages and I think here is the reason. Right after disable/enable the switch for block/unblock a device the following message got logged on UDM. I googled the error and it seems to be a problem with expired session cookies. Maybe it helps you or others to get the issue fixed somehow.
The path to the log file is: /mnt/data/unifi-os/unifi-core/logs/http.log
2020-06-25T12:28:11.339Z - error: [https] 8ms 404 POST /proxy/network/api/s/default/cmd/stamgr 2020-06-25T12:28:11.339Z - error: ForbiddenError: Invalid CSRF Token at Object.throw (/usr/share/unifi-core/app/webpack:/node_modules/koa/lib/context.js:97:11) at fn (/usr/share/unifi-core/app/webpack:/src/middleware/http/koa/csrf.js:21:34) at fn (/usr/share/unifi-core/app/webpack:/node_modules/koa-compose/index.js:42:32) at upstream (/usr/share/unifi-core/app/webpack:/node_modules/koa-compose/index.js:42:32) at fn (/usr/share/unifi-core/app/webpack:/node_modules/koa-mount/index.js:52:32) at upstream (/usr/share/unifi-core/app/webpack:/node_modules/koa-compose/index.js:42:32) at fn (/usr/share/unifi-core/app/webpack:/node_modules/koa-mount/index.js:52:32) at upstream (/usr/share/unifi-core/app/webpack:/node_modules/koa-compose/index.js:42:32) at fn (/usr/share/unifi-core/app/webpack:/node_modules/koa-mount/index.js:52:32) at dispatch (/usr/share/unifi-core/app/webpack:/node_modules/koa-compose/index.js:42:32) at proxyMiddleware (/usr/share/unifi-core/app/webpack:/node_modules/koa-compose/index.js:34:12) at fn (/usr/share/unifi-core/app/webpack:/src/middleware/http/appProxy/ui.js:58:12) at next (/usr/share/unifi-core/app/webpack:/node_modules/koa-compose/index.js:42:32) at redirectCheck (/usr/share/unifi-core/app/webpack:/src/middleware/http/koa/redirectCheck.js:20:79) at fn (/usr/share/unifi-core/app/webpack:/src/middleware/http/index.js:111:14) at i (/usr/share/unifi-core/app/webpack:/node_modules/koa-compose/index.js:42:32)