Closed JoshuaRedmond closed 2 years ago
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!
(message by CodeOwnersMention)
unifi documentation unifi source (message by IssueLinks)
Unifi console information: UDM Pro UniFi OS Version 1.11.4 Unifi Network Version 7.1.61
Start by upgrading to latest stable
Same here: UDM UniFi OS 1.12.22 Network 7.1.6
@stonith what do you think
I would like some integration debug logs that show what data is sent back from controller
Seeing the same issue and was going to raise a ticket for it this morning. Here's what I have from the logs with DEBUG turned on:
2022-07-06 16:29:07 DEBUG (MainThread) [aiounifi.controller] 200 text/html <ClientResponse(https://redacted.fu.com:443) [200 OK]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '450cfc95-2314-48d4-b4d3-da42e12b56df', 'Content-Type': 'text/html; charset=utf-8', 'Content-Length': '450', 'X-Response-Time': '3ms', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjc3JmVG9rZW4iOiI0NTBjZmM5NS0yMzE0LTQ4ZDQtYjRkMy1kYTQyZTEyYjU2ZGYiLCJpYXQiOjE2NTcxMzkzNDcsImV4cCI6MTY1NzE0Mjk0N30.3UymlcVR2ypMPYt7CB2U1l8pOhg8I17i1ZDTv6To_Us; path=/; samesite=none; secure; httponly', 'Date': 'Wed, 06 Jul 2022 20:29:07 GMT', 'Connection': 'keep-alive')> 2022-07-06 16:29:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/api/auth/login 2022-07-06 16:29:07 DEBUG (MainThread) [aiounifi.controller] 403 application/json <ClientResponse(https://redacted.fu.com:443/api/auth/login) [403 Forbidden]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'Content-Type': 'application/json; charset=utf-8', 'X-Response-Time': '3ms', 'Content-Length': '32', 'Date': 'Wed, 06 Jul 2022 20:29:07 GMT', 'Connection': 'keep-alive')> 2022-07-06 16:29:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/self/sites 2022-07-06 16:29:07 DEBUG (MainThread) [aiounifi.controller] 401 text/plain <ClientResponse(https://redacted.fu.com:443/proxy/network/api/self/sites) [401 Unauthorized]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '450cfc95-2314-48d4-b4d3-da42e12b56df', 'X-Response-Time': '3ms', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjc3JmVG9rZW4iOiI0NTBjZmM5NS0yMzE0LTQ4ZDQtYjRkMy1kYTQyZTEyYjU2ZGYiLCJpYXQiOjE2NTcxMzkzNDcsImV4cCI6MTY1NzE0Mjk0N30.3UymlcVR2ypMPYt7CB2U1l8pOhg8I17i1ZDTv6To_Us; path=/; samesite=none; secure; httponly', 'Content-Type': 'text/plain; charset=utf-8', 'Content-Length': '12', 'Date': 'Wed, 06 Jul 2022 20:29:07 GMT', 'Connection': 'keep-alive')> 2022-07-06 16:29:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/api/auth/login 2022-07-06 16:29:07 DEBUG (MainThread) [aiounifi.controller] 403 application/json <ClientResponse(https://redacted.fu.com:443/api/auth/login) [403 Forbidden]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'Content-Type': 'application/json; charset=utf-8', 'X-Response-Time': '0ms', 'Content-Length': '32', 'Date': 'Wed, 06 Jul 2022 20:29:07 GMT', 'Connection': 'keep-alive')> 2022-07-06 16:29:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/self/sites 2022-07-06 16:29:07 DEBUG (MainThread) [aiounifi.controller] 401 text/plain <ClientResponse(https://redacted.fu.com:443/proxy/network/api/self/sites) [401 Unauthorized]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '450cfc95-2314-48d4-b4d3-da42e12b56df', 'X-Response-Time': '3ms', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjc3JmVG9rZW4iOiI0NTBjZmM5NS0yMzE0LTQ4ZDQtYjRkMy1kYTQyZTEyYjU2ZGYiLCJpYXQiOjE2NTcxMzkzNDcsImV4cCI6MTY1NzE0Mjk0N30.3UymlcVR2ypMPYt7CB2U1l8pOhg8I17i1ZDTv6To_Us; path=/; samesite=none; secure; httponly', 'Content-Type': 'text/plain; charset=utf-8', 'Content-Length': '12', 'Date': 'Wed, 06 Jul 2022 20:29:07 GMT', 'Connection': 'keep-alive')>
UDM is the device where the controller is running. UnifiOS: 1.11.4 Network: 7.1.66
Same issue after upgrade....
Home Assistant: 2022.7.0 Supervisor: 2022.07.0 Operating System: 8.2 Frontend: 20220706.0 - latest
UnifiOS: 1.12.22 Network: 7.1.66
Saw it was failed, disabled -> enabled no change Deleted and tried to setup again -> Unknown Error Tried recreating local user on UDMPro - No change
@kungfuice
Seeing the same issue and was going to raise a ticket for it this morning. Here's what I have from the logs with DEBUG turned on:
UDM is the device where the controller is running. UnifiOS: 1.11.4 Network: 7.1.66
Thanks! Please go to the latest releases so we can make sure there are as few differences as possible
From your logs I can see that you get a 403 error
16:29:07 DEBUG (MainThread) [aiounifi.controller] 403 application/json
How are you hosting your UDM as you have a full url (https://redacted.fu.com:443)
Interesting that in your logs there is a cookie 'Set-Cookie'
with a token already on the first call, where as on my logs its empty
Yours
'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjc3JmVG9rZW4iOiI0NTBjZmM5NS0yMzE0LTQ4ZDQtYjRkMy1kYTQyZTEyYjU2ZGYiLCJpYXQiOjE2NTcxMzkzNDcsImV4cCI6MTY1NzE0Mjk0N30.3UymlcVR2ypMPYt7CB2U1l8pOhg8I17i1ZDTv6To_Us;
Mine
'Set-Cookie': 'TOKEN=;
I can't reproduce on my setup with UniFi OS 1.12.22, Network 7.1.66. I was only able to reproduce the 403 error when I typed my password incorrectly.
@stonith
I can't reproduce on my setup with UniFi OS 1.12.22, Network 7.1.66. I was only able to reproduce the 403 error when I typed my password incorrectly.
Can you check your debug logs if you (like me) get the empty cookie token on the first request (check_unifi_os)
On the initial request to https://{udm}/ yes it's empty cookie token:
Set-Cookie: TOKEN=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; samesite=none; secure; httponly
I also noticed the time stamp in your post now, I have the same issue in mine, 1970... Seems like there is a bug in UniFi.
I want to see if the log output changes for @kungfuice after upgrading. I also wonder if he runs UDM or UDM pro if there is a slight firmware difference between devices.
After updating to 1.12.22 on the UDM Pro seems to have fixed the issue, the logs now show the login going through properly
2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] 200 text/html <ClientResponse(https://redacted.fu.com:443) [200 OK]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '91c3a030-6c3a-43e8-bff0-8597616ce325', 'Content-Type': 'text/html; charset=utf-8', 'Content-Length': '450', 'X-Response-Time': '3ms', 'Set-Cookie': 'TOKEN=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; samesite=none; secure; httponly', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Connection': 'keep-alive')> 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/api/auth/login 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/api/auth/login) [200 OK]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': 'b33e7a47-b760-4f18-853a-c19b4e765574', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '6267', 'X-Response-Time': '193ms', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2ZTA1MTNkZi0wMmNjLTRkZWItOGVjOC0xNWFkOTI5NWVmNzEiLCJjc3JmVG9rZW4iOiJiMzNlN2E0Ny1iNzYwLTRmMTgtODUzYS1jMTliNGU3NjU1NzQiLCJpYXQiOjE2NTcyMjU4NjcsImV4cCI6MTY1NzIyOTQ2NywianRpIjoiYzJkYWZjNjQtNDk1My00ZDQzLTg3YTctYjgwNzAzYzk0NzQ0In0.ppKXCoaDTUkcgVrix3xtv-amCU7xtEhJ817I1DdDEeA; path=/; samesite=none; secure; httponly', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Connection': 'keep-alive')> 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/self/sites 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/proxy/network/api/self/sites) [200 OK]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'x-frame-options': 'DENY', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': 'b33e7a47-b760-4f18-853a-c19b4e765574', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '323', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2ZTA1MTNkZi0wMmNjLTRkZWItOGVjOC0xNWFkOTI5NWVmNzEiLCJjc3JmVG9rZW4iOiJiMzNlN2E0Ny1iNzYwLTRmMTgtODUzYS1jMTliNGU3NjU1NzQiLCJqdGkiOiJjMmRhZmM2NC00OTUzLTRkNDMtODdhNy1iODA3MDNjOTQ3NDQiLCJwYXNzd29yZFJldmlzaW9uIjoxNjU3MTM4ODU3LCJpYXQiOjE2NTcyMjU4NjcsImV4cCI6MTY1NzIyOTQ2N30.xNnn8vU1xTAcOBUYiaCAEzgwI6nmXN7VfnrAqtOiJ0o; path=/; samesite=none; secure; httponly', 'Connection': 'keep-alive')> 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] [{'_id': '5d01a14f7c90af001a10fd9d', 'anonymous_id': 'ce3dcae5-dcaa-43d1-9a46-5dd79204e2fc', 'attr_hidden_id': 'default', 'attr_no_delete': True, 'desc': 'Default', 'location_accuracy': 150.0, 'location_lat': 44.0981654, 'location_lng': -79.58613749999999, 'name': 'default', 'role': 'admin', 'role_hotspot': False}] 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] 200 text/html <ClientResponse(https://redacted.fu.com:443) [200 OK]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': 'afddfdbd-47b2-4c1e-90c9-8c912b9a9a07', 'Content-Type': 'text/html; charset=utf-8', 'Content-Length': '450', 'X-Response-Time': '1ms', 'Set-Cookie': 'TOKEN=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; samesite=none; secure; httponly', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Connection': 'keep-alive')> 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/api/auth/login 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/api/auth/login) [200 OK]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '1f45e199-7b3a-4377-973e-01ce9167e058', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '6267', 'X-Response-Time': '180ms', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2ZTA1MTNkZi0wMmNjLTRkZWItOGVjOC0xNWFkOTI5NWVmNzEiLCJjc3JmVG9rZW4iOiIxZjQ1ZTE5OS03YjNhLTQzNzctOTczZS0wMWNlOTE2N2UwNTgiLCJpYXQiOjE2NTcyMjU4NjcsImV4cCI6MTY1NzIyOTQ2NywianRpIjoiNTBiM2E1NjAtMzE1Yi00YWFkLTkyNjEtZTBmOTdjZDIwZDEyIn0.voMdNsSTrjAyx3E_7n84pugTkb0HA8lAFaCpo14-DMI; path=/; samesite=none; secure; httponly', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Connection': 'keep-alive')> 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/s/default/stat/sta 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/proxy/network/api/s/default/stat/sta) [200 OK]> <CIMultiDictProxy('Vary': 'accept-encoding', 'X-DNS-Prefetch-Control': 'off', 'x-frame-options': 'DENY', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '1f45e199-7b3a-4377-973e-01ce9167e058', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=UTF-8', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2ZTA1MTNkZi0wMmNjLTRkZWItOGVjOC0xNWFkOTI5NWVmNzEiLCJjc3JmVG9rZW4iOiIxZjQ1ZTE5OS03YjNhLTQzNzctOTczZS0wMWNlOTE2N2UwNTgiLCJqdGkiOiI1MGIzYTU2MC0zMTViLTRhYWQtOTI2MS1lMGY5N2NkMjBkMTIiLCJwYXNzd29yZFJldmlzaW9uIjoxNjU3MTM4ODU3LCJpYXQiOjE2NTcyMjU4NjcsImV4cCI6MTY1NzIyOTQ2N30.G0E6kPtMmxKvlSaqH0lD4izW7fEhKHO9HtPlWAwIZMY; path=/; samesite=none; secure; httponly', 'Connection': 'keep-alive', 'Transfer-Encoding': 'chunked')> 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/s/default/rest/user 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/proxy/network/api/s/default/rest/user) [200 OK]> <CIMultiDictProxy('Vary': 'accept-encoding', 'X-DNS-Prefetch-Control': 'off', 'x-frame-options': 'DENY', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '1f45e199-7b3a-4377-973e-01ce9167e058', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=UTF-8', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2ZTA1MTNkZi0wMmNjLTRkZWItOGVjOC0xNWFkOTI5NWVmNzEiLCJjc3JmVG9rZW4iOiIxZjQ1ZTE5OS03YjNhLTQzNzctOTczZS0wMWNlOTE2N2UwNTgiLCJqdGkiOiI1MGIzYTU2MC0zMTViLTRhYWQtOTI2MS1lMGY5N2NkMjBkMTIiLCJwYXNzd29yZFJldmlzaW9uIjoxNjU3MTM4ODU3LCJpYXQiOjE2NTcyMjU4NjcsImV4cCI6MTY1NzIyOTQ2N30.G0E6kPtMmxKvlSaqH0lD4izW7fEhKHO9HtPlWAwIZMY; path=/; samesite=none; secure; httponly', 'Connection': 'keep-alive', 'Transfer-Encoding': 'chunked')> 2022-07-07 16:31:07 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/s/default/stat/device 2022-07-07 16:31:08 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/proxy/network/api/s/default/stat/device) [200 OK]> <CIMultiDictProxy('Vary': 'accept-encoding', 'X-DNS-Prefetch-Control': 'off', 'x-frame-options': 'DENY', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '1f45e199-7b3a-4377-973e-01ce9167e058', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=UTF-8', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2ZTA1MTNkZi0wMmNjLTRkZWItOGVjOC0xNWFkOTI5NWVmNzEiLCJjc3JmVG9rZW4iOiIxZjQ1ZTE5OS03YjNhLTQzNzctOTczZS0wMWNlOTE2N2UwNTgiLCJqdGkiOiI1MGIzYTU2MC0zMTViLTRhYWQtOTI2MS1lMGY5N2NkMjBkMTIiLCJwYXNzd29yZFJldmlzaW9uIjoxNjU3MTM4ODU3LCJpYXQiOjE2NTcyMjU4NjcsImV4cCI6MTY1NzIyOTQ2N30.G0E6kPtMmxKvlSaqH0lD4izW7fEhKHO9HtPlWAwIZMY; path=/; samesite=none; secure; httponly', 'Connection': 'keep-alive', 'Transfer-Encoding': 'chunked')> 2022-07-07 16:31:08 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/s/default/rest/dpiapp 2022-07-07 16:31:08 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/proxy/network/api/s/default/rest/dpiapp) [200 OK]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'x-frame-options': 'DENY', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '1f45e199-7b3a-4377-973e-01ce9167e058', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '30', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2ZTA1MTNkZi0wMmNjLTRkZWItOGVjOC0xNWFkOTI5NWVmNzEiLCJjc3JmVG9rZW4iOiIxZjQ1ZTE5OS03YjNhLTQzNzctOTczZS0wMWNlOTE2N2UwNTgiLCJqdGkiOiI1MGIzYTU2MC0zMTViLTRhYWQtOTI2MS1lMGY5N2NkMjBkMTIiLCJwYXNzd29yZFJldmlzaW9uIjoxNjU3MTM4ODU3LCJpYXQiOjE2NTcyMjU4NjgsImV4cCI6MTY1NzIyOTQ2OH0.iaxtkvHtaIScCZyEaBHWkC2dJKj6sSddqKcK5PQgibI; path=/; samesite=none; secure; httponly', 'Connection': 'keep-alive')> 2022-07-07 16:31:08 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/s/default/rest/dpigroup 2022-07-07 16:31:08 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/proxy/network/api/s/default/rest/dpigroup) [200 OK]> <CIMultiDictProxy('Vary': 'Origin', 'X-DNS-Prefetch-Control': 'off', 'x-frame-options': 'DENY', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '1f45e199-7b3a-4377-973e-01ce9167e058', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '167', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2ZTA1MTNkZi0wMmNjLTRkZWItOGVjOC0xNWFkOTI5NWVmNzEiLCJjc3JmVG9rZW4iOiIxZjQ1ZTE5OS03YjNhLTQzNzctOTczZS0wMWNlOTE2N2UwNTgiLCJqdGkiOiI1MGIzYTU2MC0zMTViLTRhYWQtOTI2MS1lMGY5N2NkMjBkMTIiLCJwYXNzd29yZFJldmlzaW9uIjoxNjU3MTM4ODU3LCJpYXQiOjE2NTcyMjU4NjgsImV4cCI6MTY1NzIyOTQ2OH0.iaxtkvHtaIScCZyEaBHWkC2dJKj6sSddqKcK5PQgibI; path=/; samesite=none; secure; httponly', 'Connection': 'keep-alive')> 2022-07-07 16:31:08 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/s/default/rest/wlanconf 2022-07-07 16:31:08 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/proxy/network/api/s/default/rest/wlanconf) [200 OK]> <CIMultiDictProxy('Vary': 'accept-encoding', 'X-DNS-Prefetch-Control': 'off', 'x-frame-options': 'DENY', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Accept-Ranges': 'bytes', 'X-CSRF-Token': '1f45e199-7b3a-4377-973e-01ce9167e058', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=UTF-8', 'Date': 'Thu, 07 Jul 2022 20:31:07 GMT', 'Set-Cookie': 'TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2ZTA1MTNkZi0wMmNjLTRkZWItOGVjOC0xNWFkOTI5NWVmNzEiLCJjc3JmVG9rZW4iOiIxZjQ1ZTE5OS03YjNhLTQzNzctOTczZS0wMWNlOTE2N2UwNTgiLCJqdGkiOiI1MGIzYTU2MC0zMTViLTRhYWQtOTI2MS1lMGY5N2NkMjBkMTIiLCJwYXNzd29yZFJldmlzaW9uIjoxNjU3MTM4ODU3LCJpYXQiOjE2NTcyMjU4NjgsImV4cCI6MTY1NzIyOTQ2OH0.iaxtkvHtaIScCZyEaBHWkC2dJKj6sSddqKcK5PQgibI; path=/; samesite=none; secure; httponly', 'Connection': 'keep-alive', 'Transfer-Encoding': 'chunked')> 2022-07-07 16:31:08 DEBUG (MainThread) [aiounifi.controller] https://redacted.fu.com:443/proxy/network/api/self/sites 2022-07-07 16:31:08 DEBUG (MainThread) [aiounifi.controller] 200 application/json <ClientResponse(https://redacted.fu.com:443/proxy/network/api/self/sites) [200 OK]>
Our logs look the same now @kungfuice thanks. Now to find the next one with issues...
Our logs look the same now @kungfuice thanks. Now to find the next one with issues...
It should probably be noted in the integration docs that UDM 1.12 is required? I don't have the time to downgrade and debug 1.11 either.
It shouldn't be 1.12. the requirement is latest stable
Could this be related to PR# https://github.com/home-assistant/core/issues/74551 - "Python 3.10 ssl cipher defaults in HA 2022.7.0 break the Elk M1 integration"?
Updating to the latest Unifi OS (1.12.22) and Network 7.1.66) versions seems to have solved the issue for me, although I'm not sure why HA updating would have triggered the issue. Happy for this to be closed though, as it seems updating Unifi fixed it for others too.
Noticed that while the Dream Machine Pro was working, when in the UI some info was not updating or blank. Rebooted the DMP and was able to recreate the integration and its working again.
UPDATE: Still working with latest HA update to 2022.7.1
Updating to the latest Unifi OS (1.12.22) and Network 7.1.66) versions seems to have solved the issue for me, although I'm not sure why HA updating would have triggered the issue. Happy for this to be closed though, as it seems updating Unifi fixed it for others too.
Lets keep it open a couple of days more, but it seems being on 1.12 release and 7.1.6X and having a freshly restarted system resolves this issue.
Can confirm I've had this exact error for a couple of weeks, on HA release 2022.6.6 and on 2022.7.0 and on 2022.7.1, with the UDM on 1.11.x - updating UDM Pro to version 1.12.22 this morning fixed it instantly - Network app was the latest - it was only updating the Unifi OS to 1.12.22 that fixed it.
Thanks for verifying @philmale UniFi is hard to get right :)
Closing this as multiple positive reports on upgrading to 1.12.22 and 7.1.6X or restarting the system resolves the issue.
Edit: Maybe this is related to #74013
Are we sure this is fixed?
My unifi switch automations are not working correctly. I have deleted and re-added the integration and rebooted all unifi devices multiple times
I am on 1.12.22 and 7.2.88 (previously 7.2.85). I am not sure how to roll back the controller on the UDM, else I would. I may try 7.2.91 soon.
Sometimes I get a 401 error and sometimes it works.
Below is the log:
Logger: homeassistant.components.websocket_api.http.connection Source: components/unifi/switch.py:340 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 9:09:13 AM (2 occurrences) Last logged: 9:09:14 AM
[140181116171744] Call https://192.168.1.1:443/proxy/network/api/s/default/cmd/stamgr received 401 Unauthorized Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 193, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/components/homeassistant/init.py", line 124, in async_handle_turn_service await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 680, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 717, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 340, in async_turn_on await self.controller.api.clients.unblock(self.client.mac) File "/usr/local/lib/python3.10/site-packages/aiounifi/interfaces/clients.py", line 32, in unblock return await self.controller.request( File "/usr/local/lib/python3.10/site-packages/aiounifi/controller.py", line 287, in request return await self._request(method, url, json) File "/usr/local/lib/python3.10/site-packages/aiounifi/controller.py", line 323, in _request raise LoginRequired(f"Call {url} received 401 Unauthorized") aiounifi.errors.LoginRequired: Call https://192.168.1.1:443/proxy/network/api/s/default/cmd/stamgr received 401 Unauthorized
Even if it's the same error the circumstances are different. Can you create a new issue?
The problem
Potentially related to #74547 but different error in logs.
Following update to 2022.7.0 I can see the below error in the logs. Not fixed by temporarily disabling and re-enabling the integration. Upon removing the integration, I get the following error when trying to add it again, and the same error in the logs. I've confirmed that the Unifi credentials are correct and allow me to log into the console without issue.
What version of Home Assistant Core has the issue?
2022.7.0
What was the last working version of Home Assistant Core?
2022.6.6
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Unifi Network
Link to integration documentation on our website
https://www.home-assistant.io/integrations/unifi
Diagnostics information
Unable to provide as integration no longer installed
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response