#Skipping unplayable item

1 messages · Page 1 of 1 (latest)

brisk turret
#

I have been developing sendspin-js and end up refreshing the client a lot and reconnecting. Sometimes, but not every time, the player is not getting the stream to start when sending the PLAY command.

At the same time, I see logged in the MA side "Skipping unplayable item". I am playing an album provided by the local disk provider.

I changed the warning to print the full exception to see what is going on, and I get this:

2025-12-24 13:20:10.943 ERROR (MainThread) [music_assistant.player_queues] Skipping unplayable item ABBA - I Have a Dream (4ce6b28a00a04f17bb5dd982710fb950)
Traceback (most recent call last):
  File "/Users/paulus/dev/mass/server/music_assistant/controllers/player_queues.py", line 922, in _play_index
    await self._load_item(
    ...<5 lines>...
    )
  File "/Users/paulus/dev/mass/server/music_assistant/controllers/player_queues.py", line 1296, in _load_item
    queue_item.streamdetails = await get_stream_details(
                               ^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
    )
    ^
  File "/Users/paulus/dev/mass/server/music_assistant/helpers/audio.py", line 252, in get_stream_details
    raise MediaNotFoundError(
        f"Unable to retrieve streamdetails for {queue_item.name} ({queue_item.uri})"
    )
music_assistant_models.errors.MediaNotFoundError: Unable to retrieve streamdetails for ABBA - I Have a Dream (4ce6b28a00a04f17bb5dd982710fb950)
#

Hitting play in Music Assistant gives me this error. I need to put itmes in the queue again

#

Ok, I feel like I am able to reproduce this now reliably.

Every time I hit play, I have been playing an album.

When I am still on the first track of the album, refreshing the browser and hitting play works.

If it went to the next track, the rest is no longer playable.

If I never reconnect, it will finish the album just fine.

#

I don't think it's related, but sometimes I also get this error

2025-12-24 13:55:42.910 INFO (MainThread) [aiosendspin.server.client.web-player-1e44bpou] Client disconnected
2025-12-24 13:55:42.910 INFO (MainThread) [aiosendspin.server.client.web-player-1e44bpou] Client disconnected
2025-12-24 13:55:42.916 INFO (MainThread) [music_assistant.players] Player unavailable: Sendspin Sample Player
2025-12-24 13:55:42.921 ERROR (MainThread) [music_assistant] Error doing task: Task exception was never retrieved
Traceback (most recent call last):
  File "/Users/paulus/dev/mass/server/music_assistant/providers/sendspin/player.py", line 555, in send_current_media_metadata
    queue_item = self.mass.player_queues.get_item(
        current_media.source_id, current_media.queue_item_id
    )
  File "/Users/paulus/dev/mass/server/music_assistant/controllers/player_queues.py", line 1380, in get_item
    queue_items = self._queue_items[queue_id]
                  ~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'web-player-1e44bpou'
brisk turret
#

Restarting MA also gives me unplayable / Item not found

brisk turret
#

I have been analyzing the issue with Claude, so far nothing useful. Did find one thing that is interesting, not sure worht pursueing

For the restart case, one definite issue is that queue_item.available = False is persisted to cache. When MA restarts, items that previously failed stay failed forever. I can add a fix for that if you'd like - resetting available = True when restoring from cache.

copper ruin
#

Yeah, I was looking into this before I went to holiday. Something flaky going on in the (de)serialization to/from cache

#

So it only happens when the queue got restored from cache

#

I thought I found the culprit but reading your message shows it still exists

brisk turret
#

Excellent! Now we can see the problem! The cache data is missing the media_item key entirely:

{'queue_id': 'web-player-1e44bpou', 'queue_item_id': '...', 'name': 'ABBA - Super Trouper',
'duration': 253, 'sort_index': 5, 'image': {...}, 'index': 0, 'available': True}

^^^ No 'media_item' key!

#

Claude thinks that because MA crashes when I shut it down, and I crash it hard, not all items might have media_item set yet

#

ok I will open a draft PR that fixes it on my side, but will let you validate if it makes sense to not cache anything without media_item=None

copper ruin
#

Sounds plausible as it’s not being reported by users (as far as I know) and happens on our dev setups where we simply restart the debugger so no clean shutdown

brisk turret
#

well I tried to do clean shutdown, but that's going to be a different PR 🙂