Skip to content

Spotify: playlist playback fails on accounts where the tracks/{id} endpoint is restricted #6351

Description

@charri

Before you begin

  • I have searched the open and closed issues and this hasn't been reported yet.
  • I have read the troubleshooting guide and it did not solve my problem.
  • I am running a supported installation (Home Assistant add-on).

What happened?

Since 2.10, playing a Spotify playlist fails completely on a provider instance whose Spotify account cannot use the tracks/{id} Web API endpoint. Every track is skipped as unplayable and playback never starts. The same playlists played fine on 2.9.12.

I have three Spotify Premium accounts connected as three provider instances. Two of them are restricted by Spotify: me/albums, me/tracks, me/following, me/shows and tracks/{id} all return 404, while the playlist endpoints work normally. (Instance ids, track ids and titles redacted below.)

INFO  [player_queues.media_resolver] Fetching tracks to play for playlist <playlist>
WARN  [player_queues] Skipping unplayable item <track 1>: track://<track-id-1> not found on provider spotify--AAAAAAAA
WARN  [player_queues] Skipping unplayable item <track 2>: track://<track-id-2> not found on provider spotify--AAAAAAAA
WARN  [player_queues] Skipping unplayable item <track 3>: track://<track-id-3> not found on provider spotify--AAAAAAAA
WARN  [player_queues] Skipping unplayable item <track 4>: track://<track-id-4> not found on provider spotify--AAAAAAAA
WARN  [player_queues] Skipping unplayable item <track 5>: track://<track-id-5> not found on provider spotify--AAAAAAAA
WARN  [webserver] player_queues/play_media: No playable item found to start playback

music/playlists/playlist_tracks on that same instance returns all 17 tracks of this playlist, each with is_playable: true and a provider mapping with available: true. So MA already holds complete, playable Track objects - and then discards them and re-fetches each one individually.

The message track://... not found on provider ... is built in MediaController.get_provider_item, which points at the enrichment re-fetch in player_queues/queue_loader.py::_load_item:

elif not queue_item.media_item.image or queue_item.media_item.provider.startswith("ytmusic"):
    fetched_item = await self.mass.music.get_item_by_uri(queue_item.uri)

A failure inside get_stream_details would instead read Unable to retrieve streamdetails for ..., and that does not appear in the log. The library lookup on the line above misses, because library sync is also impossible on these accounts.

Net effect: a provider that can list a playlist but cannot fetch an individual track can never play a playlist, even though the listing already carried everything needed.

Possible fix

The re-fetch looks like an enrichment step (artwork / fuller metadata), so its failure arguably shouldn't make the item unplayable. Two options I can see:

  1. Keep the item from the listing when the re-fetch raises MediaNotFoundError. YouTube Music appears to rely on this lookup to spot unavailable listing items, so it would need to keep raising.
  2. Pass the track already in hand as the fallback argument that get_provider_item already accepts. No caller currently passes it, so it only falls back to a library item - which is absent in this case.

Happy to test a patch against my setup.

How to reproduce

  1. Connect a Spotify account whose tracks/{id} endpoint returns 404 (playlist endpoints still work).
  2. Play any playlist on that provider instance, from the UI or via the music_assistant.play_media action.
  3. Every track is logged as Skipping unplayable item ... not found on provider <instance>, then No playable item found to start playback.

Control, in the same install: the same track id and the same playlist resolve and play fine through an unrestricted account's provider instance. So it is specific to the restricted account, not to the playlist or its tracks.

Music Assistant version

2.10.2

How do you run Music Assistant?

Home Assistant add-on

Diagnostics report or log file

Log excerpt above. I can attach a full diagnostics report if useful.

Anything else?

music-assistant-diagnostics-2026-09-06-184708.json

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions