music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.21k stars 44 forks source link

Installation of MA integration fails if add-on isn't already started #2445

Closed madbrain76 closed 2 weeks ago

madbrain76 commented 2 weeks ago

What version of Music Assistant has the issue?

2.0.4

What version of the Home Assistant Integration have you got installed?

2024.5.1

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

The MA integration fails to install unless the add-on is already started

How to reproduce

  1. uninstall MA - both the add-on and integration . I did this yesterday on 6/10
  2. restart HA (I'm using HAOS) .
  3. install MA from settings / add-ons / add-on store / MA
  4. wait for it to be fully installed, but don't start it
  5. install the MA integration from settings / devices and services / add integration
  6. The "select connection method" dialog appears, with the "Use the official Music assistant server add-on" pre-checked image
  7. in the Conversation agent drop-down, there are two options "None" and "Home Assistant". Select Home Assistant.
  8. Hit submit
  9. a "Starting add-on" dialog shows. Wait as instructed
  10. After a while, it fails with "Failed to start the Music Assistant Server add-on".
  11. . settings / add-ons / MA / log shows many entries from the prior installation dated 6/10 . It also shows new entries from today. Log is attached ma.txt
  12. settings / add-ons / MA shows that the add-on actually started successfully
  13. in HA, go to settings, devices and services / add integration , and add the MA integration once again (same as step 5)
  14. A different dialog appears, "Discovered Music Assistant Server"
  15. select Home Assistant as the conversation agent
  16. Click submit
  17. It succeeds
  18. repeat steps 1 through 4
  19. start the add-on manually
  20. reinstall the integration, as in step 5
  21. the dialog from step 14 appears, rather than the one from step 6
  22. repeat steps 16, 17 and 18

Music Providers

N/A, install issue

Player Providers

N/A, install issue

Full log output

[ma.txt](https://github.com/user-attachments/files/15799733/ma.txt)

Additional information

Obviously, there is an easy workaround - manually start the add-on - if you are aware of it.

However, there was clearly an attempt to start the add-on automatically when installing the integration, but the integration fails to detect that the add-on started.

What version of Home Assistant Core are your running

2024.6.2

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Windows

OzGav commented 2 weeks ago

I will leave this open for now but it will be overtaken by events as control of the addon by the integration is going to be removed

madbrain76 commented 2 weeks ago

Makes complete sense - wish I had known about that upcoming change before wasting my time filing this bug.

marcelveldt commented 2 weeks ago

This one can be resolved now because we decided to remove the addon manager from the integration.