Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPD too noisy (after disconnection) #57633

Closed
Mariusthvdb opened this issue Oct 13, 2021 · 14 comments · Fixed by #94507
Closed

MPD too noisy (after disconnection) #57633

Mariusthvdb opened this issue Oct 13, 2021 · 14 comments · Fixed by #94507

Comments

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Oct 13, 2021

The problem

upon turning off my mpd player, the integration keeps throwing a warning every 10 seconds for a very long period. just tested and it was from

2021-10-13 21:57:59 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
to

2021-10-13 23:12:37 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 23:12:45 ERROR (MainThread) [homeassistant] Error doing job: CommandResult exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/mpd/asyncio.py", line 277, in __run
    await result._feed_from(self)
  File "/usr/local/lib/python3.9/site-packages/mpd/asyncio.py", line 44, in _feed_from
    line = await mpdclient._read_line()
  File "/usr/local/lib/python3.9/site-packages/mpd/asyncio.py", line 345, in _read_line
    line = await self.__readline()
  File "/usr/local/lib/python3.9/site-packages/mpd/asyncio.py", line 318, in __readline
    data = await self.__rfile.readline()
  File "/usr/local/lib/python3.9/asyncio/streams.py", line 540, in readline
    line = await self.readuntil(sep)
  File "/usr/local/lib/python3.9/asyncio/streams.py", line 632, in readuntil
    await self._wait_for_data('readuntil')
  File "/usr/local/lib/python3.9/asyncio/streams.py", line 517, in _wait_for_data
    await self._waiter
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 856, in _read_ready__data_received
    data = self._sock.recv(self.max_size)
OSError: [Errno 113] Host is unreachable

seems a bit too much

What is version of Home Assistant Core has the issue?

2021.10.4

What was the last working version of Home Assistant Core?

not sure

What type of installation are you running?

Home Assistant OS

Integration causing the issue

MPD

Link to integration documentation on our website

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

Example YAML snippet

media_player:

  platform: mpd
  host: 192.168.1.177
  name: My player

Anything in the logs that might be useful for us?

2021-10-13 21:57:59 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:58:09 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:58:19 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:58:29 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:58:39 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:58:49 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:58:59 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:59:09 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:59:19 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:59:29 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-10-13 21:59:39 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10

Additional information

No response

@probot-home-assistant
Copy link

mpd documentation
mpd source
(message by IssueLinks)

@probot-home-assistant
Copy link

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

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Nov 4, 2021

on 2021.11.
adding to the original post above, I notice the warnings also arise when HA starts without any mod player being online:

spamming the HA log every 10 seconds:

2021-11-04 10:21:30 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-11-04 10:21:39 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-11-04 10:21:49 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-11-04 10:21:59 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-11-04 10:22:09 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-11-04 10:22:29 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10
2021-11-04 10:22:39 WARNING (MainThread) [homeassistant.components.media_player] Updating mpd media_player took longer than the scheduled update interval 0:00:10

hope anyone can have a look

preventing the flooding using:

filters:
  homeassistant.components.media_player:
    - Updating mpd media_player took longer than the scheduled update interval 0:00:10

in logger for now, but that is hardly a solution ofc.

edited the topic title because of this

@Mariusthvdb Mariusthvdb changed the title MPD too noisy after disconnection MPD too noisy (after disconnection) Nov 4, 2021
@kds69
Copy link

kds69 commented Jan 12, 2022

Up.
Exact same here. Trying now to change below parameter from default 1 to 10 in configuration:
scan_interval: 1

@Growiel
Copy link

Growiel commented Feb 9, 2022

Still happening on core-2022.2.3. Will use the filter for now.

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Mar 8, 2022

just tried again without the filter since all developments on media_player.
Running 2022.4.0.dev20220308

Unfortunately this hasn't improved at all:

Logger: homeassistant.components.media_player
Source: helpers/entity_platform.py:719 
Integration: Media player (documentation, issues) 
First occurred: 09:44:55 (22 occurrences) 
Last logged: 12:21:36

Updating mpd media_player took longer than the scheduled update interval 0:00:10
Updating samsungtv media_player took longer than the scheduled update interval 0:00:10
Updating panasonic_viera media_player took longer than the scheduled update interval 0:00:10
Updating dlna_dmr media_player took longer than the scheduled update interval 0:00:10

seems awfully silly these updates are even tried since all of these players are 'off'. couldn't some test be applied before logging this?

too bad this has been going since half a year without any dev team response whatsoever.

@github-actions
Copy link

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.

@github-actions github-actions bot added stale and removed stale labels Jul 15, 2022
@issue-triage-workflows
Copy link

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.

@Mariusthvdb
Copy link
Contributor Author

Keep

@arcnmx
Copy link

arcnmx commented Mar 25, 2023

From what I can tell, upon shutdown it errors, then it will never attempt to reconnect again:

Error doing job: Exception in callback MPDClient.__idle_result(<CommandResul...eading line')>)

Traceback (most recent call last):
  File "/nix/store/0n4y44dnaxafqs7cg625aldrb152x7bx-python3-3.10.10/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/nix/store/gkqr9zs41spzhrf0l3jgwqb4h2fwc7nx-python3.10-python-mpd2-3.0.5/lib/python3.10/site-packages/mpd/asyncio.py", line 335, in __idle_result
    idle_changes = result.result()
  File "/nix/store/gkqr9zs41spzhrf0l3jgwqb4h2fwc7nx-python3.10-python-mpd2-3.0.5/lib/python3.10/site-packages/mpd/asyncio.py", line 309, in __run
    await result._feed_from(self)
  File "/nix/store/gkqr9zs41spzhrf0l3jgwqb4h2fwc7nx-python3.10-python-mpd2-3.0.5/lib/python3.10/site-packages/mpd/asyncio.py", line 45, in _feed_from
    line = await mpdclient._read_line()
  File "/nix/store/gkqr9zs41spzhrf0l3jgwqb4h2fwc7nx-python3.10-python-mpd2-3.0.5/lib/python3.10/site-packages/mpd/asyncio.py", line 391, in _read_line
    raise ConnectionError("Connection lost while reading line")
mpd.base.ConnectionError: Connection lost while reading line

... after which point it just infinitely complains:

Update of media_player.shanghai_mpd is taking over 10 seconds

First occurred: March 17, 2023 at 2:24:02 PM (66556 occurrences)
Updating mpd media_player took longer than the scheduled update interval 0:00:10

I'm not even sure if I can manually reload the integration? so if I try to turn it on from the entity page:

Can not send command to disconnected client

... well then maybe consider connecting to it!

@issue-triage-workflows
Copy link

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.

@arcnmx
Copy link

arcnmx commented Jun 24, 2023

an active PR is addressing this, so it doesn't look very stale?

@issue-triage-workflows
Copy link

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.

@arcnmx
Copy link

arcnmx commented Sep 27, 2023

an active PR is addressing this, so it doesn't look very stale?

EDIT: bot, hello? :(

@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants