IOError: seeking wsgi.input without post_buffering is IMPOSSIBLE !!! #81

posativ opened this Issue Jan 16, 2014 · 1 comment

2 participants


I noticed that I was no longer able to git-clone via Smart HTTP (no authentication used) because of this error:

[pid: 26948|app: 0|req: 3/3] ::ffff: () {40 vars in 534 bytes} [Thu Jan 16 11:43:07 2014] GET /git/isso/info/refs?service=git-upload-pack => generated 2241 bytes in 16 msecs (HTTP/1.1 200) 4 headers in 189 bytes (1 switches on core 0)
Traceback (most recent call last):
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/", line 232, in handle_service_request
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/", line 276, in handle
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/", line 248, in fetch_objects
    wants = determine_wants(self.get_refs())
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/", line 386, in determine_wants
    want = self.proto.read_pkt_line()
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/", line 101, in read_pkt_line
    sizestr = read(4)
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/", line 283, in read
    data = self._recv(left)
  File "/usr/lib64/python2.7/", line 261, in read
  File "/usr/lib64/python2.7/", line 289, in _read, 2)     # Seek to end of file
IOError: seeking wsgi.input without post_buffering is IMPOSSIBLE !!!

This somehow does not crash git, but pauses it until you interrupt the process. I am using uWSGI (version 1.9.6) and I've found this interesting changelog: which states that Klaus is violating the WSGI specification (Klaus or dulwich?).

To fix this issue, you need to add post-buffering = 4096 (in bytes, size can be adjusted of course) to your configuration or uwsgi call, so uWSGI handle the WSGI violation correctly.

It this issue related to Klaus and is there a fix to not violating WSGI or is it related to Dulwich? For the latter case, --post-buffering = N should be added to the readme.

@jonashaag jonashaag added the Dulwich label Mar 7, 2014
@jonashaag jonashaag closed this in 51f44b2 May 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment