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

Odd Python error stack when installing Plex provider #2473

Open madbrain76 opened 2 weeks ago

madbrain76 commented 2 weeks ago

What version of Music Assistant has the issue?

2.0.6

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

2024.6.1

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

The problem

Two instances of the MA integration may be inadvertedly created, and this leads to errors

How to reproduce

Unfortunately, I'm not 100% sure. I have seen the error stack page multiple times since upgrading to 2.0.6, though. I believe it is related to circumstances in which there are two MA integrations talking to the single add-on instance. I started writing a test case, but the issue didn't initially come up. But it happened soon after. I just don't know exactly what triggered it, unfortunately. Here are the steps that I believe may still be helpful.

I'm definitely able to reproduce the first error in step 9, though. The second error shown in step 17 is less predictable.

  1. delete all instances of MA integration and add-on
  2. restart HA
  3. install MA add-on
  4. start the add-on
  5. turn on the watchdog, autoupdate and sidebar
  6. a new device is found by HA for the MA integration. Click configure, and submit
  7. add an instance of the Plex music provider
  8. click save
  9. this odd error comes up

image

This looks like issue 1602, which was closed earlier this year. But I can reproduce this still.

  1. click OK
  2. delete the MA add-on
  3. repeat steps 3 through 6
  4. start the MA add-on
  5. there are now two instances of the MA integration, both of which are seemingly active at the same time. I did not notice this the first time around. This is probably not intended, and might deserve its own separate issue.

image

  1. open the MA add-on
  2. Add Plex music provider
  3. this odd error shows up. Or at least, it did once, but I'm not certain how to reproduce from scratch anymore. image

Music Providers

Plex

Player Providers

N/A

Full log output

log.txt

Additional information

No response

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

madbrain76 commented 2 weeks ago

Note that I'm able to get the Plex provider to work after the error in step 9 . I don't believe I could when I ran into the error in step 17. I believed I deleted/reinstalled MA at that point.

I think the step 9 error is due to an HAOS config change I made to get the Piper to work yesterday.

In Settings / System / Networks, I had to set the internal URL like this :

image

I previously had it set to automatic.

Piper failed to play any sample audio until this was changed.

I use SSL because it's required by Z-Wave smart start. And since it's an internal domain, I use a self-managed CA.

If I revert to automatic, HA shows this error :

image

Which isn't new, but I had never seen it before as I had not visited this page after adding SSL.

madbrain76 commented 2 weeks ago

Yes, after I removed that setting, I immediately got error 17 again. Test case :

  1. go to settings / system / network
  2. make sure internal URL is automatic (and probably no external URL, also)
  3. uninstall MA add-on and integration
  4. restart HA
  5. install and start add-on
  6. install integration
  7. add Plex music provider
  8. click save
  9. get this error :

image

log.txt

If step 7 is repeated, I'm actually still able to add this music provider.