-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NO DEVICES FOUND: api/phoenix repeatedly returns 429:Too Many Requests resulting in CancelledError & failure to get network details #2702
Comments
I have faced same issue:
|
Where are your devices registered? www.amazon.com or .de? Mine originally were registered in Amazon.com as that is where I bought my first echo. Since then, I've moved them to amazon.ca, then back to .com and earlier this year back to .ca (all moves were to gain access to skills only available in .com or in .ca). You have to use the domain where they are registered. Using another domain is pointless as it will fail to see them. If they are in .de, use .de. If that fails at some point, that failure needs to be investigated and fixed. Trying to add the integration with another domain will only succeed in authenticating and initial setup with the cookie but will fail to see devices. |
all my devices are registered n Amazon.de
if I am not mistaken it was Amazon alexa 4.8.12 |
I made it work
|
FYI, that entry is not for Alexa Media Player. |
@danielbrunt57 Please open the issue again. |
@Pingfragger Can you provide a log trace from beginning:
through to the point of failure? Make sure you've enabled debug for:
|
I have enabled the debug logging as requested and gathered logs from the beginning to the point of failure. The logs include detailed traces for alexapy, authcaptureproxy, custom_components.alexa_media, and httpx. You can find the full logs attached here: Please let me know if further details are needed or how to proceed. |
The logs show the
The result of a successful
I've modified my ** UPDATE ** |
I followed the suggested steps, including removing and re-adding the account, restarting Home Assistant, and ensuring the correct region (amazon.de) is used. However, the issue persists. I have attached the new logs for further analysis: Please let me know if additional debugging or changes are required. |
The problem is the api/phoenix call is failing:
22:44:45 - 22:44:30 = 15s. The final backoff of 16s does not have time to try again since the overall timeout for the request is 30s and is cancelled at 22:45:00. The 30-second timeout is defined in |
I have increased the timeout to 60 seconds in |
After careful analysis, I've discovered that inside
I'll keep digging but it's 3 am and I need some shut-eye... |
Thanks so much for all your hard work! |
With the assistance of ChatGPT, I've implemented I was having one or two "429: Too Many Requests" errors in the Here is the modified file: alexaapi.zip Keeping my fingers crossed! |
You're more than welcome!
In your new account log, the network details is retrieved on API call #2.
|
That is true, but I do not know enough about it to say what it means.
Where can I find the alexaapi.py? |
First, extract the new file to |
I tried to ssh into the parent docker container using the commands, but I can't:
In the file editor I can access the path Do you know why? |
Because you are only seeing a subset of the entire homeassistant raw container. |
Thanks for the clarification, I am relatively new to HA. |
Here's my newest version of |
Here is my log. It looks different, but unfortunately it still does not work. Account created but no devices added |
The version I sent you wasn't correct as the API calls are too frequent.
I've spent the last several hours debugging a new version and I just now heard alexa speak "home assistant has started" so I'm making progress! I have the semaphore lock based on region working but the tracking for ChatGPT is a great help but it does make mistakes! It is nice enough though to thank me for pointing out the error or oversight it made! I just have to wait now for my daily free session to reset so I can continue with it... |
|
I think I've finished it! _region_delay ensures a minimum delay since the last request by calling asyncio.sleep(delay - elapsed). |
You can use this automation to create a persistent notification when
|
I tried the new file and now it doesn't take 30 seconds to load after login, just a few seconds, but unfortunately there are still devices showing up. |
My apolgies! I forgot that I added this to alexalogin.py so I could use AMP's
AlexaLogin had a few advanced debug statements but only defined Replace your file with: alexalogin.zip |
No worries! |
Can you edit This will slow things down considerably but I am just attempting to achieve |
Sure. I changed that and here is the Log: |
Since extended delays did not work, change _region_limits = {"eu": 2, "fe": 3, "na": 4} Let's try and avoid the
You might also want to disable the system option |
Amazing! It worked! All devices are found with no errors. Thank you so much! Do I still have to disable Do you have any idea why it previously worked with the second account but not with my main account? The log of the working main account login: |
Since I'm not quite sure which setting is actually triggering the "429: Too Many Requests", you could try restoring |
I tested the following: Does |
I'm working on a feature change for This is the detailed response for my Alexa network: get_network_details response.txt As to whether too many devices or corruption is causing your error, I have no idea as that is handled by the undocumented Amazon API we're using. If it's simply too many devices, I would expect a Reference: List of HTTP status codes You may need to contact Amazon to address the corruption in your account or, delete the account and set it up from scratch again. Given my past experience trying to get support from Amazon, I'm not sure which approach is going to be the easier of the two! The trick with Amazon is being able to get past their Tier 1 support who quite often fail to understand the issue & try to pass it off with a generic answer. |
Thank you for your work! OT: Has Amazon reduced the possible features of the integration? |
That I don't know.
From the little bit of looking I did into OpenHAB (Java) a few months back, my takeaway is that it has more work being done on it than AMP and has continued to evolve and change, as has Apollon77/alexa-remote (JavaScript). Alexa Media Player (Python) not so much. They all have to emulate the Alexa app and the header information in AMP for that emulated app hasn't changed in years.
but there are HTTP headers scattered throughout the code and I'm wondering if all that old Alexa app versioning is affecting how Amazon responds. I can look up that info from Apollon77/alexa-remote and you can try changing it in |
My installation still works after editing
|
Is it possible to update AMP without undoing the changes I made? Thank you! |
No.
I believe so. The other changes had no effect on your solving your error. It wasn't until we disabled
I inquired in other posted issues re: no devices found if they had the 429 error but so far no responses either way. As it stands now, I'm thinking it may just be a problem in your original Amazon account and not an issue in general that needs fixing in AMP. |
Thanks for your work! What are the impacts and which functionalities, entities, or attributes are unavailable or not updated when |
Describe the bug
The Alexa Media Player integration is experiencing issues with region mismatch and API errors. When using amazon.de, no devices are found, and API errors occur. Switching to amazon.com lists devices but they cannot be controlled.
To Reproduce
The integration fails to authenticate properly with amazon.de, resulting in no devices being listed and API errors. When switching to amazon.com, devices appear but cannot be controlled, with logs showing domain mismatch errors between amazon.com and amazon.de.
Expected behavior
Devices should be discoverable and controllable using my Amazon region (amazon.de), without domain mismatch or authentication issues.
Screenshots
Login:
Errors after login (amazon.de)
Errors after login (amazon.de) with Set async_timeout to 300
Error after login (amazon.com)
Result of login in amazon.de and amazon.com
System details
Home Assistant version: Core 2024.11.3 - Supervisor 2024.11.4 - Operating System 13.2 - Frontend 20241106.2
alexa_media version: 4.13.7, 4.13.8 and 5.0.0 tested
alexapy version: 1.29.4
Is Amazon [2FA/2SV enabled]: Yes
Amazon Domain: amazon.de
Debug Logs (alexa_media & alexapy)
home-assistant_2024-11-28T22-18-34.509Z.log
Additional context
What I already tried:
All of this did not work
It worked to integrate my wife's account (Amazon.de without 2FA). The devices appear there
Assumption:
The problem might accur due to the number of devices in my account (Total about 110 devices - Echos and some sensors via the xiaomi skill). The devices cannot be deleted from the alexa app - > unknown error
The text was updated successfully, but these errors were encountered: