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.53k stars 290 forks source link

500 Internal Server Error #2663

Open nicolux2006 opened 3 weeks ago

nicolux2006 commented 3 weeks 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

When I try to log in to Amazon.de via Alexa Media Player integration. It gives me then the Captcha and then I always end up with a “500 Internal Server Error / Server got itself in trouble”. This also happens when I replace the Local URL with the Public (Nabu Casa) URL.

To Reproduce

Setup the Integration and Login to your Amazon Account

Expected behavior

My expected behavior was that I would then see my Alexa devices in the Home Assistant.

Screenshots

image

System details

Debug Logs (alexa_media & alexapy) Please provide logs.

Additional context

DomeGr694 commented 3 weeks ago

Same here. I try it since yesterday

SmilinStanSStanman commented 3 weeks ago

Same here. I try it today...

alekseyn1 commented 3 weeks ago

Same. Tried multiple iterations of URLs and such. Still the same issue.

dunkelheim commented 3 weeks ago

I ran into that as my password was wrong - maybe double check it.

SmilinStanSStanman commented 3 weeks ago

Thanks dunkelheim! I don't know why, but the configuration was being completed with a wrong password too...

christianlappin commented 3 weeks ago

Im in the US and hitting amazon.com and getting the same error. I have rebooted and un-installed/re-installed. From Terminal installed alexapy as it was not installed. Also running latest version of HA and integration. Using local IP and then for public IP the naba casa IP. Confirmed user/pass/2fa with different browsers and no go :(

ElleScott commented 3 weeks ago

Error: ### 500 Internal Server Error Server got itself in trouble Add Integration Alexa Media Player Completed UN: and PW: Takes me to the Amazon login page Verified password accuracy Takes me a captcha screen Before I can complete the captcha Receive: 500 Internal Server Error Server got itself in trouble

Current System: Core 2024.10.4 Supervisor 2024.10.3 Operating System 13.2

Version of Alexa Media Player attempting to install: v4.13.7

danielbrunt57 commented 3 weeks ago

Please use the Amazon 2SV/OTP method for account login. AMP/alexapy seems to no longer be able to deal with Amazon's CAPTCHA for non-2SV accounts...

christianlappin commented 3 weeks ago

OMG this is amazing. Thanks @danielbrunt57 I disabled my 2FA application and switched to OTP via phone codes and the integration set-up perfectly. Thank you!! I liked the extra security of my 2FA app so hopefully AMP/Alexpy will update to support the CAPTCHA in the soon future.

For now its working and I am super appreciative.

danielbrunt57 commented 3 weeks ago

OMG this is amazing. Thanks @danielbrunt57 I disabled my 2FA application and switched to OTP via phone codes and the integration set-up perfectly. Thank you!! I liked the extra security of my 2FA app so hopefully AMP/Alexpy will update to support the CAPTCHA in the soon future. For now its working and I am super appreciative.

I'm glad you got it setup~

Everything works perfectly fine here using OTP via 2SV Authenticator app secret key. Once or twice in several hundred re&re's I got the dreaded captcha window but resolved it by clearing browser cookies & cached files, logging into Amazon to fulfill the first time login which gives you a captcha the first time but not again on subsequent logins, then logged into HA and installed AMP.

johnpc commented 2 weeks ago

I'm confused - what did you do to work around the issue? I don't know what is meant by AMP/alexapy vs Amazon 2SV/OTP or how to use one vs the other. No matter what I do, when I log in and do the captcha, I get 500 Internal Server Error.

Additionally, my setup ui does not have a Use Login Proxy method option, even though at the top of it it says For legacy configuration, disable Use Login Proxy method option..

danielbrunt57 commented 2 weeks ago

Don't use legacy yaml method...use the UI config method. In Amazon account, enable 2SV with authenticator app (Accounts > Login & security > 2-step verification) and capture the 52-character secret key (displayed when you select Can't scan the barcode?) as that will be input when you configure AMP via the UI config method. You can use the same authenticator app code in your authenticator app and AMP or you can Add a second 2SV authenticator just for AMP if you prefer. Myself, I only use one for both. Make sure once you've enabled 2SV in your account that you log out and back in to make sure it's working. When this is working correctly, there should be no CAPTCHA screen, unless you clear or reset your browser settings, in which case you will get one the first time you log into your account again, but it should not occur after the initial login.

johnpc commented 2 weeks ago

Unfortunately, following those instructions does not work. I still see the captcha and get the 500 error.

Here is a screen recording of my attempt: https://files.jpc.io/d/hMohh-Screen%20Recording%202024-11-11%20at%2012.38.22%E2%80%AFAM.mov

Do not worry about the exposed password/2FA app key in the video. I've already changed the password and removed the 2fa app from my amazon account.

danielbrunt57 commented 2 weeks ago

I watched your video and then attempted to replicate your steps.

  1. I did not get a captcha screen.
  2. I noticed you are using Safari whereas I use Edge. That might be relevant, or not?
  3. I think you solved the captcha incorrectly. In the video, I see "5mpgrb" but you entered "5rmpgrb".
johnpc commented 2 weeks ago

Thanks. Unfortunately I have tried multiple browsers including Firefox and Chrome with the same result.

I have also solved many captchas so I'm sure I've gotten most of them right 😅.

It actually doesn't matter what I do from the captcha screen. If I choose "See new characters" or "Hear the characters" it also gives me the same 500 error.

I am on the latest HAOS and latest Alexa Media Player from HACs. I do not know what else could be wrong with my setup.

danielbrunt57 commented 2 weeks ago

Do you have any firewalling enabled?

johnpc commented 2 weeks ago

I do not have any firewalling enabled

CyberDevil75 commented 1 week ago

Same problem, I used Chrome, Edge, mobile, notebook, Playstation... with and without 2FA (withi mobile app, with SMS etc.)... I have try to change the interna URL with direct IP and port, with domani name, with and without local... I have tryed all the imaginable guide and topic online and nothing have a solution for that! -.- I'm very frustrated!

divdax commented 1 week ago

Same for me. Always 500 Internal Server Error.

lukino188 commented 1 week ago

I have been stuck for more than one week but now looks is working. I did same as @johnpc but on 2fa key code part i did not remove any spaces.

johnpc commented 1 week ago

Lucky you! It's still happening to me - I just updated hoas and the amp HACs install but it's the same as in my video (regardless of whether I include the spaces in the 2fa key code)

danielbrunt57 commented 1 week ago

Lucky you! It's still happening to me - I just updated hoas and the amp HACs install but it's the same as in my video (regardless of whether I include the spaces in the 2fa key code)

Spaces in the OTP secret are irrelevant as they are automatically removed if present. I always enter the OTP app secret key including spaces and have never had an issue in several hundred re & re's.

abderlahmanalhnedi commented 3 days ago

Same for me. 🥲