Media browser unkown error

Hello All,

I am getting an error message when I try open the media browser from any of my squeezebox media players. I get the error only with squeezebox and not any other media players. Prior to adding media file to the media folder I would get a “no media found” message, but after adding media (.mp3 files only) I get the following.

Logger: homeassistant.components.websocket_api.http.connection
Source: components/squeezebox/browse_media.py:153
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:29:14 AM (3 occurrences)
Last logged: 11:29:26 AM

[281473383879632] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1066, in websocket_browse_media
    payload = await player.async_browse_media(media_content_type, media_content_id)
  File "/usr/src/homeassistant/homeassistant/components/squeezebox/media_player.py", line 584, in async_browse_media
    return await library_payload(self._player)
  File "/usr/src/homeassistant/homeassistant/components/squeezebox/browse_media.py", line 153, in library_payload
    result = await player.async_browse(
  File "/usr/local/lib/python3.8/site-packages/pysqueezebox/player.py", line 645, in async_browse
    return await self._lms.async_browse(category, limit=limit, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pysqueezebox/server.py", line 233, in async_browse
    items = await self.async_get_category(item_type, limit, search)
  File "/usr/local/lib/python3.8/site-packages/pysqueezebox/server.py", line 305, in async_get_category
    return self.__dict__[category][2][:limit]
TypeError: 'NoneType' object is not subscriptable

Anyone else have this error?

I know enough to get into trouble but not enough to get myself out. I’m sure the logs are giving me all the info I need and I am just missing it.

Running a Home Assistant Blue machine so nothing custom.

Any and all help is appreciated!

Thank you,

Sam

1 Like

Has anyone has a problem like this?

One last bump, anyone?

Hi, i have the same issue…
Also only when browsing playlists on squeezebox.

Media Browsing Error - Unknown error

regards
//Hans

1 Like

Hello Hans,

I have not found a solution for this. I have been able to browes/play media that is stored on a network drive (synology server). I can not browse media stored locally on my home assistant server. One possible solution (I have not tested this) is to share the HA media folder to the network and then setup your squeeze box server to look there. Probably not the best idea but may be a workaround.

Sam

Hi, thanks for the answer.
Sadly, that’s not a good workaround for me…
I have a dedicated LMS and tons of music on and the HA is also an dedicated box with only HA on.
Don’t wan’t to mix… :slight_smile:

Anyway, thanks!

// Hans

@scpowered @viperhansa are either of you, by chance, using Frigate NVR?

I have this same issue, where media browsing is unavailable and returns an unknown error. I am able to resolve the issue by restarting the Frigate add-on.

I am not yet certain why this is happening, though.

same issue, all LMS players return unknown error under media browser.

Same issue here.

[547202461552] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1163, in websocket_browse_media
    payload = await player.async_browse_media(media_content_type, media_content_id)
  File "/usr/src/homeassistant/homeassistant/components/squeezebox/media_player.py", line 581, in async_browse_media
    return await library_payload(self.hass, self._player)
  File "/usr/src/homeassistant/homeassistant/components/squeezebox/browse_media.py", line 154, in library_payload
    result = await player.async_browse(
  File "/usr/local/lib/python3.9/site-packages/pysqueezebox/player.py", line 645, in async_browse
    return await self._lms.async_browse(category, limit=limit, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pysqueezebox/server.py", line 233, in async_browse
    items = await self.async_get_category(item_type, limit, search)
  File "/usr/local/lib/python3.9/site-packages/pysqueezebox/server.py", line 305, in async_get_category
    return self.__dict__[category][2][:limit]
TypeError: 'NoneType' object is not subscriptable

Just for the sake of it: did anyone get closer to a solution?

I installed piCorePlayer and then via that also the LMS on an old Pi1, added the spotty plugin to connect to my spotify account, added the squeezebox integration to HA, and had the following experience:

  1. mediabrowser error
  2. then started a spotify playlist via the LMS web frontend
  3. player in lovelace let’s me control the playlist and shows the album art
  4. another try gives me the mediabrowser, but without the playlist button
  5. i play around a bit more in the LMS frontend, adding playlists to favorites etc
  6. switch back to the HA dashboard, try to open the mediabtrowser => again the error, and since then consistent

Quite a bummer I have to say, I was hoping to finally have the spotify integration for HA where I dont need to “side-control” things in another browser tab or on my phone…

Okay, according to the logfiles we all more or less have the same issue in the same “area” of the same file: server.py from pysqueezebox. That project is owned by @rajlaud , who hasn’t been online here for a while unfortunately. The actual code is here: pysqueezebox/server.py at 50c1ab59915ffadf020cff19e4b7f846b8a20b47 · rajlaud/pysqueezebox · GitHub, the project description is at pysqueezebox · PyPI

Is someone familiar with the “etiquette” of pypi.org? There is an email address on there, but I’m not sure if it increases or horribly decreases the chance for a fix if I just send an email directly :smiley:

For the ones who are still online here sometimes: let’s collect a few more infos.

Where is your LMS running?
On your HA device or separately?
Which hardware?
How does your library look like on LMS? (local files, web radios, spotify or other plugins, …?)

My setup:
piCorePlayer and LMS running together on an old Pi1
HA is running on a Pi3+
my LMS currently only uses the spotty Spotify plugin connected to my premium account, no local or network files

Hi! I just saw this thread. I’ll take a look and see what broke. At some point media browser was working for the Squeezebox integration, but I don’t use it regularly myself.

Also, you can always open a GitHub issue in the home assistant project to report a bug: Issues · home-assistant/core · GitHub

If you do that, I’ll see it right away.

-Raj

Thanks so much! Let me know if it helps to throw everything together in github as well for this case still. Whatever makes things easier for you, I’m so happy :slight_smile:

I was able to reproduce the error. It’s failing in a confusing way that I’ll fix, but the underlying problem is the LMS library is empty.

In the settings for the spotty plugin in LMS, do you have the “import” option selected? (See screenshot below)

If you set it to “yes”, your Spotify saved albums will be imported into the LMS library, it will no longer be empty, and browsing should work.

Actually the setting is set to “yes”, or: already was from the start. I just realised though that the plugin needs a kind-of sub-plugin, a helper app, and there are various ones offered. I might try out another one…

Hmm, you might need to rescan your media library after selecting yes.

In the meantime, I have a PR pending to fix this bug in the media browser: Squeezebox-browse-fixes by rajlaud · Pull Request #81197 · home-assistant/core · GitHub

1 Like

Hello all,

Thank you for bringing this up again. I am still using a work around.

My setup:
Home Assistant on a Home Assistant Blue
Pi3+ running piCorePlayer and LMS
4 - speakers around the house with a PiZeroW running piCorePlayer
Synology for all my media files (mostly audiobooks and a few MP3 file for alerts and announcements)

I have moved all my media files to my Synology and it has been working for the most part. One problem with pulling from a network folder is sometimes it takes a few seconds to load the file. This creates awkward pauses between the alert sound and announcement. Or the announcement will run over the alert sound.

Not sure if any of this is helpful.

Thank you for working towards a fix!

Okay, a complete rescan didnt make a difference. Is there by the way a certain endpoint/method that I can directly test against (via ssh or postman or whatever), for which the current media browser breaks? Then I would play around a bit more with various settings.

Thanks so much again for the quick reaction including the pull request etc.!

Oh, I think there might actually be another underlying issue:
image

As mentioned: my LMS and piCorePlayer are running on a first-generation Raspberry Pi.
Maybe the Pi is just too slow to provide the whole 800+ songs spotify library before a timeout kicks in?