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

Subsonic Provider Issues #2192

Open rwlove opened 4 months ago

rwlove commented 4 months ago

What version of Music Assistant has the issue?

2.0.0b144

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

There are a few observed errors when adding the Subsonic Provider.

  1. Not all Artists/Albums/Tracks are imported.

    • MA imports two less "album artists" than gonic lists, but many fewer than gonic lists as "artists".
    • MA imported about 86% of the albums that gonic lists.
    • MA imported about 0.6% of the tracks that gonic lists.
  2. Some albums have missing album art (i.e. broken image), but more importantly the tripple-dot and the heart are greyed out, so they can't be interacted with or deleted.

  3. When selecting one Album that was imported, MA could not list any tracks.

How to reproduce

  1. Completely clean install
  2. Add Subsonic provider
  3. Wait for synchronization to complete

Music Providers

Subsonic

Player Providers

None

Full log output

2024-05-04 15:46:40.502 INFO (MainThread) [music_assistant] Starting Music Assistant Server (c3d4244d08ab4caa960bd02119589021) version 2.0.0b144 - HA add-on: False - Safe mode: False 2024-05-04 15:46:40.513 INFO (MainThread) [music_assistant.cache] Initializing cache controller... 2024-05-04 15:46:40.910 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes. 2024-05-04 15:46:41.304 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support 2024-05-04 15:46:41.305 INFO (MainThread) [music_assistant.streams] Starting server on 0.0.0.0:8097 - base url: http://10.42.8.163:8097 2024-05-04 15:46:41.312 INFO (MainThread) [music_assistant.webserver] Starting server on 0.0.0.0:8095 - base url: http://10.42.8.163:8095 2024-05-04 15:46:41.507 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider 2024-05-04 15:46:41.508 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant 2024-05-04 15:46:41.508 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider 2024-05-04 15:46:41.508 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider 2024-05-04 15:46:41.686 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed 2024-05-04 15:47:48.041 ERROR (MainThread) [music_assistant.webserver] Error handling message: config/providers/save: list index out of range 2024-05-04 15:47:59.723 INFO (MainThread) [music_assistant] Loaded music provider Open Subsonic Media Server Library 2024-05-04 15:47:59.880 WARNING (ThreadPoolExecutor-0_15) [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-04 15:55:10.940 WARNING (ThreadPoolExecutor-0_5) [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-04 15:55:37.940 WARNING (MainThread) [music_assistant.music] Sync task for Open Subsonic Media Server Library completed with errors 2024-05-04 15:58:39.032 WARNING (ThreadPoolExecutor-0_20) [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-04 15:58:49.188 ERROR (MainThread) [music_assistant.webserver] Error handling message: music/albums/album_tracks: Field "disc_number" of type int in AlbumTrack has invalid value None 2024-05-04 15:59:38.972 ERROR (MainThread) [music_assistant.webserver] Error handling message: music/albums/album_tracks: Field "disc_number" of type int in AlbumTrack has invalid value None

Additional information

I am on Discord as 'Bubba' and I'm happy to chat and help test/debug.

My container output shows a few lines of al-2628: No such file or directory that I don't see in the logfile.

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

@khers

khers commented 4 months ago

I saw this behavior in my HA install and have been trying to investigate. I cannot reproduce in my dev env, there the scan completes successfully and when I update to beta 147 it seems to be fixed for me in HA as well. Please try the new beta and let me know if it is still broken.

rwlove commented 4 months ago

I tested with a clean install, same as described in the original report, but with build 2.0.0b147. Here is what I observe:

Still seeing a bunch of "ghost" albums and tracks, not sure if there are any "ghost" artists. I didn't see any, but I'm doing a visual analysis so I probably missed them since I'm over 100% of the actual artists in gonic. I would guess the overage is the ghost entries.

Other observations:

Conclusion: Significant improvement!!! Most of the gonic library is imported. There are still some oddities though.

logfile: 2024-05-08 11:54:19.882 INFO (MainThread) [music_assistant] Starting Music Assistant Server (c1eb67b9c7004b01a4efbe629d96b6bd) version 2.0.0b147 - HA add-on: False - Safe mode: False 2024-05-08 11:54:19.898 INFO (MainThread) [music_assistant.cache] Initializing cache controller... 2024-05-08 11:54:20.164 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes. 2024-05-08 11:54:20.313 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support 2024-05-08 11:54:20.313 INFO (MainThread) [music_assistant.streams] Starting server on 0.0.0.0:8097 - base url: http://10.42.3.120:8097 2024-05-08 11:54:20.316 INFO (MainThread) [music_assistant.webserver] Starting server on 0.0.0.0:8095 - base url: http://10.42.3.120:8095 2024-05-08 11:54:20.376 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider 2024-05-08 11:54:20.377 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant 2024-05-08 11:54:20.377 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider 2024-05-08 11:54:20.377 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider 2024-05-08 11:54:20.467 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed 2024-05-08 11:54:34.521 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 11:56:24.950 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 11:57:57.940 INFO (MainThread) [music_assistant] Loaded music provider Open Subsonic Media Server Library 2024-05-08 11:57:58.045 WARNING (ThreadPoolExecutor-0_13) [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-08 11:58:15.367 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:00:05.735 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:01:55.934 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:03:46.269 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:05:36.695 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:07:27.063 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:09:17.240 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:11:07.426 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:12:57.857 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:14:48.253 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:16:38.341 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:18:28.431 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:20:18.674 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:22:09.158 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:23:22.651 WARNING (ThreadPoolExecutor-0_6) [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-08 12:23:59.329 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:25:49.743 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:27:40.192 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:29:30.672 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:31:20.734 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:33:10.981 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:35:01.464 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:36:51.690 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:38:42.106 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:40:32.271 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:40:50.127 WARNING (ThreadPoolExecutor-0_30) [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-08 12:42:22.479 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:44:12.618 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:46:02.817 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:47:53.321 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:49:43.533 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:51:33.641 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:53:24.068 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:55:14.194 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:57:04.333 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:58:54.539 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:00:44.998 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:02:35.312 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:04:25.503 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:06:15.786 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:08:06.134 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:09:56.248 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:11:46.616 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:13:36.953 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:15:27.379 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:17:17.841 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:19:08.315 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:20:58.479 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:22:48.769 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:24:38.995 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:26:29.411 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:27:13.442 INFO (MainThread) [music_assistant.music] Sync task for Open Subsonic Media Server Library completed 2024-05-08 13:28:19.834 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:30:10.174 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:32:00.313 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:33:11.746 WARNING (ThreadPoolExecutor-0_16) [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-08 13:33:50.421 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:35:40.857 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:37:31.265 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:37:33.043 WARNING (ThreadPoolExecutor-0_5) [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-08 13:39:21.399 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all

container standard out: 2024-05-08 11:54:19.882 INFO (MainThread) [music_assistant] Starting Music Assistant Server (c1eb67b9c7004b01a4efbe629d96b6bd) version 2.0.0b147 - HA add-on: False - Safe mode: False 2024-05-08 11:54:19.898 INFO (MainThread) [music_assistant.cache] Initializing cache controller... 2024-05-08 11:54:20.164 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes. 2024-05-08 11:54:20.313 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support 2024-05-08 11:54:20.313 INFO (MainThread) [music_assistant.streams] Starting server on 0.0.0.0:8097 - base url: http://10.42.3.120:8097 2024-05-08 11:54:20.316 INFO (MainThread) [music_assistant.webserver] Starting server on 0.0.0.0:8095 - base url: http://10.42.3.120:8095 2024-05-08 11:54:20.376 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider 2024-05-08 11:54:20.377 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant 2024-05-08 11:54:20.377 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider 2024-05-08 11:54:20.377 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider 2024-05-08 11:54:20.467 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed 2024-05-08 11:54:34.521 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 11:56:24.950 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 11:57:57.940 INFO (MainThread) [music_assistant] Loaded music provider Open Subsonic Media Server Library 2024-05-08 11:57:58.045 WARNING (ThreadPoolExecutor-0_13) [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-08 11:58:15.367 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:00:05.735 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:01:55.934 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:03:46.269 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:05:36.695 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:07:27.063 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:09:17.240 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:11:07.426 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:12:57.857 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:14:48.253 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:16:38.341 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:18:28.431 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:20:18.674 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:22:09.158 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all al-2628: No such file or directory 2024-05-08 12:23:22.651 WARNING (ThreadPoolExecutor-0_6) [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-08 12:23:59.329 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:25:49.743 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:27:40.192 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:29:30.672 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:31:20.734 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:33:10.981 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:35:01.464 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:36:51.690 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:38:42.106 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all al-2628: No such file or directory 2024-05-08 12:40:32.271 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:40:50.127 WARNING (ThreadPoolExecutor-0_30) [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-08 12:42:22.479 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:44:12.618 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:46:02.817 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:47:53.321 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:49:43.533 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:51:33.641 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:53:24.068 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:55:14.194 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:57:04.333 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 12:58:54.539 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:00:44.998 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:02:35.312 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:04:25.503 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:06:15.786 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:08:06.134 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:09:56.248 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:11:46.616 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:13:36.953 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:15:27.379 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:17:17.841 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:19:08.315 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:20:58.479 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:22:48.769 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:24:38.995 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:26:29.411 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:27:13.442 INFO (MainThread) [music_assistant.music] Sync task for Open Subsonic Media Server Library completed 2024-05-08 13:28:19.834 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:30:10.174 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:32:00.313 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all al-2628: No such file or directory 2024-05-08 13:33:11.746 WARNING (ThreadPoolExecutor-0_16) [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-08 13:33:50.421 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:35:40.857 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all 2024-05-08 13:37:31.265 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all al-2628: No such file or directory 2024-05-08 13:37:33.043 WARNING (ThreadPoolExecutor-0_5) [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-08 13:39:21.399 WARNING (MainThread) [music_assistant.webserver] Invalid command: players/queue/all

khers commented 4 months ago

It looks like this took 2 hours to sync. Do you see incorrect results still? Once my sync finally finished the stats are what I expect (MA and Gonic disagree about the number of albums and artists because my metadata is not the cleanest).

rwlove commented 4 months ago

Tested with 2.0.0b148, pretty much the same results as the previous release.

112.71% MA to gonic artists. 86.64% MA to gonic albums. 105.13% MA to gonic tracks.

Multiple ghost albums and tracks.

2024-05-08 19:42:19.052 INFO (MainThread) [music_assistant] Loaded music provider Open Subsonic Media Server Library
...
2024-05-08 21:12:46.269 INFO (MainThread) [music_assistant.music] Sync task for Open Subsonic Media Server Library completed

~1.5 hours to complete.

@khers my metadata is probably not the cleanest either. What I'm surprised about is that MA lists more entities that gonic and I wish I could delete the ghost entities.

khers commented 4 months ago

For me, the ghost entries are usually a misspelling of a band name or artist name (or album). I intend to poke around in my test instance db and see if I can find a pattern to what is causing these entries and recommend metadata fixes for it. For instance, in Gonic I have Cannonball Adderly as an artist and during the scan he shows up. However in the metadata for one of his tracks the artist is listed as Adderly, Cannonball and because of this I see both "Cannonball Adderly" and "Adderly, Cannonball" show up as artists.

IMO this issue is caused by MA and Gonic disagreeing about how metadata works and the relationships between entities, and the provider code does not include any massaging of these relationships. I don't think fixing it in provider code is the correct choice because this is an Open Subsonic provider and not a Gonic provider.

OzGav commented 4 months ago

@rwlove As there has been no followup to the above we will close this soon.

rwlove commented 4 months ago

For me, the ghost entries are usually a misspelling of a band name or artist name (or album). I intend to poke around in my test instance db and see if I can find a pattern to what is causing these entries and recommend metadata fixes for it. For instance, in Gonic I have Cannonball Adderly as an artist and during the scan he shows up. However in the metadata for one of his tracks the artist is listed as Adderly, Cannonball and because of this I see both "Cannonball Adderly" and "Adderly, Cannonball" show up as artists.

I think we should be able to delete the ghost entries, especially the ones that don't have any info associated with them (not the use case you describe above). They're just junk in MA.

IMO this issue is caused by MA and Gonic disagreeing about how metadata works and the relationships between entities, and the provider code does not include any massaging of these relationships. I don't think fixing it in provider code is the correct choice because this is an Open Subsonic provider and not a Gonic provider.

Understood. Do you think that Jellyfin would be a better music provider for MA since it's a Jellyfin MA provider with a Jellyfin backend and there isn't a mismatch like there is with subsonic/gonic? IIRC I was seeing similar issues with both providers.

FWIW, I don't see any ghost entries with 'dsub', with the gonic backend, on my phone, but maybe it uses a different library than MA.

khers commented 4 months ago

Sorry, I didn't mean to sound like this is a "Won't Fix" more that it is going to require some more investigation to get to the bottom of what is happening here. I hope to spend some time looking through the MA database and compare to what is in my Gonic collection.

rwlove commented 3 months ago

Results of testing with b4:

111.05% MA to gonic artists. 86.62% MA to gonic albums. 99.00% MA to gonic tracks.

khers commented 3 months ago

I don't have any insight into the cause of the missing tracks or albums but I am fairly certain that the extra artists are a disagreement between the artist as constructed by Gonic when it scans the filesystem and the entries in the Artist field of the ID3 tags. AFAIK Gonic does not build new artist entries for what it finds in the ID3 tags (I'd have to ask the maintainer to verify) but when we parse each track in MA we make sure to create an Artist entry for each value found in the ID3 tags and for each item returned by the track enumeration. I have been putting off the clean up of my metadata but I think I am at the point where it is the only way forward for this investigation. I will try and get the motivation up for that project in the next week or so.

khers commented 1 month ago

So I finally got around to cleaning up my meta data with beets and the difference from gonic to MA is larger?

type gonic MA artists 1361 1443 album artists 654 N/A albums 1206 1148 tracks 12254 11538

I am at a loss for how to explain the discrepancy between albums and tracks, these should be 1-1. All I can think of for the artists is that gonic counts album artists as unique names in that field of the metadata for any track, but I suspect there are duplicates between artists and album artists. I wonder if the union between artists and album artists in gonic would match what MA sees.

EDIT: Even with the mismatch in counts, the things I care about (and my kids care about) are all showing up and it really is better organized now. Bonus, beets fetched a bunch of missing album art and now almost 100% of my albums have art displayed.

khers commented 1 month ago

I am asking the gonic maintainer some questions about what might be going on here: https://github.com/sentriz/gonic/issues/534

khers commented 1 month ago

@rwlove Do you have examples of "ghost" entries. I think the next step here is to look deeper into what each service believe they have and see where the discrepancies are.

rwlove commented 1 month ago

@rwlove Do you have examples of "ghost" entries. I think the next step here is to look deeper into what each service believe they have and see where the discrepancies are.

I do not. I'm not sure if the problem went away, but I just spent 3 minutes scrolling through tracks and I could not find any. I'm not sure there's any way to sort tracks to find the "ghosts", I tried all reasonable sorting methods, so I'm limited to scrolling to find them and that wasn't fruitful. Either they're non-existent or I'm just unable to find them.

This was not a clean install, but rather an install that has been upgraded multiple times, but that's probably not relevant.

Side note, and probably a separate bug, but some of the track sorting methods didn't seem to work. For example, I tried to sort by duration to try to get the "ghosts" to the top, but they were not sorted - maybe I did something wrong.

khers commented 1 month ago

I think what I need to do is dump the tracks from my Gonic install and then from the MA database and remove the intersection to see what tracks MA excluded. This should work for aartists and albums as well. I will let you know what I find when I have the motivation to do that.

OzGav commented 1 week ago

@khers any progress on this one?

khers commented 1 week ago

Given that this isn't actually harming anyones ability to use the provider (and $DAYJOB is going nuts) I won't be able to spend a ton of time investigating this. If the project prefers issues to be closed, I am fine to close this one and make a comment in the code about this issue for future investigation.

OzGav commented 1 week ago

This can stay open. Is there a known issue I should add to the docs?

khers commented 5 days ago

We should probably mention that having a mismatch between the counts of artists, albums, and tracks is a possibility and link back to this issue. I'd love it is someone showed up with a specific example of a missing or ghost track.