[MapProxy] Broken pipe errors in test server and via Nginx

Larry Shaffer larrys at dakotacarto.com
Sun Dec 25 18:44:25 EST 2011


Just installed MapProxy on Ubuntu 11.10 and am looking forward for
integrating it with QGIS Server
(any hints on configuring for QGIS's server would be appreciated).

While testing the base demo map install with the test server I get the
following error trace:

[info] - - [25/Dec/2011 15:44:45] "GET /tms/1.0.0/osm_EPSG4326/6/82/
36.png HTTP/1.1" 200 -
Exception in thread Thread-134:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/SocketServer.py", line 585, in process_request_thread
    self.handle_error(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 641, in __init__
  File "/usr/lib/python2.7/SocketServer.py", line 694, in finish
  File "/usr/lib/python2.7/socket.py", line 303, in flush
error: [Errno 32] Broken pipe

I get these whenever the requests to uncached OSM tiles are sent.
However, MapProxy appears to work fine.

I generated the config.py for wsgi deployment and configured MapProxy
to work under the excellent uWSGI server (
http://projects.unbit.it/uwsgi/ ) with:

/usr/bin/uwsgi -s /tmp/uwsgi_mapproxy.sock -M -i \
    --uid www-data --gid www-data --plugin python --workers 6 \
    --wsgi-file /www/qgis/client/mapproxy/config.py --daemonize
/var/log/uwsgi/mapproxy.log \
    --disable-logging --pidfile /var/run/uwsgi_mapproxy.pid \
    --virtualenv /www/py/map --protocol uwsgi

NOTE: I'm running it from a virtualenv @ /www/py/map

I then configured Nginx as a reverse proxy with the following:

# pass to MapProxy daemon
location /mapproxy {
    gzip off;

    include uwsgi_params;
    uwsgi_pass unix:/tmp/uwsgi_mapproxy.sock;

    uwsgi_param SCRIPT_NAME /mapproxy;
    uwsgi_modifier1 30;

And... everything appears to work fine, just as when trying the test
server. But, I also get similar 'broken pipe' errors that flood my

writev(): Broken pipe
line 205]
SIGPIPE: writing to a closed pipe/socket/fd (probably the client
disconnected) on request /mapproxy/tms/1.0.0/osm_EPSG4326/5/47/16.png
(ip !!!


sendfile(): Broken pipe [sendfile.c line 99]
SIGPIPE: writing to a closed pipe/socket/fd (probably the client
disconnected) on request /mapproxy/tms/1.0.0/osm_EPSG4326/7/96/49.png
(ip !!!

I saw some notes about suppressing broken pipes in the source for the
HTTPServer class here:


Any clues? I'd like to know if this is a serious error before moving
on with further testing.



More information about the MapProxy mailing list