Reauthentication error
See original GitHub issueDescribe the bug Reauthentication is impossible. Opening the Amazon website from the addon will show an error. It seems to be related to the cookiejar conversion between aiohttp and httpx. Only way to get it going again is removing the integration and setting it up again.
To Reproduce Steps to reproduce the behavior:
- Reauthenticate
Expected behavior
Screenshots
System details
- Home-assistant (version): latest
- Hassio (Yes/No): (Please note you may have to restart hassio 2-3 times to load the latest version of alexapy after an update. This looks like a HA bug).
- alexa_media (version from
const.py
or HA startup): 3.10.15 - alexapy (version from
pip show alexapy
or HA startup): 1.25.3 (authcaptureproxy 1.1.1) - Amazon 2FA is enabled (y/n). We will not debug login issues if unanswered: yes
Logs
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 220, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 219, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
result = await result
File "/config/custom_components/alexa_media/config_flow.py", line 1122, in wrapped
return await cls.handler(request, **kwargs)
File "/usr/local/lib/python3.9/site-packages/authcaptureproxy/auth_capture_proxy.py", line 387, in all_handler
resp = await getattr(self.session, method)(
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1736, in get
return await self.request(
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1500, in request
request = self.build_request(
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 351, in build_request
return Request(
File "/usr/local/lib/python3.9/site-packages/httpx/_models.py", line 1099, in __init__
Cookies(cookies).set_cookie_header(self)
File "/usr/local/lib/python3.9/site-packages/httpx/_models.py", line 1792, in set_cookie_header
self.jar.add_cookie_header(urllib_request)
File "/usr/local/lib/python3.9/http/cookiejar.py", line 1367, in add_cookie_header
attrs = self._cookie_attrs(cookies)
File "/usr/local/lib/python3.9/http/cookiejar.py", line 1326, in _cookie_attrs
self.non_word_re.search(cookie.value) and version > 0):
TypeError: expected string or bytes-like object
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Comments:18
Top Results From Across the Web
WiFi Authentication Errors and Methods to Solve Them - Okta
An authentication error occurs when a device can't connect to WiFi. Learn about what causes WiFi authentication problems and how to fix ...
Read more >How to Fix WiFi Authentication Error Occurred on Android
This issue mostly means that your password for the network is wrong due to which it shows the authentication error message. You need...
Read more >Authentication Error Occurred? -10 Proven Fixes - Dr.Fone
Authentication error occurs when the “deal” between the Wi-Fi router and device fails due to certain reasons. First, the device sends the password...
Read more >5 Quick Methods To Solve WiFi Authentication Error in 2022
The most common solution for a WiFi authentication error or to fix authentication problem is to reset the WiFi connection in your network...
Read more >5 Ways to Fix Wi-Fi Authentication Problems on Android
How to fix Wi-Fi authentication problems on Android · Toggle Airplane mode · Forget and reconnect to the Wi-Fi network · Reboot your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In case it helps someone.
I had the exact same problem you describe @larena1 (exact same logs and similar system details). I tried what you proposed and had, again, the exact same result
Multiple cookies exist with name=session-id
.While investigating I found out that I had a remnant of a precious version in my configuration.yaml I had completly forgotten about :
I then did this:
@alandtse thank you for your work. I enjoy it a great deal.
It still uses the pickle to save the cookies.
I use it but I’ve never had the auth problems. I just am spending my time on other interests. Again, if I had time, I would’ve removed the reauth path and removed legacy login options. They generate too many repeat issues.