Skip to content
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

Alexa media player disconnect: Login error detected; not contacting API #2467

Closed
freehomeassistant opened this issue Aug 18, 2024 · 14 comments
Closed

Comments

@freehomeassistant
Copy link

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.

Dopo l’ultimo aggiornamento di Home Assistant (Core
2024.8.2
Supervisor
2024.08.0
Operating System
12.4
Frontend
20240809.0) Alexa media player chiede dopo qualche minuto di funzionamento di riconnettersi. Io procedo e tutto torna a funzionare per una mezz’ora circa, poi di nuovo errore. Ho provato anche a disinstallare e re-installare l’integrazione, ma il problema rimane. Ho un backup che riporta Home Assistant alla versione precedente ed in questa versione tutto funziona perfettamente

To Reproduce

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

Expected behavior

Screenshots

System details

  • Home-assistant (version): Core 2024.8.2 - Supervisor 2024.08.0 - Operating System 12.4 - Frontend 20240809.0
  • alexa_media (version from const.py or HA startup): 4.12.8
  • alexapy (version from pip show alexapy or HA startup):
  • Amazon 2FA is enabled (y/n). <!---We will not debug login issues if unanswered--->: Able

** Questo errore ha avuto origine da un'integrazione personalizzata.

Registratore: alexapy.helpers
Fonte: custom_components/alexa_media/init.py:786
Integrazione: Alexa Media Player (documentazione, problemi)
Prima occorrenza: 13:08:42 (2 occorrenze)
Ultima registrazione: 13:08:42

alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f70cf3461b0>,), {'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Unauthorized',)
alexaapi.get_last_device_serial((<alexapy.alexalogin.AlexaLogin object at 0x7f70cf3461b0>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Unauthorized',)

Registratore: alexapy.helpers
Fonte: util/async_.py:37
Prima occorrenza: 13:16:34 (6 occorrenze)
Ultima registrazione: 13:16:42

alexaapi.get_automations((<alexapy.alexalogin.AlexaLogin object at 0x7f70cf3461b0>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)
alexaapi.run_routine((<alexapy.alexaapi.AlexaAPI object at 0x7f70cfbee870>, 'Accendi condizionatore'), {'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)

Questo errore ha avuto origine da un'integrazione personalizzata.

Registratore: alexapy.helpers
Fonte: custom_components/alexa_media/media_player.py:639
Integrazione: Alexa Media Player (documentazione, problemi)
Prima occorrenza: 13:16:34 (3 occorrenze)
Ultima registrazione: 13:16:42

alexaapi.get_state((<alexapy.alexaapi.AlexaAPI object at 0x7f70cfbee870>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)

Registratore: homeassistant
Fonte: /usr/src/homeassistant/homeassistant/runner.py:148
Prima occorrenza: 13:16:34 (3 occorrenze)
Ultima registrazione: 13:16:49

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 639, in run_routine
automations = await AlexaAPI.get_automations(self._login)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 1417, in get_automations
response = await AlexaAPI._static_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 319, in _static_request
raise AlexapyLoginError("Login error detected; not contacting API")
alexapy.errors.AlexapyLoginError: Login error detected; not contacting API

Registratore: homeassistant.helpers.frame
Fonte: helpers/frame.py:184
Prima occorrenza: 13:16:52 (1 occorrenze)
Ultima registrazione: 13:16:52

Detected that custom integration 'alexa_media' accesses hass.components.persistent_notification. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from persistent_notification directly at custom_components/alexa_media/config_flow.py, line 645: self.hass.components.persistent_notification.async_dismiss(, please create a bug report at https://github.com/alandtse/alexa_media_player/issues
**
Please provide logs.

Additional context

@carvan
Copy link

carvan commented Aug 19, 2024

I'm having a similar issue since the upgrade to the .8 build. It is becoming extremely annoying as it works for a while and then it stops making all the automations that uses it useless. Already uninstalled and re-installed numerous times with no success. Is there something else that can be done?

image

@gianpietrocollavini
Copy link

I'm having a similar issue since the upgrade to the .8 build. It is becoming extremely annoying as it works for a while and then it stops making all the automations that uses it useless. Already uninstalled and re-installed numerous times with no success. Is there something else that can be done?

image

Same here 😩

@Legend6amer
Copy link

I have the same problem. No Fix yet?

@freehomeassistant
Copy link
Author

Today there was an update of the HACS integration of Alexa Media Player to v4.12.9. I have re-updated Home Assistant to the latest version 2024.8.2, I wait to see if the problem still occurs

@danielbrunt57
Copy link
Collaborator

Today there was an update of the HACS integration of Alexa Media Player to v4.12.9. I have re-updated Home Assistant to the latest version 2024.8.2, I wait to see if the problem still occurs

4.12.9 is the same as 4.12.8 except it skips trying to remove the .pickle file if alexapy is not 1.29.0
4.12.8 is the same as 4.12.7 except it tries to delete the .pickle file when deleting the integration config entry but generates an error with alexapy 1.28.x

@freehomeassistant
Copy link
Author

freehomeassistant commented Aug 19, 2024

In fact, thank you. The problem recurred after about an hour (It happens immediately instead if I do a total reboot of the system), below are the error reports:

Questo errore ha avuto origine da un'integrazione personalizzata.

Registratore: alexapy.helpers
Fonte: custom_components/alexa_media/init.py:786
Integrazione: Alexa Media Player (documentazione, problemi)
Prima occorrenza: 20:14:52 (2 occorrenze)
Ultima registrazione: 20:14:52

alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7fa7bf4791c0>,), {'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Unauthorized',)
alexaapi.get_last_device_serial((<alexapy.alexalogin.AlexaLogin object at 0x7fa7bf4791c0>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Unauthorized',)

Registratore: alexapy.helpers
Fonte: util/async_.py:37
Prima occorrenza: 20:39:41 (16 occorrenze)
Ultima registrazione: 20:48:46

alexaapi.get_automations((<alexapy.alexalogin.AlexaLogin object at 0x7fa7bf4791c0>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)
alexaapi.run_routine((<alexapy.alexaapi.AlexaAPI object at 0x7fa7c0cb5460>, 'Spegni condizionatore'), {'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)
alexaapi.run_routine((<alexapy.alexaapi.AlexaAPI object at 0x7fa7bc59b5f0>, 'Arrivato'), {'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)
alexaapi.run_routine((<alexapy.alexaapi.AlexaAPI object at 0x7fa7bc59b5f0>, 'Vado via'), {'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)

Registratore: homeassistant
Fonte: /usr/src/homeassistant/homeassistant/runner.py:148
Prima occorrenza: 20:39:44 (8 occorrenze)
Ultima registrazione: 20:48:47

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 639, in run_routine
automations = await AlexaAPI.get_automations(self._login)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/alexapy/helpers.py", line 137, in wrapper
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 1417, in get_automations
response = await AlexaAPI._static_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 319, in _static_request
raise AlexapyLoginError("Login error detected; not contacting API")
alexapy.errors.AlexapyLoginError: Login error detected; not contacting API

Registratore: homeassistant.config_entries
Fonte: config_entries.py:819
Prima occorrenza: 20:49:34 (1 occorrenze)
Ultima registrazione: 20:49:34

Error unloading entry <your_email> - amazon.it for notify
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 819, in async_unload
result = await component.async_unload_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/notify/init.py", line 135, in async_unload_entry
return await component.async_unload_entry(entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

Questo errore ha avuto origine da un'integrazione personalizzata.

Registratore: custom_components.alexa_media
Fonte: custom_components/alexa_media/init.py:1345
Integrazione: Alexa Media Player (documentazione, problemi)
Prima occorrenza: 20:49:34 (1 occorrenze)
Ultima registrazione: 20:49:34

Could not remove cookiefile: /config/.storage/alexa_media.<your_email>.pickle. Please manually delete the file.

@githubsharezone
Copy link

Continuo ad avere disconnessioni e mostra questo errore

logger:%20homeassistant%0ASource%3A%20/usr/src/homeassistant/homeassistant/runner.py:148%0AFirst%20occurred:%207:36:06%20PM%20(3%20occurrences)%0ALast%20logged:%209:05:23%20PM%0A%0AError%20doing%20job:%20Task%20exception%20was%20never%20retrieved%20(None)%0ATraceback%20(most%20recent%20call%20last):%0A%20%20File%20%22/usr/local/lib/python3.12/site-packages/alexapy/helpers.py%22,%20line%20137,%20in%20wrapper%0A%20%20%20%20return%20await%20func(*args,%20kwargs)%0A%20%20%20%20%20%20%20%20%20%20%20%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%0A%20%20File%20%22/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py%22,%20line%20889,%20in%20send_tts%0A%20%20%20%20await%20self.send_sequence(%0A%20%20File%20%22/usr/local/lib/python3.12/site-packages/alexapy/helpers.py%22,%20line%20137,%20in%20wrapper%0A%20%20%20%20return%20await%20func(*args,%20kwargs)%0A%20%20%20%20%20%20%20%20%20%20%20%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%0A%20%20File%20%22/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py%22,%20line%20512,%20in%20send_sequence%0A%20%20%20%20await%20self.run_behavior(node_data,%20queue_delay=queue_delay)%0A%20%20File%20%22/usr/local/lib/python3.12/site-packages/alexapy/helpers.py%22,%20line%20137,%20in%20wrapper%0A%20%20%20%20return%20await%20func(*args,%20kwargs)%0A%20%20%20%20%20%20%20%20%20%20%20%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%0A%20%20File%20%22/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py%22,%20line%20434,%20in%20run_behavior%0A%20%20%20%20await%20self._post_request(%22/api/behaviors/preview%22,%20data=data)%0A%20%20File%20%22/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py%22,%20line%20226,%20in%20_post_request%0A%20%20%20%20return%20await%20self._request(%22post%22,%20uri,%20data,%20query)%0A%20%20%20%20%20%20%20%20%20%20%20%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%0A%20%20File%20%22/usr/local/lib/python3.12/site-packages/backoff/_async.py%22,%20line%20151,%20in%20retry%0A%20%20%20%20ret%20=%20await%20target(*args,%20kwargs)%0A%20%20%20%20%20%20%20%20%20%20%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%0A%20%20File%20%22/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py%22,%20line%20199,%20in%20_request%0A%20%20%20%20raise%20AlexapyLoginError(%22Login%20error%20detected;%20not%20contacting%20API%22)%0Aalexapy.errors.AlexapyLoginError:%20Login%20error%20detected;%20not%20contacting%20API%0A

I’m tired

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Aug 19, 2024

Could not remove cookiefile: /config/.storage/alexa_media.<your_email>.pickle. Please manually delete the file.

This is a warning only in AMP 4.12.9 and you need to manually delete the .pickle file.
The next version of AMP will automatically delete the file for you.

@danielbrunt57
Copy link
Collaborator

I’m tired

Me too...

@1242scooter
Copy link

Following

@danielbrunt57 danielbrunt57 changed the title Alexa media player disconnect Alexa media player disconnect: AlexapyLoginError("Login error detected; not contacting API") Aug 20, 2024
@danielbrunt57 danielbrunt57 changed the title Alexa media player disconnect: AlexapyLoginError("Login error detected; not contacting API") Alexa media player disconnect: Login error detected; not contacting API Aug 20, 2024
@githubsharezone
Copy link

githubsharezone commented Aug 20, 2024 via email

@danielbrunt57
Copy link
Collaborator

Duplicate issue #2453

@msolomos
Copy link

msolomos commented Oct 5, 2024

I've tried many different backups as I take backup every night.
from 10.0 reverted back to 9.3. made no difference
from 9.3 reverted back to 8.3 made no difference.
On both I was getting the same errors

As soon as I reverted back to 7.4 from 8.3 ...everything worked again
(HACS is still on version v.2.0.1 and the integration is on v.4.13.1

@1242scooter
Copy link

1242scooter commented Oct 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants