mopidy / mopidy-spotify

Mopidy extension for playing music from Spotify
https://mopidy.com/ext/spotify/
Apache License 2.0
933 stars 109 forks source link

Accessing playlists in Iris terminates Mopidy #392

Closed Flattermann78 closed 3 months ago

Flattermann78 commented 3 months ago

Using Iris, browsing the playlists causes Mopidy to terminate. Versions used are as follows:

Mopidy==3.4.2 Mopidy-Spotify==5.0.0a1 GStreamer Spotify Plugin 0.13.0-RELEASE

Using the search dialog, I can select and play lists. It is more about the playlists provided through Spotify like "Featured Lists" "2000er Hits" or "80er Hits". The effect is not immediately but takes around 10 seconds until program termination. log.txt

kingosticks commented 3 months ago

I thought iris provided playlists itself and didn't use Mopidy-spotify for that content. Is it crashing when you try and play them or when you browse them? Can you provide exact steps for me to reproduce?

Flattermann78 commented 3 months ago

Iris provides for playlists from Spotify. As soon as I select Browse (under My Music), browse into the Spotify-Lists and select Playlists/Featured, the system takes around 10 s and reboots.

Bildschirmfoto 2024-07-28 um 16 36 10

As soon as I see the following lists, Mopidy starts to download Spotify content like

`TRACE 2024-07-28 16:46:23,984 [1:SpotifyBackend-9 (_actor_loop)] mopidy_spotify.web Get 'playlists/37i9dQZF1DWSTqUqJcxFk6'

DEBUG 2024-07-28 16:46:24,542 [1:SpotifyBackend-9 (_actor_loop)] urllib3.connectionpool https://api.spotify.com:443 "GET /v1/playlists/37i9dQZF1DWSTqUqJcxFk6 HTTP/11" 200 None

TRACE 2024-07-28 16:46:24,575 [1:SpotifyBackend-9 (_actor_loop)] mopidy_spotify.web New WebResponse URL: https://api.spotify.com/v1/playlists/37i9dQZF1DWSTqUqJcxFk6 expires at: 2024-07-28 16:46:24.554008 [ETag: "MC-IjE1MTk2ZjEzMzM5ODMwMTBjMWQ4ODQ4OGMzMGJjNDBkIg=="] ` which then results in the reboot.

Bildschirmfoto 2024-07-28 um 16 37 10
Flattermann78 commented 3 months ago

I also put a Bug Report with Iris as I wasn't sure wich component is responsible for the behavior I see.

kingosticks commented 3 months ago

Nothing reboots in this log. Mopidy is terminating in response to SIGTERM. Mopidy doesn't send itself SIGTERM so this is something outside of Mopidy. Do you have some kind of watchdog running that thinks Mopidy has crashed (it hasn't)?

kingosticks commented 3 months ago

As soon as I see the following lists, Mopidy starts to download Spotify content like

As a side note, specifically, it is Iris that is requesting full playlist info for all playlists in the browse response. This is slow and potentially pointless. It is akin to reading the full contents of every file as you move between the directories in your filesystem. It would be good if they could do something more optimal here as this data isn't pre-loaded at startup and the cache will be empty.

Flattermann78 commented 3 months ago

You're right! There was a watchdog and I feel stupid. After removing the watchdog, Mopidy works again. I agree that the Iris requests are rather slow creating warnings in the Iris UI.

Thank you!