Closed indomitableMan closed 6 days ago
May be related to issue 2574 although the presentation is different.
This behavior is also seen when trying to use Music Assistant with Home Assistant v2024.7.1 as well and is a blocker to my being able to use Music Assistant with my Home Assistant installation.
Have you configured all the IP and bind addresses correctly in the MA settings for the stream and web servers?
From the MA logs it appears that MA gets the correct IP addresses and does respond when a web browser does an HTTP request on port 8095. I suspect there are one or more issues in the web server code since the following error message appears every time a shutdown command is issued to the container running MA:
024-07-08 21:51:43.274 ERROR (MainThread) [root] Uncaught exception
Traceback (most recent call last):
File "/usr/local/bin/mass", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/site-packages/music_assistant/__main__.py", line 214, in main
run(
File "/usr/local/lib/python3.12/site-packages/aiorun.py", line 370, in run
raise pending_exception_to_raise
File "/usr/local/lib/python3.12/site-packages/aiorun.py", line 272, in run
shutdown_callback(loop)
File "/usr/local/lib/python3.12/site-packages/music_assistant/__main__.py", line 204, in on_shutdown
loop.run_until_complete(mass.stop())
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/music_assistant/server/server.py", line 175, in stop
await self.streams.close()
File "/usr/local/lib/python3.12/site-packages/music_assistant/server/controllers/streams.py", line 219, in close
await self._server.close()
File "/usr/local/lib/python3.12/site-packages/music_assistant/server/helpers/webserver.py", line 87, in close
await self._tcp_site.stop()
^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'stop'
I had a same error with the MA log, there should be a popup window to login into Home Assistant to get the access token. My problem was that MA was not using the token and I had to add one in HA and put it manually in MA.
@indomitableMan does the solution above work for you?
I ran into the same issue on my unRaid docker setup. I wound up changing Music Assistant from network type "Host" to my custom proxynet (setup based on spaceinvaderone) and then setup 2 ports into Music assistant (8095 & 8097). This somehow worked for me with my Home Assistant configuration (also an unRAID docker in the proxynet network)
@indomitableMan we will close this soon if there is no follow-up
What version of Music Assistant has the issue?
2.0.7
What version of the Home Assistant Integration have you got installed?
2024.6.4
Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?
The problem
After following the instructions for installing Music Assistant in a Docker container, it does not seem possible to get Music Assistant to recognize Home Assistant running in a separate Docker container. (NOTE: _if players are added to Music Assistant, these players will appear in Home Assistant as
media_player
entities._)How to reproduce
Unable to enable Home Assistant plugin in Music Assistant when HA and MA are running in Docker images on the same host despite setting up network communication between them. No music services or players were set up; this is an initial installation of Music Assistant with an empty
/data
directory.Log message initially seen in MA is as follows:
2024-07-06 22:43:00.775 INFO (MainThread) [hass_client] Connected to Home Assistant 192.168.86.9:8123 (version 2024.6.4)
. . . however the web interface on MA never updates to show a successful authentication; the UI continuously displays the "spinning circle" and the SAVE button in MA is never enabled.
The following messages occasionally appear in the MA log during the HA plugin set up:
In an effort to troubleshoot this issue, I enabled "debug logging" in Home Assistant for the Music Assistant plug in.
The following messages appears in the HA log with Debug Logging enabled:
Configuration Settings for the MA Container:
Music Providers
None.
Player Providers
None.
Full log output
music-assistant-log-showing-issues.txt
Additional information
Containers are being run on a QNAP NAS running QTS v5.1.7.2770 on Container Station v3.0.7.891 (a Docker clone)
What version of Home Assistant Core are your running
2024.6.4
What type of installation are you running?
Home Assistant Container
On what type of hardware are you running?
Linux