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

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


Hi,

Just installed MapProxy on Ubuntu 11.10 and am looking forward for
integrating it with QGIS Server
http://hub.qgis.org/projects/quantum-gis/wiki/QGIS_Server_Tutorial
(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] 127.0.0.1 - - [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
    self.run()
  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__
    self.finish()
  File "/usr/lib/python2.7/SocketServer.py", line 694, in finish
    self.wfile.flush()
  File "/usr/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
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
log:


writev(): Broken pipe
[/build/buildd/uwsgi-0.9.8.1/plugins/python27/../python/wsgi_headers.c
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 127.0.0.1) !!!

and

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 127.0.0.1) !!!


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

https://bitbucket.org/olt/mapproxy/src/5659883bd146/mapproxy/test/http.py


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


Thanks,

Larry


More information about the MapProxy mailing list