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.3k stars 48 forks source link

Subsonic Provider Removal Leaves "Ghost" Albums and Tracks #2199

Closed rwlove closed 2 months ago

rwlove commented 4 months ago

What version of Music Assistant has the issue?

2.0.0b145

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

N/A

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

The problem

After deleting a Subsonic Provider there are quite a few remaining Albums and Tracks. The tripple-dot and heart are grey'ed-out and so you cannot interact with these "ghost" albums and tracks.

How to reproduce

  1. Clean Install
  2. Add Subsonic Provider with Gonic backend
  3. Wait for synchronization to complete (observe https://github.com/music-assistant/hass-music-assistant/issues/2192)
  4. Delete Subsonic Provider
  5. Wait for delete to complete

Music Providers

Subonic

Player Providers

None added

Full log output

2024-05-06 08:50:06.380 INFO (MainThread) [music_assistant] Starting Music Assistant Server (2e2b5ead73734eaebdf92188c96aae25) version 2.0.0b145 - HA add-on: False - Safe mode: False 2024-05-06 08:50:06.386 INFO (MainThread) [music_assistant.cache] Initializing cache controller... 2024-05-06 08:50:06.677 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes. 2024-05-06 08:50:06.839 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support 2024-05-06 08:50:06.839 INFO (MainThread) [music_assistant.streams] Starting server on 0.0.0.0:8097 - base url: http://10.42.3.245:8097 2024-05-06 08:50:06.842 INFO (MainThread) [music_assistant.webserver] Starting server on 0.0.0.0:8095 - base url: http://10.42.3.245:8095 2024-05-06 08:50:06.905 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider 2024-05-06 08:50:06.905 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant 2024-05-06 08:50:06.905 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider 2024-05-06 08:50:06.905 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider 2024-05-06 08:50:06.993 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed 2024-05-06 08:50:58.924 INFO (MainThread) [music_assistant] Loaded music provider Open Subsonic Media Server Library 2024-05-06 08:50:59.038 WARNING (ThreadPoolExecutor-0_4) [py.warnings] /usr/local/lib/python3.12/site-packages/libopensonic/media/media_base.py:65: UserWarning: Artist object returned by server is missing required field 'sortName' warn(f"{self.get_class_name()} object returned by server is missing required field '{key}'")

2024-05-06 08:54:56.893 WARNING (ThreadPoolExecutor-0_14) [py.warnings] /usr/local/lib/python3.12/site-packages/libopensonic/media/media_base.py:65: UserWarning: Artist object returned by server is missing required field 'sortName' warn(f"{self.get_class_name()} object returned by server is missing required field '{key}'")

2024-05-06 08:55:12.619 WARNING (MainThread) [music_assistant.music] Sync task for Open Subsonic Media Server Library completed with errors 2024-05-06 08:56:29.646 INFO (MainThread) [music_assistant.cache] Clearing database... 2024-05-06 08:56:29.667 INFO (MainThread) [music_assistant.cache] Clearing database DONE 2024-05-06 08:56:29.667 INFO (MainThread) [music_assistant.music] Removing provider opensubsonic--HBp2NFXs from library, this can take a a while... 2024-05-06 08:58:42.722 INFO (MainThread) [music_assistant.music] Provider opensubsonic--HBp2NFXs removed from library

Additional information

Container standard out:

2024-05-06 08:50:06.380 INFO (MainThread) [music_assistant] Starting Music Assistant Server (2e2b5ead73734eaebdf92188c96aae25) version 2.0.0b145 - HA add-on: False - Safe mode: False 2024-05-06 08:50:06.386 INFO (MainThread) [music_assistant.cache] Initializing cache controller... 2024-05-06 08:50:06.677 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes. 2024-05-06 08:50:06.839 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support 2024-05-06 08:50:06.839 INFO (MainThread) [music_assistant.streams] Starting server on 0.0.0.0:8097 - base url: http://10.42.3.245:8097 2024-05-06 08:50:06.842 INFO (MainThread) [music_assistant.webserver] Starting server on 0.0.0.0:8095 - base url: http://10.42.3.245:8095 2024-05-06 08:50:06.905 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider 2024-05-06 08:50:06.905 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant 2024-05-06 08:50:06.905 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider 2024-05-06 08:50:06.905 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider 2024-05-06 08:50:06.993 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed 2024-05-06 08:50:58.924 INFO (MainThread) [music_assistant] Loaded music provider Open Subsonic Media Server Library 2024-05-06 08:50:59.038 WARNING (ThreadPoolExecutor-0_4) [py.warnings] /usr/local/lib/python3.12/site-packages/libopensonic/media/media_base.py:65: UserWarning: Artist object returned by server is missing required field 'sortName' warn(f"{self.get_class_name()} object returned by server is missing required field '{key}'")

2024-05-06 08:54:56.893 WARNING (ThreadPoolExecutor-0_14) [py.warnings] /usr/local/lib/python3.12/site-packages/libopensonic/media/media_base.py:65: UserWarning: Artist object returned by server is missing required field 'sortName' warn(f"{self.get_class_name()} object returned by server is missing required field '{key}'")

2024-05-06 08:55:12.619 WARNING (MainThread) [music_assistant.music] Sync task for Open Subsonic Media Server Library completed with errors 2024-05-06 08:56:29.646 INFO (MainThread) [music_assistant.cache] Clearing database... 2024-05-06 08:56:29.667 INFO (MainThread) [music_assistant.cache] Clearing database DONE 2024-05-06 08:56:29.667 INFO (MainThread) [music_assistant.music] Removing provider opensubsonic--HBp2NFXs from library, this can take a a while... 2024-05-06 08:58:42.722 INFO (MainThread) [music_assistant.music] Provider opensubsonic--HBp2NFXs removed from library

What version of Home Assistant Core are your running

N/A

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

Alternative

OzGav commented 4 months ago

Yes I saw similar when removing the local file system proivder image

marcelveldt commented 3 months ago

Yes I saw similar when removing the local file system proivder

That is not related to this issue

OzGav commented 2 months ago

@rwlove Can you retest with 2.1.0b3

rwlove commented 2 months ago

@OzGav The problem persists.

I did a clean install of 2.1.0b3, removing and recreating backing storage and config and added the subsonic provider. Ghost tracks exist after the provider scan. After provider removal there are 100s (not an exact count) of ghost tracks, 3 ghost albums and in the Artists tab is says, "No items found." but the circle seems to be spinning infinitely.

I did add a playback provider (snapcast) too.

2024-06-10 10:29:46.636 INFO (MainThread) [music_assistant] Starting Music Assistant Server (a0d74f77ce9742d38eadcc17bfa2c009) version 2.1.0b3 - HA add-on: False - Safe mode: False
2024-06-10 10:29:46.642 INFO (MainThread) [music_assistant.cache] Initializing cache controller...
2024-06-10 10:29:46.846 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes.
2024-06-10 10:29:47.014 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support
2024-06-10 10:29:47.014 INFO (MainThread) [music_assistant.streams] Starting server on  0.0.0.0:8097 - base url: http://10.42.4.18:8097
2024-06-10 10:29:47.019 INFO (MainThread) [music_assistant.webserver] Starting server on  0.0.0.0:8095 - base url: http://10.42.4.18:8095
2024-06-10 10:29:47.082 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider
2024-06-10 10:29:47.083 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant
2024-06-10 10:29:47.083 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider
2024-06-10 10:29:47.083 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider
2024-06-10 10:29:47.173 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed
2024-06-10 10:29:57.621 ERROR (MainThread) [music_assistant.webserver] Error handling message: config/providers/get: 'No config found for provider id opensubsonic--v45tTvSo'
2024-06-10 10:30:35.103 INFO (MainThread) [music_assistant] Loaded music provider Open Subsonic Media Server Library
2024-06-10 10:30:35.184 WARNING (ThreadPoolExecutor-0_26) [py.warnings] /usr/local/lib/python3.12/site-packages/libopensonic/media/media_base.py:65: UserWarning: Artist object returned by server is missing required field 'sortName'
  warn(f"{self.get_class_name()} object returned by server is missing required field '{key}'")

2024-06-10 10:37:53.978 INFO (MainThread) [music_assistant.providers.snapcast.snapserver] Starting builtin Snapserver...
2024-06-10 10:37:54.948 WARNING (ThreadPoolExecutor-0_17) [py.warnings] /usr/local/lib/python3.12/site-packages/libopensonic/media/media_base.py:65: UserWarning: Artist object returned by server is missing required field 'sortName'
  warn(f"{self.get_class_name()} object returned by server is missing required field '{key}'")

2024-06-10 10:37:57.743 INFO (MainThread) [music_assistant.providers.snapcast] Started connection to Snapserver 127.0.0.1:1705
2024-06-10 10:37:57.744 INFO (MainThread) [music_assistant] Loaded player provider Snapcast
2024-06-10 10:37:57.745 INFO (MainThread) [music_assistant.players] Player registered: ma_6c4b901feca7/worker2.foo.com
2024-06-10 10:37:57.745 INFO (MainThread) [music_assistant.players] Player registered: ma_6c4b901fed30/worker1.foo.com
2024-06-10 10:38:12.383 WARNING (ThreadPoolExecutor-0_25) [py.warnings] /usr/local/lib/python3.12/site-packages/libopensonic/media/media_base.py:65: UserWarning: Artist object returned by server is missing required field 'sortName'
  warn(f"{self.get_class_name()} object returned by server is missing required field '{key}'")

2024-06-10 11:48:45.854 WARNING (ThreadPoolExecutor-0_22) [py.warnings] /usr/local/lib/python3.12/site-packages/libopensonic/media/media_base.py:65: UserWarning: Artist object returned by server is missing required field 'sortName'
  warn(f"{self.get_class_name()} object returned by server is missing required field '{key}'")

2024-06-10 12:02:27.547 INFO (MainThread) [music_assistant.music] Sync task for Open Subsonic Media Server Library completed
2024-06-10 13:04:21.005 INFO (MainThread) [music_assistant.cache] Clearing database...
2024-06-10 13:04:21.049 INFO (MainThread) [music_assistant.cache] Clearing database DONE
2024-06-10 13:04:21.050 INFO (MainThread) [music_assistant.music] Removing provider opensubsonic--5qjtZsZt from library, this can take a a while...
2024-06-10 13:29:47.129 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed
2024-06-10 13:49:39.258 INFO (MainThread) [music_assistant.music] Provider opensubsonic--5qjtZsZt removed from library
OzGav commented 2 months ago

@rwlove this should be fixed in 2.1.0b4. Please confirm

rwlove commented 2 months ago

@OzGav LGTM. I cannot remember if I did the scan before or after I updated to b4, but I removed the provider with b4 and there are no Artists, Albums or Tracks remaining.

Thank you!