Troubleshooting rabbithole of the day:
- My Unifi Protect metrics exporter no longer works because it crashes on a KeyError
- The KeyError is actually an unhandled auth error, oops.
- The auth just fails with no further details. Added plenty more debugging and turns out the #aiohttp session object cookie jar is empty, no auth for me.
- The
Set-Cookie
header on the POST call response does have the right token, so login works! But the response cookies is empty, so is the session cookie jar. Hrmph! - Figure out behind the scenes it loads the header raw into a
http.cookies.SimpleCookie
, which when manually replicating indeed silently without error just doesn't load the data! Not great. - Turns out it balks if the cookie contains a
partitioned
argument, just refuses silently to load the cookie.
[1/2]