I saw this error from mpd (Music Player Daemon) on ash, the Debian-based home server:

mpd.service: Referenced but unset environment variable evaluates to an empty string: MPDCONF

A look at the mpd.service file (at /usr/lib/systemd/system/mpd.service), indicated it was the use of this variable on the ExecStart line that was the cause of complaint.

    [Service]
    Type=notify
    EnvironmentFile=/etc/default/mpd
    ExecStart=/usr/bin/mpd --systemd $MPDCONF

According to the mpd man page, this value on the command line specifies the configuration file, in preference to the many default locations mpd checks, including /etc/mpd.conf where my configuration exists.

The easiest fix seemed to be to provide an empty value for this variable to silence the error, without fixing the location of the configuration file.

How best to do this without directly editing the default Debian mpd.service file? Well, it’s done by:

sudo systemctl edit mpd.service

which invokes your default editor to add the desired changes to an override file: /etc/systemd/system/mpd.service.d/override.conf.

You will be presented with a copy of the existing configuration file, with the following text prepended:

    ### Editing /etc/systemd/system/mpd.service.d/override.conf
    ### Anything between here and the comment below will become the contents of the drop-in file

    ### Edits below this comment will be discarded

Add the desired additions between the comments, which in this case were:

    ### Editing /etc/systemd/system/mpd.service.d/override.conf
    ### Anything between here and the comment below will become the contents of the drop-in file

    [Service]
    Environment="MPDCONF="

    ### Edits below this comment will be discarded

Save the file and then restart the service. Seems to work.