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.36k stars 265 forks source link

Can't add integration (Config flow could not be loaded: {"message":"Invalid handler specified"}) #2293

Open nilsburg opened 2 weeks ago

nilsburg commented 2 weeks ago

When trying to add the integration a popup shows with the following message:

Config flow could not be loaded: {"message":"Invalid handler specified"}

It was working but it stopped working since upgrading HA to 2024.6.3 (I think because of #2288) and wasn't able to reload (there was no reload option). I decided to remove the integration, remove the component from HACS and start fresh, but after adding the component with HACS and trying to add the integration I get the error.

  1. Go to 'Settings > Devices & services'
  2. Click on 'Add integration > Alexa Media Player'
  3. See error

System details

Logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in _load_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/alexa_media/__init__.py", line 16, in <module>
    from alexapy import (
  File "/usr/local/lib/python3.12/site-packages/alexapy/__init__.py", line 41, in <module>
    __maintainer__ = metadata["maintainer"]
                     ~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
    raise KeyError(item)
KeyError: 'maintainer'
2024-06-29 08:33:26.214 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module inside the event loop by integration 'config' at homeassistant/components/config/config_entries.py, line 179: return await super()._post_impl(request, data) (offender: /usr/src/homeassistant/homeassistant/loader.py, line 1281: return importlib.import_module(f"{self.pkg_path}.{platform_name}")), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+config%22
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 70, in wrapper
    return await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 172, in post
    return await self._post_impl(request, data)
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 179, in _post_impl
    return await super()._post_impl(request, data)

2024-06-29 08:33:26.216 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform custom_components.alexa_media.config_flow
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in _load_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/alexa_media/__init__.py", line 16, in <module>
    from alexapy import (
  File "/usr/local/lib/python3.12/site-packages/alexapy/__init__.py", line 41, in <module>
    __maintainer__ = metadata["maintainer"]
                     ~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
    raise KeyError(item)
KeyError: 'maintainer'
2024-06-29 08:33:26.217 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration alexa_media: Exception importing custom_components.alexa_media.config_flow
asiersan commented 1 week ago

same here

gittiralf commented 1 week ago

I have the same problem after updating homeassistant to release 2024.7

Fr3i4 commented 1 week ago

I have the same issue and try the same procedure to fix it, even the same logs and results....

jondiez commented 1 week ago

Same problem with Ha 2024.7.1 and alexa Media player 4.10.3. I have it configured but it does not load when HA starts

jalbertseg commented 1 week ago

Here too

jmservianri commented 1 week ago

Here too

jalbertseg commented 1 week ago

With 2024.7.1 it was resolved!

jmservianri commented 1 week ago

No differences with 2024.7.1, i have the same problem.

jondiez commented 1 week ago

Registrador: homeassistant.setup Fuente: setup.py:322 Ocurrió por primera vez: 15:35:27 (1 ocurrencias) Último inicio de sesión: 15:35:27

Setup failed for custom integration 'alexa_media': Unable to import component: Exception importing custom_components.alexa_media Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1050, in _get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, 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 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/alexa_media/init.py", line 16, in from alexapy import ( File "/usr/local/lib/python3.12/site-packages/alexapy/init.py", line 41, in maintainer = metadata["maintainer"]


  File "/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
    raise KeyError(item)
KeyError: 'maintainer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 990, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1061, in _get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.alexa_media

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1050, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/alexa_media/__init__.py", line 16, in <module>
    from alexapy import (
  File "/usr/local/lib/python3.12/site-packages/alexapy/__init__.py", line 41, in <module>
    __maintainer__ = metadata["maintainer"]
                     ~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
    raise KeyError(item)
KeyError: 'maintainer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 322, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1010, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1002, in async_get_component
    comp = self._get_component()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1061, in _get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.alexa_media
gittiralf commented 1 week ago

I could solve the problem by recreate my homeassistant docker container. Nothing else did it. Perhaps this tipp helps someone...

edudele commented 6 days ago

Pude resolver el problema recreando mi contenedor de Docker de HomeAssistant. No lo solucionó nada más. Quizás este consejo le sirva a alguien...

The container was recreated without a solution, the problem persists after updating and it always fails, not only when updating.

Same problem here HA 2024.7.1

jcss2503 commented 6 days ago

Same problem here! HA 2024.71

wischi83 commented 6 days ago

Same problem here! HA 2024.7.1

jorgbad commented 6 days ago

Same problem here! HA 2024.7.1

drufoval commented 4 days ago

Same problem here! HA 2024.7.1

casa3c commented 4 days ago

Same here:

Registrador: homeassistant.setup Fuente: setup.py:322 Ocurrió por primera vez: 16:51:13 (1 ocurrencias) Último inicio de sesión: 16:51:13

Setup failed for custom integration 'alexa_media': Unable to import component: Exception importing custom_components.alexa_media Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, 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 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/alexa_media/init.py", line 16, in from alexapy import ( File "/usr/local/lib/python3.12/site-packages/alexapy/init.py", line 41, in maintainer = metadata["maintainer"]


  File "/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
    raise KeyError(item)
KeyError: 'maintainer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1078, in _get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.alexa_media

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/alexa_media/__init__.py", line 16, in <module>
    from alexapy import (
  File "/usr/local/lib/python3.12/site-packages/alexapy/__init__.py", line 41, in <module>
    __maintainer__ = metadata["maintainer"]
                     ~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
    raise KeyError(item)
KeyError: 'maintainer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 322, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1019, in async_get_component
    comp = self._get_component()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1078, in _get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.alexa_media
jcss2503 commented 4 days ago

Upgraded HA to 2024.7.2. Problem persist

El mié, 10 jul 2024 a las 17:27, casa3c @.***>) escribió:

Same here:

Registrador: homeassistant.setup Fuente: setup.py:322 Ocurrió por primera vez: 16:51:13 (1 ocurrencias) Último inicio de sesión: 16:51:13

Setup failed for custom integration 'alexa_media': Unable to import component: Exception importing custom_components.alexa_media Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, 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 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/alexa_media/init.py", line 16, in from alexapy import ( File "/usr/local/lib/python3.12/site-packages/alexapy/init.py", line 41, in maintainer* = metadata["maintainer"]


File
"/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py",
line 54, in *getitem*
raise KeyError(item)
KeyError: 'maintainer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in
async_get_component
comp = await self.hass.async_add_import_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in
run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1078, in
_get_component
raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.alexa_media

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in
_get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in
protected_loop_func
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/*init*.py", line 90, 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 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/config/custom_components/alexa_media/*init*.py", line 16, in
from alexapy import (
File "/usr/local/lib/python3.12/site-packages/alexapy/*init*.py", line
41, in
*maintainer* = metadata["maintainer"]
~~~~~~~~^^^^^^^^^^^^^^
File
"/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py",
line 54, in *getitem*
raise KeyError(item)
KeyError: 'maintainer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 322, in
_async_setup_component
component = await integration.async_get_component()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in
async_get_component
self._component_future.result()
File "/usr/src/homeassistant/homeassistant/loader.py", line 1019, in
async_get_component
comp = self._get_component()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1078, in
_get_component
raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.alexa_media

—
Reply to this email directly, view it on GitHub
<https://github.com/alandtse/alexa_media_player/issues/2293#issuecomment-2220823128>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCD3P7KE6QXMFSTLPRSMFLZLVHGTAVCNFSM6AAAAABKC6VVGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRQHAZDGMJSHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
nstyqz commented 4 days ago

Confirmed HA 2024.7.2 still problem. Edit: I managed to make it work by installing HA 2024.7.0 from the terminal but after updating, the issue persists... 😵‍💫😵‍💫😵‍💫

drufoval commented 3 days ago

After the upgrade to 2024.7.2 for me resolve the issue...

edudele commented 3 days ago

In Home Assistant 2024.7.2 the error continue...

Registrador: homeassistant.loader Fuente: loader.py:1264 Ocurrió por primera vez: 10:05:07 (2 ocurrencias) Último inicio de sesión: 10:05:07

Unexpected exception importing platform custom_components.alexa_media.config_flow Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, 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.12/importlib/init.py", line 90, 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 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/alexa_media/init.py", line 16, in from alexapy import ( File "/usr/local/lib/python3.12/site-packages/alexapy/init.py", line 41, in maintainer = metadata["maintainer"]


  File "/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
    raise KeyError(item)
KeyError: 'maintainer'
st3v3nFr commented 3 days ago

Same here. everything was working until i update to 2024.7.2 ( i was on 2024.6 before that)

czebulski commented 2 days ago

Same here on 2024.7.x

Gallach commented 2 days ago

I'm also facing the same issue with same versions:

Home-assistant (version): 2024.7.2 alexa_media (version): v4.10.3

casa3c commented 2 days ago

Developers, any update???

danielbrunt57 commented 2 days ago

This is bizarre. I'm now on 2024.7.2 and have done each and every HA as they come out so I've progressed through them all. 2024.6.3 created a partitioned cookie error on AMP init after HA restart vut after HA started you could reload the integration and it's then fine. I've worked on that cookie issue and for some reason, since 2024.6.3 it's partitioned at initial init but not after HA is fully started. There's a PR for python 3.13b3 to add partitioned cookie support but we won't see 3.13 final until approx. October and HA will hopefully implement it not too long after that, beta first of course. For for non-beta versions I doubt we'll see it until 2024.12.0 (or later).

I've been working on recoding the integration to expand the CONFIGURE options since just before 2024.7 came out and as such I've completely re & re'd the integration many times , including removing it from HACS (no, I do not run a development system for testing). alexapy only gets removed when AMP is removed in HACS, plus two restarts are/were necessary before the integration could be added successfully. The first restart executes the AMP code from this github repository which retrieves the alexapy module that is added to HA so a 2nd restart is required to execute the alexapy code which is located in /usr/local/lib/python3.12/site-packages/.

I've not seen this error in any of my restarts but then again, my recent scenario is much different than any of you. Bottom line, has anyone tried a complete re & re (integration & package) or at least a package redownload in HACS to see if that solves it?

st3v3nFr commented 2 days ago

I tried to re download alexa_media from Hacs without any success

danielbrunt57 commented 2 days ago

Ok, let me try the original integration again as I've not tried it since ???

danielbrunt57 commented 2 days ago

I saved my work, deleted the integration, redownloaded the HACS package, restarted HA and installed the integration and it works fine. I restarted HA a 2nd time and still fine.

danielbrunt57 commented 2 days ago

I'm still using the python 3.13beta3 cookies.py file from PR gh-112713 though but that should be irrelevant to this issue..

st3v3nFr commented 2 days ago

I made a backup, uninstall, reboot, install again, restarted again, reboot a second time, and no luck, still stuck with : Le flux de configuration n'a pas pu être chargé: {"message":"Invalid handler specified"}

st3v3nFr commented 2 days ago

i also tried to remove HACS and reinstall, then install alexa_media_player but no luck

st3v3nFr commented 2 days ago

Here are the erros in the logs : Error occurred loading flow for integration alexa_media: Exception importing custom_components.alexa_media.config_flow

Unexpected exception importing platform custom_components.alexa_media.config_flow Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, 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.12/importlib/init.py", line 90, 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 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/alexa_media/init.py", line 16, in from alexapy import ( File "/usr/local/lib/python3.12/site-packages/alexapy/init.py", line 41, in maintainer = metadata["maintainer"]


  File "/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
    raise KeyError(item)
KeyError: 'maintainer'
danielbrunt57 commented 2 days ago

My config has those exact same lines...

image

image image

st3v3nFr commented 1 day ago

SO why is everything about this plugin is not working for a lot of us ??

danielbrunt57 commented 1 day ago

SO why is everything about this plugin is not working for a lot of us ??

I don't know but if you'd like, you can take my forked version for I spin. I just finished getting it working with a new CONFIGURE window providing access to change all reconfigurable options. There's no other major changes in it so I'm doubtful it will fix this issue but I guess it might be worth a shot in the dark...

danielbrunt57 commented 1 day ago

To try it, proceed as follows: HA Integrations > Alexa Media Player > Delete your entry HACS > Alexa Media Player > Remove HACS > add custom repository > https://github.com/danielbrunt57/alexa_media_player HACS > Download and Install my version of Alexa Media Player Restart HA (installs the HACS custom component plus adds the alexapy module to HA itself) Restart HA (initializes HA with the new alexapy module now running) HA > Integrations > Add Alexa Media Player, configure it and see if it initializes. Restart HA and see if it is still okay.

FWIW, I'm running Home Assistant Operating System on the HA "Blue" ODROID N2+ platform. I'm kinda wondering if there's not something more majorly out of whack amongst the different platforms that HA can run in. But more likely, it could be something simpler like things you have added that I have not that somehow are affecting HA & or alexapy. Just my educated "what if?..." thinking out loud...

nstyqz commented 18 hours ago

I have removed the integration, added your custom repository danlelbrunt57/alexa_media_player (integration).

It can't be installed either, it gives me the message: "Unknown error."

Running Home Assistant Green core version 2024.7.2

danielbrunt57 commented 10 hours ago

Thanks, I will look into it tonight