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 errors on startup when device is offline/no cover art is displayed #44931
Comments
mpd documentation |
My issue (#44948) may be a duplicate of this. I won't close it just yet as I'm not seeing the errors in the logs, just not getting album art. |
This honestly looks like it cannot reach the MPD instance. Though if I had to guess where things go wrong it's here:
Would probably help to check if any of these two is available, else return core/homeassistant/components/mpd/media_player.py Lines 273 to 275 in 58195c6
Can you test that? |
it cant reach the MPD instance,because it isnt powered on, that my whole point. Before, we didn't see these errors, and the media_player simply came online after powering there MPD instance. That doesn't happen any longer. About the test for album art: how can I test that? Using HA OS here. |
I have no idea how HA OS works tbh. This would be my proposed change: I'll look into the failed connection noise later tonight. |
Sorry, but I don't get it. We read in the release note that MPD now shows album art:
and yet you state here the integration doesn't support that? I am confused... |
The MPD platform works with multiple backends that all support the MPD protocol, such as MPD (the original implementation) and Mopidy (a reimplmentation). Not all backends support all features. So the problem is that you are using Mopidy and that it does not supply that information via the MPD protocol. |
Why would you say I use Mopidy? I know of no such thing tbh, only connected my MPD player via the media_player config and the core integration. |
Sorry, i mixed this up with #44948. |
seems we need MPD 0.21 for album art: mopidy/mopidy-mpd#17 (comment) ? |
Yeah, sounds like it. The mpd changelog doesn't really say. Anyway, there are two commands involved:
The mpd component can use both, either or none, which is dynamically determined from the list of commands given by the MPD implementation. |
I have the same issue, as the OP but trouble following the discussion here. So do I understand it correctly, that mpd version 0.21.xx is currently broken with Homeassistant and I just need to update mpd? And I'm currently using:
|
It shouldn't be. What errors are you getting and what is your setup? Is mpd always avaiable? |
mpd is always on. I get the same error as @Mariusthvdb
As setup, I use hassio running in a dedicated VM with ubuntu 18.04 as base with Docker 20.10.2. The issue is, like @Mariusthvdb mentioned, that mpd doesn't show up as instance any more. |
You seem to be using a DNS name and something in your resolver setup failed, hence the
Regarding the second issue, it might just be that we need to catch Can you apply the following patch and see if things are working better with it? diff --git a/homeassistant/components/mpd/media_player.py b/homeassistant/components/mpd/media_player.py
index 1273b720dd..49207fa24c 100644
--- a/homeassistant/components/mpd/media_player.py
+++ b/homeassistant/components/mpd/media_player.py
@@ -131,7 +131,7 @@ class MpdDevice(MediaPlayerEntity):
"""Disconnect from MPD."""
try:
self._client.disconnect()
- except mpd.ConnectionError:
+ except (mpd.ConnectionError, AttributeError):
pass
self._is_connected = False
self._status = None Meanwhile I opened up an issue over at python-mpd2. I don't think we should need to catch AttributeErrors of the sort. Mic92/python-mpd2#152 |
i have the same problem:
|
Okay, here is what is going on. So my best guess is that this error is only happening on home-assistant instances, where the initial connect to the mpd instance did not pan out. As we've seen above it could be And for the more technically inclined: |
MPD has stopped working for me too. Generally, the server (Mopidy in this case) is switched off. Previously when I switched it on Home Assistant would pick it up, but it no longer does that. |
Meaning this is currently an dependency issue or? @fabaff might want to add the label if so.
Hm, I have the server in the /etc/hosts but whatever I switched to IP instead of hostname and now it seems to be working again. Do you still want me to test the little patch? Seems to me you have figured it out and since the change will happen upstream is it worth it? If you still would like me to test, I would test, else I can live happy with what I have and move on? |
A fix has been merged upstream, and now I'm waiting for a new release. No further testing is required AFAICT. |
I have a similar issue with 'mopidy' installed (from this repo: https://github.com/bestlibre/hassio-addons/tree/master/mopidy) locally but I cannot understand if is something related (if not I will open a separate issue).
|
Yes, related. Will be fixed when python-mpd2 releases an update. The fix is in their main branch. |
Hello! I guess have the same problem. After the read of this post, im still not sure if the upcoming fix will cover my case: My MPD server is not always on when i update / reboot Homassistant, wich lead for the entity to not being added at all and thus not available when the MPD server gets powered on. MPD was indeed added trough Homassistant configuration.yml. I'd like homeassistant to add the entity even if the MPD server is not available at boot in order for the integration to be available once the server is booted. (wich was the case before if i'm not mistaken) Does this fix correct this aswell? |
Yes. |
The problem
After updating to 2021.1, MPD errors on startup, when device is offline. more importantly, when the device is online, it wont show up as media_player in HA.
Added to that, no coverart is displayed at all, which would be the new feature of this release
Environment
Problem-relevant
configuration.yaml
Traceback/Error logs
Additional information
please see community post: https://community.home-assistant.io/t/how-to-get-the-new-m-usic-p-layer-d-aemon-image-to-appear/265301
I did try to enter a password (my devices system allows system settings only after entering login/pw) but that errored stating 'wrong password'
Since I can not enter a login name in the config, I take it is useless to try to add a password, so I took it out again.
Media player is setup correctly when device is on on HA startup, albeit without coverart.
This is hardly a desired situation, since most of the time the MPD device will be off, and HA should be able to handle that gracefully, and, check for the device to become online.
The text was updated successfully, but these errors were encountered: