Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
posativ opened this Issue · 1 comment

2 participants

@posativ

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:86.56.73.1 () {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/web.py", line 232, in handle_service_request
    handler.handle()
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/server.py", line 276, in handle
    get_tagged=self.get_tagged)
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/repo.py", line 248, in fetch_objects
    wants = determine_wants(self.get_refs())
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/server.py", line 386, in determine_wants
    want = self.proto.read_pkt_line()
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/protocol.py", line 101, in read_pkt_line
    sizestr = read(4)
  File "/home/wayne/python/klaus/lib/python2.7/site-packages/dulwich/protocol.py", line 283, in read
    data = self._recv(left)
  File "/usr/lib64/python2.7/gzip.py", line 261, in read
    self._read(readsize)
  File "/usr/lib64/python2.7/gzip.py", line 289, in _read
    self.fileobj.seek(0, 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: http://uwsgi-docs.readthedocs.org/en/latest/Changelog-1.9.6.html#added-non-standard-seek-and-tell-to-wsgi-input-post-buffering-required 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
@jonashaag jonashaag closed this in 51f44b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.