Issue #1 resolved

EGit push

codingtony
repo owner created an issue

Problem pushing using EGit

2012-02-27 21:45:00.533 INFO [dulwich.web] Handling service request for git-receive-pack

ValueError: invalid literal for int() with base 16: '\x1f\x8b\x08\x00'

Comments (12)

  1. Anonymous

    When I get some larger clone to do, I have the same issue. It seems to be related to EGit. Because with the command line there's no issues.

  2. codingtony reporter
    • changed status to open

    (gunziped payload rejected by RhodeCode using wireshark). Tested using gunicorn and waitress.

    EGit request :

    0073want 4bcf241161ecc8a171c2f921fe7e64d834f669f4 include-tag ofs-delta multi_ack_detailed thin-pack side-band-64k 00000009done

    Error stack trace in RhodeCode's log :

    ValueError: invalid literal for int() with base 16: '\x1f\x8b\x08\x00' 2012-03-10 20:24:43.990 ERROR [gunicorn.error] Error handling request Traceback (most recent call last):

    The request with the normal git client is :

    0067want 4bcf241161ecc8a171c2f921fe7e64d834f669f4 multi_ack_detailed side-band-64k thin-pack ofs-delta 00000009done

    This one works.

  3. codingtony reporter

    Not working payload :

    POST /tg/repo2/git-upload-pack HTTP/1.1

    Accept-Encoding: gzip

    Pragma: no-cache

    User-Agent: JGit/1.3.0.201202151440-r

    Content-Type: application/x-git-upload-pack-request

    Accept: application/x-git-upload-pack-result

    Content-Encoding: gzip

    Cache-Control: no-cache

    Host: vmware1:8080

    Connection: keep-alive

    Content-Length: 126

    ..........%.[.. .@..W1. .$ .1.<Z".&.q.5..<.....a.6..B.A...%P...J..x...\5A../.g..CO.. .suk+........n.}...=...]N...U>.L?........

  4. codingtony reporter

    Working payload (msysgit)

    POST /tg/repo2/git-upload-pack HTTP/1.1

    User-Agent: git/1.7.3.1.msysgit.0

    Host: vmware1:8080

    Accept-Encoding: deflate, gzip

    Content-Type: application/x-git-upload-pack-request

    Accept: application/x-git-upload-pack-result

    Content-Length: 116

    0067want 4bcf241161ecc8a171c2f921fe7e64d834f669f4 multi_ack_detailed side-band-64k thin-pack ofs-delta 00000009done

  5. codingtony reporter

    It seems that the big difference is that the EGit request is gzipped (HTTP_CONTENT_ENCODING gzip)

    environ in call (gzipper.py )

    {'CONTENT_LENGTH': '116', 'SERVER_PORT': '8080', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'gunicorn/0.14.1', 'SCRIPT_NAME': '', 'wsgi.input': <gunicorn.http.body.Body object at 0x4b38790>, 'REQUEST_METHOD': 'POST', 'HTTP_HOST': 'vmware1:8080', 'PATH_INFO': '/tg/repo2/git-upload-pack', 'wsgi.multithread': False, 'QUERY_STRING': '', 'HTTP_ACCEPT': 'application/x-git-upload-pack-result', 'HTTP_USER_AGENT': 'git/1.7.3.1.msysgit.0', 'wsgi.version': (1, 0), 'REMOTE_PORT': '58262', 'RAW_URI': '/tg/repo2/git-upload-pack', 'REMOTE_ADDR': '192.168.5.70', 'wsgi.run_once': False, 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7f75365aa1e0>, 'wsgi.multiprocess': False, 'wsgi.url_scheme': 'http', 'gunicorn.socket': <socket._socketobject object at 0x4b2ebb0>, 'SERVER_NAME': 'vmware1', 'CONTENT_TYPE': 'application/x-git-upload-pack-request', 'wsgi.file_wrapper': <class gunicorn.http.wsgi.FileWrapper at 0x48d4bf0>, 'HTTP_ACCEPT_ENCODING': 'deflate, gzip'}

    samething with EGit :

    {'CONTENT_LENGTH': '126', 'HTTP_PRAGMA': 'no-cache', 'SERVER_PORT': '8080', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'gunicorn/0.14.1', 'SCRIPT_NAME': '', 'wsgi.input': <gunicorn.http.body.Body object at 0x4b4eb90>, 'REQUEST_METHOD': 'POST', 'HTTP_HOST': 'vmware1:8080', 'PATH_INFO': '/tg/repo2/git-upload-pack', 'wsgi.multithread': False, 'QUERY_STRING': '', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_CACHE_CONTROL': 'no-cache', 'HTTP_ACCEPT': 'application/x-git-upload-pack-result', 'HTTP_USER_AGENT': 'JGit/1.3.0.201202151440-r', 'wsgi.version': (1, 0), 'REMOTE_PORT': '58266', 'RAW_URI': '/tg/repo2/git-upload-pack', 'REMOTE_ADDR': '192.168.5.70', 'wsgi.run_once': False, 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7f75365aa1e0>, 'wsgi.multiprocess': False, 'wsgi.url_scheme': 'http', 'gunicorn.socket': <socket._socketobject object at 0x4b2ebb0>, 'SERVER_NAME': 'vmware1', 'CONTENT_TYPE': 'application/x-git-upload-pack-request', 'wsgi.file_wrapper': <class gunicorn.http.wsgi.FileWrapper at 0x48d4bf0>, 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_CONTENT_ENCODING': 'gzip'}

  6. codingtony reporter

    I think that the gzip_middleware doesn't decompress request, it only cares about responses.

    ValueError: invalid literal for int() with base 16: '\x1f\x8b\x08\x00' 2012-03-10 20:24:43.990 ERROR [gunicorn.error] Error handling request Traceback (most recent call last):

    when looking with wireshark "1F 8B 08 00" is on the wire, so when it gets to the dulwich git protocol the payload is still gzipped.

    I'm trying to hack something to decompress the wsgi.input in simplegit when the request is gzipped... I'm not very familiar with the wsgi framework, so I need to check on how to do it properly.

  7. Log in to comment