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

Error install Alexa Media Player "Config flow could not be loaded: {“message”:“Invalid handler specified”}" #2813

Closed
Apollon16 opened this issue Jan 30, 2025 · 7 comments

Comments

@Apollon16
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.

Describe the bug

Hello,

A few days ago the Alexa Media Player integration refused to launch (see screenshot).
I uninstalled the integration and wanted to reinstall it and since then I have this error message (see screenshot).
While searching on the forum, I understood that I have a problem with pyotp. Being hard HAOS, how do I install or reinstall pyotp?
Thank you

To Reproduce

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

Expected behavior

I would like to be able to reinstall Alexa Media Player for my voice automation with Alexa.

Screenshots

Image

Image

System details

  • Home Assistant version: 2025.1.4
  • alexa_media version (from const.py or HA startup log): ??
  • alexapy version (from pip show alexapy in homeasssistant container or HA startup log): Non, container, HAOS
  • Is Amazon 2FA/2SV enabled <!---We will not debug login issues if unanswered---> (y/n):
  • Amazon Domain:

Debug Logs (alexa_media & alexapy)
Enregistreur: homeassistant.loader
Source: loader.py:1272
S'est produit pour la première fois: 29 janvier 2025 à 20:44:12 (10 occurrences)
Dernier enregistrement: 13:03:45

Unexpected exception importing platform custom_components.alexa_media.config_flow
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1272, in _load_platform
cache[full_name] = self._import_platform(platform_name)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1304, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.13/importlib/init.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1310, in _find_and_load_unlocked
File "", line 488, in _call_with_frames_removed
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 1026, in exec_module
File "", line 488, in _call_with_frames_removed
File "/config/custom_components/alexa_media/init.py", line 18, in
from alexapy import (
...<9 lines>...
)
File "/usr/local/lib/python3.13/site-packages/alexapy/init.py", line 17, in
from .alexaapi import AlexaAPI
File "/usr/local/lib/python3.13/site-packages/alexapy/alexaapi.py", line 24, in
from .alexalogin import AlexaLogin
File "/usr/local/lib/python3.13/site-packages/alexapy/alexalogin.py", line 76, in
class AlexaLogin:
...<1703 lines>...
self._headers.pop("Content-Type", None)
File "/usr/local/lib/python3.13/site-packages/alexapy/alexalogin.py", line 263, in AlexaLogin
def set_totp(self, otp_secret: str) -> Optional[pyotp.TOTP]:
^^^^^^^^^^
AttributeError: module 'pyotp' has no attribute 'TOTP'

Additional context

Enregistreur: homeassistant.config_entries
Source: config_entries.py:3314
S'est produit pour la première fois: 29 janvier 2025 à 20:44:13 (5 occurrences)
Dernier enregistrement: 13:03:45

Error occurred loading flow for integration alexa_media: Exception importing custom_components.alexa_media.config_flow

@danielbrunt57
Copy link
Collaborator

Image

should be...

Image

@ManuVice
Copy link

I have the exact same problem with 5.4.0

@danielbrunt57
Copy link
Collaborator

Try running pip install pyotp in the homeassistant container...

@ManuVice
Copy link

ManuVice commented Feb 1, 2025

Iam using Home Assistant OS. I dont know how to install it 😅 from AppDaemon? from terminal it didn't work

edit:

ok with apk update, apk search pyotp, I get py3-otp
Installed it.. same error

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Feb 1, 2025

In terminal run sudo docker exec -it homeassistant bash to get into the homeassistant container

➜  ~ sudo docker exec -it homeassistant bash
homeassistant:/config# pip show pyotp
Name: pyotp
Version: 2.8.0
Summary: Python One Time Password Library
Home-page: https://github.com/pyotp/pyotp
Author: PyOTP contributors
Author-email: [email protected]
License: MIT License
Location: /usr/local/lib/python3.13/site-packages
Requires:
Required-by: AlexaPy, opower
homeassistant:/config#

Image

@ManuVice
Copy link

ManuVice commented Feb 1, 2025

Thank you!

I had to use "Advanced SSH & Web Terminal" addon with protected mode disabled. After that reinstalled pyotp with "pip install --no-cache-dir pyotp --root-user-action=ignore" and restart HA OS system

@Apollon16
Copy link
Author

Hello,
I just tested your solutions and it worked.
Thank you all for this help.

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

3 participants