home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.93k stars 30.15k forks source link

Squeezbox (LMS) generating log warning every 10 seconds #91549

Closed stu247 closed 1 year ago

stu247 commented 1 year ago

The problem

When I am playing music controlled with a squeezebox (LMS) entity, I receive the following log warning every 10 seconds:

2023-04-17 09:40:35.218 WARNING (Recorder) [homeassistant.components.recorder.db_schema] State attributes for media_player.kitchen_2 exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored

I have a large playlist with over 2000 songs that I use for background music. This causes the media_content_id entity attribute to be very large. I think media_content_id attribute value is causing the warning message above from the recorder.

One possible fix is to exclude the media_content_id attribute value from being included with the recorder data. I do not have much experience with HA code, but it looks like an example of this is at https://github.com/home-assistant/core/blob/dev/homeassistant/components/calendar/recorder.py

What version of Home Assistant Core has the issue?

core-2023.4.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Squeezbox (Logitech Media Server)

Link to integration documentation on our website

https://www.home-assistant.io/integrations/squeezebox/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @rajlaud, mind taking a look at this issue as it has been labeled with an integration (squeezebox) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `squeezebox` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign squeezebox` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


squeezebox documentation squeezebox source (message by IssueLinks)

rajlaud commented 1 year ago

Thanks for the report. I believe you are right about the cause and I think excluding the playlist from the recorder may make sense. Let me look into that.

In the meantime, I believe you could stop the log error by manually excluding the player entity altogether from the recorder. (https://www.home-assistant.io/integrations/recorder/)

meaniegreenie commented 1 year ago

I came here to create the same issue.
I captured a debug log which does show that the field _media_content_id={"index": 460, "urls": [ {"url":_ is the culprit. In the attached file, I cut out all but two of the items to reduce the size (see ........<SNIP 100's of URL's >....... in the file). sbtouch-debug.log

meaniegreenie commented 1 year ago

I was able to temporarily remove the error by removing it from the recorder. For those that aren't YAML experts (me), here's what I added to configuration.yaml:

recorder:
  exclude:
    entities:
      - media_player.den_sbtouch
issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.