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

Jellyfin plugin is not working #2383

Open florian-asche opened 1 month ago

florian-asche commented 1 month ago

What version of Music Assistant has the issue?

2.1.0b1

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

MusicAssistant does not show any media from Jellyfin.

How to reproduce

I am using Jellyfin 10.9.2. I connected MusicAssistant with its own user via http to Jellyfin. The user has admin permission and has the permission to download content. I only allowed him to access music content.

Jellyfin and musicassistant is running as a docker instance.

Music Providers

Jellyfin

Player Providers

Snapcast

Full log output

_music-assistant-server_logs.txt

Additional information

No response

What version of Home Assistant Core are your running

2024.5.4

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

Linux

florian-asche commented 1 month ago

As already suggested in other threads, i shared the media directly to musicassistant, and the media is there and able to play.

florian-asche commented 1 month ago

I set the log level to debug inside the music provider setup: Logs from MusicAssistant:

2024-05-28 20:55:10.441 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.api] Sending get request to system/info/public
2024-05-28 20:55:10.445 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.connection_manager] connect_to_address http://192.168.1.5:8596 succeeded
2024-05-28 20:55:10.445 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.connection_manager] begin connect_to_server
2024-05-28 20:55:10.445 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.api] Sending get request to system/info/public
2024-05-28 20:55:10.448 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.connection_manager] calling onSuccessfulConnection with server None
2024-05-28 20:55:10.448 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.credentials] {}
2024-05-28 20:55:10.448 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.api] Trying to login to http://192.168.1.5:8596/Users/AuthenticateByName as musicassistant
2024-05-28 20:55:10.448 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.api] Sending post request to Users/AuthenticateByName
2024-05-28 20:55:10.593 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.connection_manager] Succesfully logged in as musicassistant
2024-05-28 20:55:10.593 INFO (MainThread) [music_assistant] Loaded music provider Jellyfin Media Server Library
2024-05-28 20:55:12.041 INFO (MainThread) [music_assistant.music] Sync task for Jellyfin Media Server Library completed

Logs from Jellyfin:

[2024-05-28 22:42:07.399 +02:00] [INF] [109] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was challenged.
[2024-05-28 22:42:38.725 +02:00] [INF] [83] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for "musicassistant" has succeeded.
[2024-05-28 22:42:38.725 +02:00] [INF] [83] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user "musicassistant": 8/0
[2024-05-28 22:42:38.726 +02:00] [INF] [83] Emby.Server.Implementations.Session.SessionManager: Creating new access token for user 5863345a-8bd5-43c3-8471-2a2ee8dbe44a
[2024-05-28 22:42:38.787 +02:00] [INF] [83] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.20" request
[2024-05-28 22:43:27.060 +02:00] [INF] [103] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for "musicassistant" has succeeded.
[2024-05-28 22:43:27.060 +02:00] [INF] [103] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user "musicassistant": 9/0
[2024-05-28 22:43:27.061 +02:00] [INF] [103] Emby.Server.Implementations.Session.SessionManager: Creating new access token for user 5863345a-8bd5-43c3-8471-2a2ee8dbe44a
[2024-05-28 22:55:10.586 +02:00] [INF] [21] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for "musicassistant" has succeeded.
[2024-05-28 22:55:10.586 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user "musicassistant": 10/0
[2024-05-28 22:55:10.587 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Creating new access token for user 5863345a-8bd5-43c3-8471-2a2ee8dbe44a
OzGav commented 1 month ago

@lokiberra

florian-asche commented 1 month ago

Looking at my metadataprovider in jellyfin, i only used MusicBrainz, and no TheAudioDB. I removed all my media from jellyfin and added just one album for testing. I selected both metadata providers.

florian-asche commented 1 month ago

I also used Picard with ID3v2.4 tags.

Sadly the media is still not in musicAssistant :/

florian-asche commented 1 month ago

I update jellyfin to 10.9.3. Same error :(

florian-asche commented 1 month ago

I tested the latest beta (seperated testsystem) with Version: 10.8.13, same issue. I saw a youtube video where jellyfin version: 10.8.13 was working. I dont know which MusicAssistant version was used.

lokiberra commented 1 month ago

Thanks for the log. Based on the last two lines it connects just fine to your instance and is supposed to start syncing items.

The "Loaded music provider Jellyfin Media Server Library" comes from load_provider in server.py. It should then try to start syncing artists as the first media_type. If it does it should give a message of "Start sync of Artists items." as part of the sync_library in music_provider.py.

If it is successful in running all the tasks for each media_type it will return "Sync task for Jellyfin Media Server Library completed" as part of the _start_provider_sync in music.py.

Long story short, based on the lack of messages in the log it looks like something is happening in the main MA server code base apart from the Jellyfin provider itself that prevents the sync tasks from even starting.

@OzGav I can't tell what might be going wrong between load_provider and the sync_library task from starting and actually using the Jellyfin provider

OzGav commented 1 month ago

@lokiberra ok sounds like we will need to wait for this to get to the top of the pile and Marcel will comment.

dvdvnl commented 4 weeks ago

I might have a similar problem as @florian-asche, with everything running in Docker containers, as Music Assistant can:

The difference is that a couple of songs (10 songs out of 100+ albums) from the Jellyfin Media Server Library are indexed/synchronized by Music Assistant and can be played on players (providers: UPnP/DLNA, Sonos).

Additionally, playlists are are indexed, too. The contained songs are playable (randomly tested) and are complete with tags (artist, album, album art - where provided). With Settings/Core/Music Controller/Add item to the library as soon as its played enabled, the songs are added to the Music Assistant library and can be played from there afterwards.

With a song playing it is possible to click on the album name and it opens the album section in the Music Assistant web UI, showing the album and its songs, which are playable. The same cannot be said about a click on the artist, as this will only open the artist view, without any songs or albums but the artist image (where provided by Jellyfin).

Setup:

There is no music on the host itself and/or in the Jellyfin container. All files indexed in Jellyfin are stored on a NAS (nfs4) which is located in the same, local network. Jellyfin can access and play the files without problems.

Jellyfin

The dedicated 'music-assistant' user has the permission to download content and access to the music library. Accessing the Jellyfin web UI/application with this user does list all the music as expected.

Logs

jellyfin  | [12:45:50] [INF] [22] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for music-assistant has succeeded.
jellyfin  | [12:45:50] [INF] [22] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user music-assistant: 0/0
jellyfin  | [12:45:50] [INF] [22] Emby.Server.Implementations.Session.SessionManager: Creating new access token for user 11d0a093-0281-4864-a1f9-657bcd78e948

Music Assistant

Docker compose

services:
  server:
    image: ghcr.io/music-assistant/server:latest
    network_mode: host
    privileged: true
    volumes:
      - ./data:/data
    restart: always

Logs

Container start and Jellyfin provider setup
music-assistant-server-1  | 2024-06-05 10:41:34.120 INFO (MainThread) [music_assistant] Starting Music Assistant Server (a109b971784e41b7a09a04d9b14ca1d9) version 2.0.4 - HA add-on: False - Safe mode: False
music-assistant-server-1  | 2024-06-05 10:41:34.164 INFO (MainThread) [music_assistant.cache] Initializing cache controller...
music-assistant-server-1  | 2024-06-05 10:41:36.747 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes.
music-assistant-server-1  | 2024-06-05 10:41:37.223 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support
music-assistant-server-1  | 2024-06-05 10:41:37.224 INFO (MainThread) [music_assistant.streams] Starting server on  0.0.0.0:8097 - base url: http://10.0.0.194:8097
music-assistant-server-1  | 2024-06-05 10:41:37.248 INFO (MainThread) [music_assistant.webserver] Starting server on  0.0.0.0:8095 - base url: http://10.0.0.194:8095
music-assistant-server-1  | 2024-06-05 10:41:37.475 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider
music-assistant-server-1  | 2024-06-05 10:41:37.476 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider
music-assistant-server-1  | 2024-06-05 10:41:37.477 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant
music-assistant-server-1  | 2024-06-05 10:41:37.477 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider
music-assistant-server-1  | 2024-06-05 10:41:37.677 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed
music-assistant-server-1  | 2024-06-05 10:45:50.284 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.api] Sending get request to system/info/public
music-assistant-server-1  | 2024-06-05 10:45:50.325 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.connection_manager] connect_to_address http://10.0.0.194:8096 succeeded
music-assistant-server-1  | 2024-06-05 10:45:50.326 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.connection_manager] begin connect_to_server
music-assistant-server-1  | 2024-06-05 10:45:50.326 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.api] Sending get request to system/info/public
music-assistant-server-1  | 2024-06-05 10:45:50.342 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.connection_manager] calling onSuccessfulConnection with server None
music-assistant-server-1  | 2024-06-05 10:45:50.342 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.credentials] {}
music-assistant-server-1  | 2024-06-05 10:45:50.343 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.api] Trying to login to http://10.0.0.194:8096/Users/AuthenticateByName as music-assistant
music-assistant-server-1  | 2024-06-05 10:45:50.343 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.api] Sending post request to Users/AuthenticateByName
music-assistant-server-1  | 2024-06-05 10:45:51.285 INFO (ThreadPoolExecutor-0_4) [JELLYFIN.jellyfin_apiclient_python.connection_manager] Succesfully logged in as music-assistant
music-assistant-server-1  | 2024-06-05 10:45:51.318 INFO (MainThread) [music_assistant] Loaded music provider Jellyfin Media Server Library
music-assistant-server-1  | 2024-06-05 10:45:52.652 WARNING (MainThread) [music_assistant.music.track] Unable to resolve Album jellyfin://album/fc8c70836a1ac013d1636f9d95670a42 for track 1, track will be added to the library without this album!
music-assistant-server-1  | 2024-06-05 10:45:52.959 WARNING (MainThread) [music_assistant.music.track] Unable to resolve Album jellyfin://album/fc8c70836a1ac013d1636f9d95670a42 for track 3, track will be added to the library without this album!
music-assistant-server-1  | 2024-06-05 10:45:53.067 WARNING (MainThread) [music_assistant.music.track] Unable to resolve Album jellyfin://album/fc8c70836a1ac013d1636f9d95670a42 for track 4, track will be added to the library without this album!
music-assistant-server-1  | 2024-06-05 10:45:54.569 WARNING (MainThread) [music_assistant.music.track] Unable to resolve Album jellyfin://album/fc8c70836a1ac013d1636f9d95670a42 for track 6, track will be added to the library without this album!
music-assistant-server-1  | 2024-06-05 10:45:55.290 WARNING (MainThread) [music_assistant.music.track] Unable to resolve Album jellyfin://album/fc8c70836a1ac013d1636f9d95670a42 for track 7, track will be added to the library without this album!
music-assistant-server-1  | 2024-06-05 10:46:04.082 INFO (MainThread) [music_assistant.music] Sync task for Jellyfin Media Server Library completed
Container restart

Jellyfin Media Server Library provider log level: debug

music-assistant-server-1  | 2024-06-05 12:29:41.577 INFO (MainThread) [music_assistant] Starting Music Assistant Server (a109b971784e41b7a09a04d9b14ca1d9) version 2.0.4 - HA add-on: False - Safe mode: False
music-assistant-server-1  | 2024-06-05 12:29:41.609 INFO (MainThread) [music_assistant.cache] Initializing cache controller...
music-assistant-server-1  | 2024-06-05 12:29:41.681 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes.
music-assistant-server-1  | 2024-06-05 12:29:42.129 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support
music-assistant-server-1  | 2024-06-05 12:29:42.130 INFO (MainThread) [music_assistant.streams] Starting server on  0.0.0.0:8097 - base url: http://10.0.0.194:8097
music-assistant-server-1  | 2024-06-05 12:29:42.151 INFO (MainThread) [music_assistant.webserver] Starting server on  0.0.0.0:8095 - base url: http://10.0.0.194:8095
music-assistant-server-1  | 2024-06-05 12:29:42.818 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider
music-assistant-server-1  | 2024-06-05 12:29:42.819 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider
music-assistant-server-1  | 2024-06-05 12:29:42.819 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant
music-assistant-server-1  | 2024-06-05 12:29:42.820 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider
music-assistant-server-1  | 2024-06-05 12:29:42.836 INFO (MainThread) [music_assistant] Loaded player provider UPnP/DLNA Player provider
music-assistant-server-1  | 2024-06-05 12:29:42.842 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.client] JellyfinClient initializing...
music-assistant-server-1  | 2024-06-05 12:29:42.843 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.configuration] Configuration initializing...
music-assistant-server-1  | 2024-06-05 12:29:42.843 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.configuration] Begin http constructor.
music-assistant-server-1  | 2024-06-05 12:29:42.843 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.ws_client] WSClient initializing...
music-assistant-server-1  | 2024-06-05 12:29:42.843 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.connection_manager] ConnectionManager initializing...
music-assistant-server-1  | 2024-06-05 12:29:42.843 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.credentials] Credentials initializing...
music-assistant-server-1  | 2024-06-05 12:29:42.843 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.configuration] Begin app constructor.
music-assistant-server-1  | 2024-06-05 12:29:42.862 INFO (MainThread) [music_assistant] Loaded player provider SONOS
music-assistant-server-1  | 2024-06-05 12:29:42.966 INFO (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] Sending get request to system/info/public
music-assistant-server-1  | 2024-06-05 12:29:42.966 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] 5
music-assistant-server-1  | 2024-06-05 12:29:42.966 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] {'Accept': 'application/json', 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Application': 'Music Assistant/0.1', 'Accept-Charset': 'UTF-8,*', 'Accept-encoding': 'gzip', 'User-Agent': 'Music Assistant/0.1', 'x-emby-authorization': 'MediaBrowser Client=Music Assistant, Device=--redacted--, DeviceId=--redacted--, Version=0.1'}
music-assistant-server-1  | 2024-06-05 12:29:42.975 INFO (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.connection_manager] connect_to_address http://10.0.0.194:8096 succeeded
music-assistant-server-1  | 2024-06-05 12:29:42.976 INFO (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.connection_manager] begin connect_to_server
music-assistant-server-1  | 2024-06-05 12:29:42.976 INFO (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] Sending get request to system/info/public
music-assistant-server-1  | 2024-06-05 12:29:42.976 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] 5
music-assistant-server-1  | 2024-06-05 12:29:42.976 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] {'Accept': 'application/json', 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Application': 'Music Assistant/0.1', 'Accept-Charset': 'UTF-8,*', 'Accept-encoding': 'gzip', 'User-Agent': 'Music Assistant/0.1', 'x-emby-authorization': 'MediaBrowser Client=Music Assistant, Device=--redacted--, DeviceId=--redacted--, Version=0.1'}
music-assistant-server-1  | 2024-06-05 12:29:42.985 INFO (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.connection_manager] calling onSuccessfulConnection with server None
music-assistant-server-1  | 2024-06-05 12:29:42.986 INFO (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.credentials] {}
music-assistant-server-1  | 2024-06-05 12:29:42.986 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.credentials] credentials initialized with: {}
music-assistant-server-1  | 2024-06-05 12:29:42.986 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.credentials] credentialsupdated
music-assistant-server-1  | 2024-06-05 12:29:42.986 INFO (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] Trying to login to http://10.0.0.194:8096/Users/AuthenticateByName as music-assistant
music-assistant-server-1  | 2024-06-05 12:29:42.986 INFO (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] Sending post request to Users/AuthenticateByName
music-assistant-server-1  | 2024-06-05 12:29:42.986 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] (5, 30)
music-assistant-server-1  | 2024-06-05 12:29:42.987 DEBUG (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.api] {'Accept': 'application/json', 'Content-type': 'application/json', 'X-Application': 'Music Assistant/0.1', 'Accept-Charset': 'UTF-8,*', 'Accept-encoding': 'gzip', 'User-Agent': 'Music Assistant/0.1', 'x-emby-authorization': 'MediaBrowser Client=Music Assistant, Device=--redacted--, DeviceId=--redacted--, Version=0.1'}
music-assistant-server-1  | 2024-06-05 12:29:43.054 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed
music-assistant-server-1  | 2024-06-05 12:29:43.249 INFO (ThreadPoolExecutor-0_13) [JELLYFIN.jellyfin_apiclient_python.connection_manager] Succesfully logged in as music-assistant
music-assistant-server-1  | 2024-06-05 12:29:43.276 INFO (MainThread) [music_assistant] Loaded music provider Jellyfin Media Server Library
music-assistant-server-1  | 2024-06-05 12:29:43.779 INFO (MainThread) [music_assistant.players] Player registered: --redacted--
music-assistant-server-1  | 2024-06-05 12:29:43.788 WARNING (MainThread) [soco.events_asyncio] Could not bind to 10.0.0.194:1400: [Errno 98] Address already in use
music-assistant-server-1  | 2024-06-05 12:29:44.414 INFO (MainThread) [music_assistant.music] Sync task for Jellyfin Media Server Library completed
music-assistant-server-1  | 2024-06-05 12:29:44.573 INFO (MainThread) [music_assistant.players] Player registered: --redacted--
music-assistant-server-1  | 2024-06-05 12:30:08.183 INFO (MainThread) [music_assistant.music] Sync task for Jellyfin Media Server Library completed