Music Player Daemon HOWTO Troubleshoot
From Music Player Daemon Community Wiki
This article is a stub. You can help the MPD community by expanding it. Just click "Edit this page" and start typing.
Contents |
[edit] How to troubleshoot MPD
MPD is inheritantly difficult to troubleshoot by default. This isn't on purpose, fact is no one has done any work on improving the situation. Here's how to help you fix your daemon.
Before all else If you're having problems starting MPD, experience tells us you're having a permissions problem. You may have checked permissions previously. That's fine and all, you didn't check them good enough. 19 out of 20 people that request support for MPD have permissions problems. Go directly to Basic Troubleshooting if this isn't your first run.
[edit] MPD won't start
This usually occurs the first time install, basically MPD, itself, isn't very user friendly.
[edit] First run: Non-existing / Bad permission daemon files
A few things to understand:
Run the following command:
# grep '^user.*' /etc/mpd.conf
Remember who you have set as the user.
Now run:
# grep '_file.*' /etc/mpd.conf
You see all the files, db_file, etc... MPD expects those files to not only exist, but to have the permissions of user
You can easily do what needs to be done by running this in the shell:
for file in $(grep '_file.*' /etc/mpd.conf | sed 's/.* //' | xargs)
do
touch ${file}
chown $(grep '^user.*' /etc/mpd.conf | sed 's/.* //') ${file}
done
[edit] Non-existing daemon required directories
Run the following command:
# grep '_dir' /etc/mpd.conf
These directories must be owned or have equalivent access to user
You can easily do this by:
for dir in $(grep '_dir.*' /etc/mpd.conf | sed 's/.* //' | xargs)
do
mkdir -pv "${dir}"
chown $(grep '^user.*' /etc/mpd.conf | sed 's/.* //') ${file}
done
[edit] Basic Troubleshooting
Basic troubleshooting of MPD requires logs. There's two methods of getting these logs. The easiest most straightforward way of finding out problems is the direct way.
[edit] Starting MPD no-daemon
Start MPD:
# /usr/bin/mpd --stdout --no-daemon --verbose
Error appears here (wasn't that easy?).
[edit] Troubleshooting with logs
Sometimes the no daemon method of basic troubleshooting won't do. For this you need to change the log_level in /etc/mpd.conf to log_level "verbose" then restart MPD. You should see tons of logs in your log_file and error_file. Examine these logs closely. They provide great clues to your problem.
[edit] Can't connect to MPD
This happens in startup sometimes when some distributions, not singling out any distributions, but some bind_to_address localhost by default. For troubleshooting's sake comment this out and restart MPD.
If this didn't happen in startup, and you cannot connect this could be a bug. Make sure your MPD_HOST and MPD_PORT are correct for your client and MPD is running on the box you think it is. Then file a bug report at MPD's bug tracker.
[edit] MPD locks up
It does happen every now and again, MPD will lock up. How to deal with it goes here.
[edit] How to debug MPD
- You need to make sure MPD is built with debug support. This varies in how to get this done. Most binary distributions, you need to have *-debug installed. If installing from source compile with CFLAGS='-g'
- Ensure that ulimit (the size limit of your dump information) is set to unlimited. This can be done with the command: ulimit -c unlimited
- Run MPD with mpd --stdout --no-daemon --verbose and duplicate the crash. This will leave you with a core file in the directory you started MPD in.
- Run gdb against the binary as such gdb /usr/bin/mpd core, after doing this gdb console will be brought up.
- In the gdb console, type bt. This should give you a bittrace.
- File a bug, or join us in irc, with as much information as you can about it. Tell us how to duplicate it, give us the information from the bittrace (copy and paste).
