alexa_media_player: 500 Internal server error while stting up

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.

see also #2136

Describe the bug

I am new to HA and want to install Alexa Media Player. All went fine until I have to do the captcha. There I am running into a 500 error. Even if I want to get a new picture. The path I have

To Reproduce

fresh install restart Home assistant add integration alexa media player fill the configuration (amazon unser, amazon, password, for region, home assistant url, 2FA key) and send check the OTA key

login for alexa is comming up prefilled amazon login and password press button to login

captcha is showing (/auth/alexamedia/proxy/ap/signin/144-3911749-1675617) clicking on “neue Zeichen anzeigen” causes an 500 (Server got itself in trouble) or filling the captcha question is doing the same

Expected behavior

The integration shall install proper


System details

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

Logs Please provide logs.

Additional context

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Reactions: 4
  • Comments: 56 (2 by maintainers)

Most upvoted comments

Hello, I recently discovered a solution that resolved this issue for me. When you’re in your 2FA settings on Amazon, make sure to FULLY enable 2FA.

I had already activated 2FA with SMS, but it wasn’t fully activated. I was able to generate the OTP secret code and so on, but the Alexa Media Player was giving me a 500 error.

I noticed a button to enable 2FA located below the button to create a new code. After fully enabling 2FA and generating a new OTP “master” code, which I then provided to the Alexa Media Player, the 500 error disappeared.

I solved this way:

  1. I went to my Two-Step Verification settings and disabled it, clearing my settings too (there is a checkbox to clear them)
  2. I enabled Two-Step Verification again setting the Authenticator APP as preferred method (before I had text message as preferred method). I also checked the box to not ask again OTP on this browser
  3. I installed the dev version of Alexa Media Player
  4. I restarted the ha docker container and the reverse proxy container
  5. I opened home assistant using my public duckdns hostname (with https)
  6. I setup the Alexa Media Player with email, password, domain (mine is and URL (I used the duckdns url with https protocol). I left 2FA key empty
  7. In the Alexa Sign in page I cleared the password field and typed it manually
  8. For the first time the next page was not a captcha, but it asked for otp. After filling it the integration was installed

Having the exactly same issue. My 2FA is disabled.

Same issue here! Try this Fix:

It should NOT be this difficult. The sooner I can turn off Alexa, the better. We’e almost there…

Understand that this is not a full-time project for myself or any of the other maintainers, it is a pet project that I started years ago based on the excellent work of yet another person who enjoyed hacking away at things in our free time.

Both @alandtse and I are not Amazon developers and as mentioned in the readme, this code mimics the Alexa app to the best of its ability, things can break when Amazon changes things or outright stop working if Amazon decides to cut us off.

Amazon themselves has an entire team of engineers dedicated to the development of the Alexa App, when here we have a handful of developers who make improvements, fix bugs, etc. in their spare time.

Additionally throughout the life of this project, it has been extremely clear that the Amazon Alexa API has nuances and variations for each regional location, small code changes and catches for things that exist in the North American region and do not exist elsewhere. As this project is based on reverse engineering that Amazon Alexa API it is impossible for the small community of supporters on this project to account for and deal with every single variation across those regional locations.

I do want you to know that I understand your frustration and I do wish I had better answer for you, but I hope the above gives you some insight into the fact that at the end of the day it is impossible for us to account for every single issue and variation.

Finally I got everything running with support from the video mentioned above and a complete new install.

So, fresh install with no other integrations? Or??? “Complete new install” could also mean remove the integration and add it back.

First I removed the Alexa Player integration, then updated Home Assistant to the beta version and then renstalled the integration and went through the config process.