MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.16k stars 346 forks source link

Client connection closed when trying to get queue contents #671

Closed elomatreb closed 4 years ago

elomatreb commented 4 years ago

Bug report

When requesting the current queue (e.g. mpc playlist) MPD immediately closes the connection, with "exception: error on client 1: Output buffer is full" being the only thing written to the logs. This only seems to occur when I add my entire library to the queue, but the library isn't particularly large (about 11k titles).

This started happening after I reorganized my music library, but it was perfectly fine before. I primarily just renamed stuff (including creating some pretty long folder/file names) and then rescanned the library.

Expected Behavior

mpc playlist reports the contents of the queue.

Actual Behavior

mpc playlist shows MPD error: Connection closed by the server and the log message mentioned above appears.

Version

Music Player Daemon 0.21.16 (0.21.16)
Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy upnp

Storage plugins:
 local smbclient udisks nfs curl

Neighbor plugins:
 smbclient upnp udisks

Decoders plugins:
 [mad] mp3 mp2
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [faad] aac
 [mpcdec] mpc
 [wavpack] wv
 [modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
 [mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
 [wildmidi] mid
 [fluidsynth] mid
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo pipe alsa ao oss openal solaris pulse jack httpd recorder

Encoder plugins:
 null vorbis opus lame twolame wave flac

Archive plugins:
 [bz2] bz2
 [zzip] zip
 [iso] iso

Input plugins:
 file archive alsa tidal qobuz curl ffmpeg smbclient nfs mms cdio_paranoia

Playlist plugins:
 extm3u m3u pls xspf asx rss soundcloud flac cue embcue

Protocols:
 file:// alsa:// tidal:// qobuz:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// smb:// nfs:// mms:// mmsh:// mmst:// mmsu:// cdda://

Other features:
 avahi dbus udisks epoll icu inotify ipv6 systemd tcp un

Log

Oct 28 07:44:18 elomatreb-t420 systemd[576]: Started Music Player Daemon.
Oct 28 07:44:22 elomatreb-t420 mpd[1149453]: client: [0] opened from [::1]:60414
Oct 28 07:44:22 elomatreb-t420 mpd[1149453]: client: [0] process command "config"
Oct 28 07:44:22 elomatreb-t420 mpd[1149453]: client: [0] command returned 2
Oct 28 07:44:22 elomatreb-t420 mpd[1149453]: client: [0] process command list
Oct 28 07:44:22 elomatreb-t420 mpd[1149453]: client: process command "add """
Oct 28 07:44:22 elomatreb-t420 mpd[1149453]: client: command returned 0
Oct 28 07:44:22 elomatreb-t420 mpd[1149453]: client: [0] process command list returned 0
Oct 28 07:44:22 elomatreb-t420 mpd[1149453]: client: [0] closed
Oct 28 07:44:26 elomatreb-t420 mpd[1149453]: state_file: Saving state file /home/elomatreb/.cache/mpd/state
Oct 28 07:44:29 elomatreb-t420 mpd[1149453]: client: [1] opened from [::1]:60418
Oct 28 07:44:29 elomatreb-t420 mpd[1149453]: client: [1] process command "playlistinfo"
Oct 28 07:44:29 elomatreb-t420 mpd[1149453]: exception: error on client 1: Output buffer is full
Oct 28 07:44:29 elomatreb-t420 mpd[1149453]: client: [1] command returned 0
Oct 28 07:44:29 elomatreb-t420 mpd[1149453]: client: [1] closed
MaxKellermann commented 4 years ago

This is because your queue is larger than the configured max_output_buffer_size setting (see https://www.musicpd.org/doc/html/user.html#resource-limitations). Clients can optimize this by disabling tags which they're not interested in (see https://www.musicpd.org/doc/html/protocol.html#connection-settings). That way, the response gets smaller and may be well below the configured limit.

elomatreb commented 4 years ago

Thanks for the quick response! I actually checked for an option like this in the mpd.conf man page but couldn't find it, sorry.

I just increased the value for now, seems to work!

MaxKellermann commented 4 years ago

From the manpage:

This manual is not complete, it lists only the most important options. Please read the MPD user manual for a complete configuration guide: http://www.musicpd.org/doc/user/