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

mpdas can't connect to mpd #56

Closed
dglava opened this issue Jul 4, 2019 · 7 comments
Closed

mpdas can't connect to mpd #56

dglava opened this issue Jul 4, 2019 · 7 comments

Comments

@dglava
Copy link

dglava commented Jul 4, 2019

mpdas stopped working after updating it because it can't find my config file. I've upgraded to a build of the latest master branch.

Seems like mpdas can't connect to mpd at all.

I'm running mpd version 0.21.11 together with the latest mpdas build from master. I'm starting mpd and mpdas with a systemd user service, but I'm also experiencing this if I just run mpd and mpdas from my shell. This is the error I'm getting.

(21:15:06) [ERROR] You are not root. Not changing user ..
(21:15:06) [INFO] Using Libre.fm service URL
(21:15:06) [ERROR] Could not connect to MPD.
(21:15:06) [INFO] Closing mpdas.
@dglava dglava changed the title Config not being loaded mpdas can't connect to mpd Jul 11, 2019
@dglava
Copy link
Author

dglava commented Jul 18, 2019

I've narrowed it down a bit: commit f4e248a.

If I remove the global config file /etc/mpdasrc then it works again with the latest build from master. Anything up to that commit used to work even with the global config not removed from /etc.

Seems like the "global" config file in /etc has priority over the user config file in ~/.config/. I guess a potential fix for this would be prioritizing the "user" config files and only then loading the file in /etc.

@hrkfdn
Copy link
Owner

hrkfdn commented Jul 19, 2019

IIRC the global config is loaded first and then the user config, so any values set in the user config should overtop the global values.

@dglava
Copy link
Author

dglava commented Jul 20, 2019

I think the problem is when some values aren't set (or are commented out) in the user config file, then the ones from the global config file are taken. One must explicitly set the values in the user config file.

One problem might be the mpdpassword option. In my case, since I don't use it, mpdas failed to start, because it was set in the global config, but not in my user's config. I think that's why it wasn't able to connect.

@hrkfdn
Copy link
Owner

hrkfdn commented Jul 20, 2019

Which distribution is this? Does it install the example file in /etc? Does setting it to "" (empty value) work?

@dglava
Copy link
Author

dglava commented Jul 20, 2019

I am using Arch Linux, but packaged myself since it's not in the official repository.
I am using the latest build from master. It installs the sample config in /etc.

Just tried setting it to "" in the config file in /etc and it's not working; mpdas can't connect if I set host = "".

I guess a solution would be to make it disregard the config options from /etc or ~/.mpdasrc if the options from ~/.config/mpdasrc are loaded.

@hrkfdn
Copy link
Owner

hrkfdn commented Jul 21, 2019

For host an empty value is invalid. The default value is localhost.

@dglava
Copy link
Author

dglava commented Jul 29, 2019

Okay, I just set all the values explicitly in my user config file and it's working regardless of what's in the example/global config file.

My bad, I guess it's solved now.

@dglava dglava closed this as completed Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants