alexa_media_player: 500 Internal Server Error when setting up: `httpx.ReadTimeout`

IMPORTANT: Please search the issues, including closed issues, and the FAQ before opening a new issue. The template is mandatory; failure to use it will result in issue closure.

Cannot get past last step of setup after captcha. will do 500 internal server error

To Reproduce

  1. Download this integration in HACS
  2. Go into devices & Integrations and hit add and select alexa_media_player

Expected behavior

For the setup to go through and complete

Screenshots

Screenshot 2024-08-08 at 2 25 08 PM Screenshot 2024-08-08 at 2 26 56 PM

System details

  • Home-assistant (version): 2024.8
  • alexa_media (version from const.py or HA startup): 4.12.7
  • alexapy (version from pip show alexapy or HA startup): 1.28.2
  • Amazon 2FA is enabled (y/n). Yes<!—We will not debug login issues if unanswered—>:

Logs `Logger: aiohttp.server Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:426 First occurred: 2:19:01 PM (2 occurrences) Last logged: 2:22:39 PM

Error handling request Traceback (most recent call last): File “/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py”, line 69, in map_httpcore_exceptions yield File “/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py”, line 373, in handle_async_request resp = await self._pool.handle_async_request(req) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py”, line 216, in handle_async_request raise exc from None File “/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py”, line 196, in handle_async_request response = await connection.handle_async_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py”, line 101, in handle_async_request return await self._connection.handle_async_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpcore/_async/http11.py”, line 143, in handle_async_request raise exc File “/usr/local/lib/python3.12/site-packages/httpcore/_async/http11.py”, line 113, in handle_async_request ) = await self._receive_response_headers(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpcore/_async/http11.py”, line 186, in _receive_response_headers event = await self._receive_event(timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpcore/_async/http11.py”, line 224, in _receive_event data = await self._network_stream.read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py”, line 32, in read with map_exceptions(exc_map): File “/usr/local/lib/python3.12/contextlib.py”, line 158, in exit self.gen.throw(value) File “/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py”, line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ReadTimeout

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File “/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py”, line 456, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py”, line 537, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py”, line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/http/security_filter.py”, line 92, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/http/forwarded.py”, line 83, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/http/request_context.py”, line 26, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/http/ban.py”, line 85, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 242, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/http/headers.py”, line 32, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/helpers/http.py”, line 73, in handle result = await handler(request, **request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/config/custom_components/alexa_media/config_flow.py”, line 1032, in wrapped return await cls.handler(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/authcaptureproxy/auth_capture_proxy.py”, line 439, in all_handler resp = await getattr(self.session, method)( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1892, in post return await self.request( ^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1574, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1661, in send response = await self._send_handling_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1689, in _send_handling_auth response = await self._send_handling_redirects( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1726, in _send_handling_redirects response = await self._send_single_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpx/_client.py”, line 1763, in _send_single_request response = await transport.handle_async_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py”, line 372, in handle_async_request with map_httpcore_exceptions(): File “/usr/local/lib/python3.12/contextlib.py”, line 158, in exit self.gen.throw(value) File “/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py”, line 86, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ReadTimeout`

Additional context

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 57 (1 by maintainers)

Most upvoted comments

I was getting a captcha when my password vault was filling the wrong user ID. Once I used the proper Amazon login credentials (not AWS!) it worked fine

On Fri, Aug 9, 2024, 06:16 mclemente1987 @.***> wrote:

I had same problem here, I just tryed to set up again 2SV on amazon, and it works… if could help us.

— Reply to this email directly, view it on GitHub https://github.com/alandtse/alexa_media_player/issues/2437#issuecomment-2277719254, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB32XY7PHR5PT3A3YYVJ6KTZQSQINAVCNFSM6AAAAABMHAZAGOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZXG4YTSMRVGQ . You are receiving this because you commented.Message ID: @.***>

I am following the instructions to the letter. I do not get the last screen shot, I get a Captcha.

Amazon account set up Screenshot 2024-08-09 114428

You can also get the same error if your amazon username or password is incorrect.

For me it all began to work after turning 2fa on in amazon.