HAMusicAssistantJukebox icon indicating copy to clipboard operation
HAMusicAssistantJukebox copied to clipboard

Can't activate "Allow access" toggle

Open d4nicoder opened this issue 1 year ago • 18 comments

When I try to enable access for guests to add songs to the queue, this error message appears and the access remains disabled. It's the only toggle in the integration that doesn't work, but it completely prevents its use.

Jukebox version: Stable-v1.0.6 Home assistant version (docker): 2025.6.3

Image

Image

Image

d4nicoder avatar Jul 01 '25 05:07 d4nicoder

Are you running home assistant on a separate docker host to music assistant?

DJS91 avatar Jul 01 '25 05:07 DJS91

No I don't. All it's running on the same host with docker compose

d4nicoder avatar Jul 01 '25 06:07 d4nicoder

but MA is not hosted as part of HA OS Addons?

DJS91 avatar Jul 01 '25 06:07 DJS91

I'm not using Home assistant OS. I'm using the docker installation method. MA is installed on docker too. Music Assistant is working perfectly fine with Home Assistant.

d4nicoder avatar Jul 01 '25 08:07 d4nicoder

I've downloaded the debug logs. Here are the error details

2025-07-01 10:20:55.476 ERROR (MainThread) [custom_components.music_assistant_jukebox] Failed to create access token file: 'NoneType' object has no attribute 'is_active'
2025-07-01 10:20:55.477 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140034864936768] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 250, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1009, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1081, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/music_assistant_jukebox/switch.py", line 107, in async_turn_on
    refresh_token = await self.hass.auth.async_create_refresh_token(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/auth/__init__.py", line 462, in async_create_refresh_token
    if not user.is_active:
           ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'is_active'

d4nicoder avatar Jul 01 '25 08:07 d4nicoder

Maybe here should be:

token_type="auth/long_lived_access_token",

Not sure about that, I didn't developed any extension for HA, but in the developers documentation example appears this:

{
    "id": 11,
    "type": "auth/long_lived_access_token",
    "client_name": "GPS Logger",
    "client_icon": null,
    "lifespan": 365
}

d4nicoder avatar Jul 01 '25 08:07 d4nicoder

I think that the problem is that the slf.hass.auth.async_get_owner() method is returning None. Maybe sholuld be sufficient using self.hass.async_get_user().

d4nicoder avatar Jul 01 '25 08:07 d4nicoder

Yeah the integration was built for HAOS installs that have Music Assistant addon and integration. I haven't tested it with separate docker instances, there may be functional differences that this integration depends on.

Having said that, I may be building a native MA plugin version soon that would work independently of HA and might work for your setup.

I'll leave this open incase someone has some solutions for it

DJS91 avatar Jul 01 '25 22:07 DJS91

That sounds great! I’ve checked the configuration file of my Home Assistant installation located at .storage/auth. I guess since it’s an old installation that I’ve been updating over time, the initial user wasn’t set as the owner, so there was no user marked with is_owner: true in that file. I edited my user to mark it as the owner, and now it works correctly.

I’m sharing this here in case it helps someone in the same situation, or in case you want to add it to the FAQs.

Thanks for the work you do!

d4nicoder avatar Jul 05 '25 16:07 d4nicoder

hmm. I'm running HA Core (Python venv) and MA in docker, and didn't have this issue.

Having checked my users, I do have one marked as Owner

Image

jonwaland avatar Jul 10 '25 06:07 jonwaland

I just installed via HACS on a regular HAOS install and I'm also getting the same error when trying to turn the toggle on.

sparkydave1981 avatar Jul 15 '25 06:07 sparkydave1981

I just installed via HACS on a regular HAOS install and I'm also getting the same error when trying to turn the toggle on.

Are you logged on as the HA Admin account?

DJS91 avatar Jul 15 '25 06:07 DJS91

Yes, my user is the main admin

sparkydave1981 avatar Jul 15 '25 07:07 sparkydave1981

The logs show a massive error dump:

Logger: homeassistant.util.loop Source: util/loop.py:137 First occurred: 14:50:23 (6 occurrences) Last logged: 14:50:23

Detected blocking call to open with args (PosixPath('/config/custom_components/music_assistant_jukebox/files/jukebox.html'), 'rb') inside the event loop by custom integration 'music_assistant_jukebox' at custom_components/music_assistant_jukebox/__init__.py, line 120: shutil.copy2(src_file, dst_file) (offender: /usr/local/lib/python3.13/shutil.py, line 260: with open(src, 'rb') as fsrc:), please report it to the author of the 'music_assistant_jukebox' custom integration For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open 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 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 598, in start task = asyncio.Task(coro, loop=loop, eager_start=True) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 510, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, 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 77, 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/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 41, 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 83, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 227, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 121, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 336, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 383, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 548, in _async_handle_step result = await self.async_finish_flow(flow, result.copy()) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1683, in async_finish_flow await self.config_entries.async_add(entry) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2082, in async_add await self.async_setup(entry.entry_id) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2207, in async_setup result = await async_setup_component( File "/usr/src/homeassistant/homeassistant/setup.py", line 170, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 470, in _async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 472, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 894, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/music_assistant_jukebox/__init__.py", line 120, in async_setup_entry shutil.copy2(src_file, dst_file)
Detected blocking call to open with args (PosixPath('/config/www/jukebox/jukebox.html'), 'wb') inside the event loop by custom integration 'music_assistant_jukebox' at custom_components/music_assistant_jukebox/__init__.py, line 120: shutil.copy2(src_file, dst_file) (offender: /usr/local/lib/python3.13/shutil.py, line 262: with open(dst, 'wb') as fdst:), please report it to the author of the 'music_assistant_jukebox' custom integration For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open 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 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 598, in start task = asyncio.Task(coro, loop=loop, eager_start=True) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 510, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, 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 77, 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/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 41, 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 83, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 227, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 121, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 336, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 383, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 548, in _async_handle_step result = await self.async_finish_flow(flow, result.copy()) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1683, in async_finish_flow await self.config_entries.async_add(entry) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2082, in async_add await self.async_setup(entry.entry_id) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2207, in async_setup result = await async_setup_component( File "/usr/src/homeassistant/homeassistant/setup.py", line 170, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 470, in _async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 472, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 894, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/music_assistant_jukebox/__init__.py", line 120, in async_setup_entry shutil.copy2(src_file, dst_file)
Detected blocking call to scandir with args (PosixPath('/config/custom_components/music_assistant_jukebox/files/media'),) inside the event loop by custom integration 'music_assistant_jukebox' at custom_components/music_assistant_jukebox/__init__.py, line 131: shutil.copytree(media_src, media_dst) (offender: /usr/local/lib/python3.13/shutil.py, line 591: with os.scandir(src) as itr:), please report it to the author of the 'music_assistant_jukebox' custom integration For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#scandir 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 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 598, in start task = asyncio.Task(coro, loop=loop, eager_start=True) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 510, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, 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 77, 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/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 41, 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 83, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 227, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 121, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 336, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 383, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 548, in _async_handle_step result = await self.async_finish_flow(flow, result.copy()) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1683, in async_finish_flow await self.config_entries.async_add(entry) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2082, in async_add await self.async_setup(entry.entry_id) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2207, in async_setup result = await async_setup_component( File "/usr/src/homeassistant/homeassistant/setup.py", line 170, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 470, in _async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 472, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 894, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/music_assistant_jukebox/__init__.py", line 131, in async_setup_entry shutil.copytree(media_src, media_dst)
Detected blocking call to open with args ('/config/www/jukebox/internal_url_qr.png', 'rb') inside the event loop by custom integration 'music_assistant_jukebox' at custom_components/music_assistant_jukebox/image.py, line 64: with open(self._image_path, "rb") as image_file: (offender: /config/custom_components/music_assistant_jukebox/image.py, line 64: with open(self._image_path, "rb") as image_file:), please report it to the author of the 'music_assistant_jukebox' custom integration For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open 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 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 894, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/music_assistant_jukebox/__init__.py", line 181, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2582, in async_forward_entry_setups await self._async_forward_entry_setups_locked(entry, platforms) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2593, in _async_forward_entry_setups_locked await asyncio.gather( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2595, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2634, in _async_forward_entry_setup await entry.async_setup(self.hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/image/__init__.py", line 146, in async_setup_entry return await hass.data[DATA_COMPONENT].async_setup_entry(entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 230, in async_setup_entry return await self._platforms[key].async_setup_entry(config_entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 349, in async_setup_entry return await self._async_setup_platform(async_create_setup_awaitable) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 379, in _async_setup_platform awaitable = create_eager_task(awaitable, loop=hass.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/config/custom_components/music_assistant_jukebox/image.py", line 23, in async_setup_entry JukeboxInternalQRCode(hass, entry), File "/config/custom_components/music_assistant_jukebox/image.py", line 57, in __init__ self._load_image() File "/config/custom_components/music_assistant_jukebox/image.py", line 64, in _load_image with open(self._image_path, "rb") as image_file:
Detected blocking call to open with args ('/config/www/jukebox/external_url_qr.png', 'rb') inside the event loop by custom integration 'music_assistant_jukebox' at custom_components/music_assistant_jukebox/image.py, line 101: with open(self._image_path, "rb") as image_file: (offender: /config/custom_components/music_assistant_jukebox/image.py, line 101: with open(self._image_path, "rb") as image_file:), please report it to the author of the 'music_assistant_jukebox' custom integration For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open 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 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 894, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/music_assistant_jukebox/__init__.py", line 181, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2582, in async_forward_entry_setups await self._async_forward_entry_setups_locked(entry, platforms) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2593, in _async_forward_entry_setups_locked await asyncio.gather( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2595, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2634, in _async_forward_entry_setup await entry.async_setup(self.hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/image/__init__.py", line 146, in async_setup_entry return await hass.data[DATA_COMPONENT].async_setup_entry(entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 230, in async_setup_entry return await self._platforms[key].async_setup_entry(config_entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 349, in async_setup_entry return await self._async_setup_platform(async_create_setup_awaitable) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 379, in _async_setup_platform awaitable = create_eager_task(awaitable, loop=hass.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/config/custom_components/music_assistant_jukebox/image.py", line 24, in async_setup_entry JukeboxExternalQRCode(hass, entry), File "/config/custom_components/music_assistant_jukebox/image.py", line 94, in __init__ self._load_image() File "/config/custom_components/music_assistant_jukebox/image.py", line 101, in _load_image with open(self._image_path, "rb") as image_file:

I did see something about 'admin' in there but I am the only admin user....

sparkydave1981 avatar Jul 15 '25 07:07 sparkydave1981

@sparkydave1981 - these blocking calls are covered in https://github.com/DJS91/HAMusicAssistantJukebox/issues/54 and shouldn't be related.

How do your accounts compare to mine (https://github.com/DJS91/HAMusicAssistantJukebox/issues/46#issuecomment-3055828981 )?

If you set full debug does the token management script log anything?

jonwaland avatar Jul 24 '25 08:07 jonwaland

That sounds great! I’ve checked the configuration file of my Home Assistant installation located at .storage/auth. I guess since it’s an old installation that I’ve been updating over time, the initial user wasn’t set as the owner, so there was no user marked with is_owner: true in that file. I edited my user to mark it as the owner, and now it works correctly.

I’m sharing this here in case it helps someone in the same situation, or in case you want to add it to the FAQs.

Thanks for the work you do!

This worked for me with my HA Docker and MA docker. Changed it to true and rebooted HA. All is working.

therealmcsparrow avatar Sep 19 '25 00:09 therealmcsparrow

How do your accounts compare to mine (#46 (comment) )?

Finally looking at this again. I don't have a user marked as 'owner'.

I edited the auth file as posted above and now my user is marked as 'Owner'. It was a bit scary because after restarting HA with the file change, the entire Users screen in Settings was missing.... luckily it came back after a browser cache refresh.

.... and now I can turn on the toggle and start testing out this Integration. Happy Days!

sparkydave1981 avatar Oct 04 '25 21:10 sparkydave1981

Hey All, This project is now deprecated and will be archived.

Party mode with much of the same features (but much better) has been developed as a native plugin in the latest Music assistant beta and will be released soon.

You can read about it here and test it for yourself in the latest beta build. https://beta.music-assistant.io/plugins/party-mode/

DJS91 avatar Mar 11 '26 23:03 DJS91