alandtse / alexa_media_player

This is a custom component to allow control of Amazon Alexa devices in Home Assistant using the unofficial Alexa API.
Apache License 2.0
1.52k stars 290 forks source link

Integration no longer working #2592

Open ashoktvm opened 1 month ago

ashoktvm commented 1 month ago

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.

Describe the bug

All my Alexa devices got disabled. So I deleted the integration and tried adding it again. THen it asks to login to alexaa using my amazon id But even after giving correct username and password it keeps on coming back to to the login screen

To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Screenshots

System details

Debug Logs (alexa_media & alexapy) Please provide logs.

Additional context

grewhit25 commented 1 month ago

i have the same issue HA 2024.10.1 container.

emiliano25 commented 1 month ago

Same issue HA 2024.10.1 docker

LG69Domo commented 1 month ago

I've had the same problem, and resolve in this way:

ashoktvm commented 1 month ago

I've had the same problem, and resolve in this way:

  • From the Amazon login page (where you will be asked for username only and not for the password) check "Create new account"
  • Put XX in the first field and compile the module with your Amazon Account (if not already compiled), don't create a new one
  • At this point a page with the message that username already exist will appear.
  • Now check the box "Already have account" and it will show a page with Username and Password (and not only username as the first time),
  • go on and everything will work (it will ask for an OTP)

Not working. It still goes to the login page

xeonzen commented 1 month ago

this worked for me but goes to an error 500 screen after the captcha

ashoktvm commented 1 month ago

this worked for me but goes to an error 500 screen after the captcha

for me it goes to the username login page

MuhChy commented 1 month ago

Same problem for me. @alandtse is it possible to fix this?

chris2pple commented 1 month ago

for amazon.de server the same problem , endless login loop , very frustrating

addition , i tried the method with creating new amazon account and after receiving the message that the account already exists i switched back to already have an account and it worked, at least for me on the german Amazon servers

Stainy3244 commented 1 month ago

As 4.13.3 put HA into an infinite loop, it was pulled, but not before HA 2024 10.1 was updated to NOT accept any version at or before 4.13.3. If you're on HA 2024 10.1 it wont like AMP until it receives a correction release

assafshafran commented 1 month ago

As 4.13.3 put HA into an infinite loop, it was pulled, but not before HA 2024 10.1 was updated to NOT accept any version at or before 4.13.3. If you're on HA 2024 10.1 it wont like AMP until it receives a correction release

This was driving me crazy.. I disabled the integration for now. Just to make sure there isn’t any other option currently right?

Stainy3244 commented 1 month ago

Just to make sure there isn’t any other option currently right?

The only solution I'm aware of is stay on 4.13.2 / HA 2021.10.0 - I restored a backup

seganku commented 1 month ago

The only solution I'm aware of is stay on 4.13.2 / HA 2021.10.0 - I restored a backup

I restored a backup, then upgraded core to 2024.10.1. It's been working for me.

ashoktvm commented 1 month ago

The only solution I'm aware of is stay on 4.13.2 / HA 2021.10.0 - I restored a backup

I restored a backup, then upgraded core to 2024.10.1. It's been working for me.

I restored backup as well, but integration shows initializing.

zUpm4n commented 1 month ago

I've had the same problem, and resolve in this way:

  • From the Amazon login page (where you will be asked for username only and not for the password) check "Create new account"
  • Put XX in the first field and compile the module with your Amazon Account (if not already compiled), don't create a new one
  • At this point a page with the message that username already exist will appear.
  • Now check the box "Already have account" and it will show a page with Username and Password (and not only username as the first time),
  • go on and everything will work (it will ask for an OTP)

Worked. Thank you !!!!

aaklan commented 1 month ago

I've had the same problem, and resolve in this way:

  • From the Amazon login page (where you will be asked for username only and not for the password) check "Create new account"
  • Put XX in the first field and compile the module with your Amazon Account (if not already compiled), don't create a new one
  • At this point a page with the message that username already exist will appear.
  • Now check the box "Already have account" and it will show a page with Username and Password (and not only username as the first time),
  • go on and everything will work (it will ask for an OTP)

Worked for me too, thanks a lot! (For the later readers, I had difficulties to understand "compile the module with your Amazon Account " but it meant just to press the big blue button on the form for me :) )

MuhChy commented 1 month ago

For me i just Missed to Update hacs. After removing everything related to the old Alexa Media Player, i installed the newest hacs Version and then i used the workaround aaklan mentioned. Thx

aaklan @.***> schrieb am So. 6. Okt. 2024 um 09:48:

I've had the same problem, and resolve in this way:

  • From the Amazon login page (where you will be asked for username only and not for the password) check "Create new account"
  • Put XX in the first field and compile the module with your Amazon Account (if not already compiled), don't create a new one
  • At this point a page with the message that username already exist will appear.
  • Now check the box "Already have account" and it will show a page with Username and Password (and not only username as the first time),
  • go on and everything will work (it will ask for an OTP)

Worked for me too, thanks a lot! (For the later readers, I had difficulties to understand "compile the module with your Amazon Account " but it meant just to press the big blue button on the form for me :) )

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

ashoktvm commented 1 month ago

I dont know how u guys get the work around to work. May be I think its issue with amazon India

Xento commented 1 month ago

I have the same issue. When doing the normal workflow the website asks for the email address, on the next page it asks for the password. After submitting the password it returns to the email page.

When trying the workaround I must enter a captcha wich turns into a 500 server error when submitted.

EDIT: After a few tries it didn't required a captcha and directly prompted the 2FA

RocketKuhr commented 1 month ago

I have the same issue. When doing the normal workflow the website asks for the email address, on the next page it asks for the password. After submitting the password it returns to the email page.

When trying the workaround I must enter a captcha wich turns into a 500 server error when submitted.

I have the same problem. Also try to several times, but didnt get worked

ps: Domain is Amazon.de

lucasauda commented 1 month ago

Yesterday I installed my first Home Assistant (2024.10.1 with Docker on Raspberry Pi OS). Configuring this integration, I was trapped in the "back to username" loop. Now I'm happy to know I'm not that dumb...

Thanks to @LG69Domo, today I got it configured with the "create new account" workaround (on amazon.it). But my device (Echo Dot 4) stays in pending status. And after some minutes I got a reauthentication request.

This time the configuration form required the 2FA code too, and I wrote one generated with my authenticator app. Then I repeated the same procedure as before.

I also updated to the just released v4.13.4, but my device still doesn't connect...

I attach a log that I tried to create: home-assistant_alexa_media_2024-10-06T20-33-49.676Z.log

Thanks!

ashoktvm commented 1 month ago

4.13.4 still doesn't fix the loop to login page problem. @alandtse please look into this

tuxpoldo commented 1 month ago

It does not work with amazon.de - Same problem as described by other users - endless loop wile logging in - Error 500:

2024-10-07 11:46:22.515 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/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 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, 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/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 1049, 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 1905, in post
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1572, in request
    request = self.build_request(
              ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 358, in build_request
    return Request(
           ^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 338, in __init__
    Cookies(cookies).set_cookie_header(self)
  File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 1048, in set_cookie_header
    urllib_request = self._CookieCompatRequest(request)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 1184, in __init__
    super().__init__(
  File "/usr/local/lib/python3.12/urllib/request.py", line 318, in __init__
    self.full_url = url
    ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 344, in full_url
    self._parse()
  File "/usr/local/lib/python3.12/urllib/request.py", line 373, in _parse
    raise ValueError("unknown url type: %r" % self.full_url)
ValueError: unknown url type: '/auth/alexamedia/proxy/ap/register/138-0915940-8012813'
lucasauda commented 1 month ago

Hi @LG69Domo @zUpm4n @aaklan @MuhChy, sorry to bother you... Since you wrote the workaround worked, I wanna ask if your Amazon devices connect and behave properly. Maybe mine is another kind of issue...

grewhit25 commented 1 month ago

The ‘create new account’ workaround as mentioned above by @LG69Domo works for me and attached devices appears to be working fine; for ‘compile’ -> ‘submit’.

ugfus1630 commented 1 month ago

I've had the same problem, and resolve in this way:

* From the Amazon login page (where you will be asked for username only and not for the password)  check "Create new account"

* Put XX in the first field and compile the module with your Amazon Account (if not already compiled), don't create a new one

* At this point  a page with the message that username already exist will appear.

* Now check the box "Already have account" and it will show a page with Username and Password (and not only username as the first time),

* go on and everything will work (it will ask for an OTP)

It is worked for me. Two more info: OTP at the end will filled automatically just click ok. If you disabled the alexa integration before (because of the memory leak issue before), enable it after finish the setup steps (or before :-)).

I did the setup many times and later realized that I disabled the integration some days ago and after update and authenticate, it was still disabled.

Sectorchan commented 1 month ago

this workaround doesnt work for me, once its back in HA it says failed

DariusVaitkus commented 1 month ago

I just tested it now and successfully added integration to my backup system. I got the same login screen after entering password again and again. Then Noticed, that URL is pointing to my local IP. So I decided to add integration from my phone and from outside network, as I have cloudflared integration. So filled all fields - in both HA access URL and public URL I added my external domain, confirmed 2FA and got all my speakers in HA. And I did not use NabuCasa subscription.

Dazer95 commented 4 weeks ago

this worked for me but goes to an error 500 screen after the captcha

I got this too. Make sure you’re entering the right details

danielbrunt57 commented 4 weeks ago

Amazon has changed the login windows for the Alexa app and the original code in alexapy/AMP no longer works correctly.

goes to an error 500 screen after the captcha

I've found that after clearing your browser's cookies, you need to log into amazon once to fulfill the captcha and re-establish initial cookies. It was only after doing that that I could then successfully complete the AMP proxy authentication otherwise I got the infamous "500 error".

I got the same login screen after entering password again and again

This is kind of resolved with the latest alexapy/AMP version. The initial screen should now be the new customer screen with option to log into existing at which point after selecting you get the email & password prefilled on 1st window followed by the OTP prefilled window. AMP proxy auth callback only works with two screens - email & password, then OTP. Anything else will fail & return you to the first window to try again.

Also, the URL being your local IP is correct as that is how auth proxy callback works.

Suleiman700 commented 3 weeks ago

This may help you

image