Problem with PUSH-ing

Issue #2 resolved
Jaroslav Beran
created an issue


I am trying to setup SSO on two different servers based on Tomcat and Httpd 2.0. Result is quite similar - I am able PULL without any trouble. But PUSH doesnt work. I cannot find working solution on Internet. Here are details:

Tomcat server:

  • Windows 2003 Server std
  • Apache Tomcat 7
  • Jespa 1.1.19
  • Python 2.7.6
  • Mercurial 2.8

Apache HTTPd 2.0 server:

  • Windows 2003 Server std
  • Apache HTTPd 2.2.17
  • Python 2.7.6
  • Mercurial 2.8

PULL works without trouble in both cases. PUSH works without SSO, but faild with SSO on:

In case of Tomcat server:

%hg --debug --repository C:\Users\jaroslav_b\Documents\hg_repos\Project1 push

pushing to
sending capabilities command
query 1; heads
sending batch command
searching for changes
all remote heads known locally
sending branchmap command
sending branchmap command
preparing listkeys for "bookmarks"
sending listkeys command
1 changesets found
list of changesets:
bundling: 1/1 changesets (100.00%)
bundling: 1/1 manifests (100.00%)
bundling: pom.xml 1/1 files (100.00%)
sending unbundle command
sending 345 bytes
sending: 0 kb
sending: 0 kb
requested URL: ''
abort: '' does not appear to be an hg
---%<--- (no content-type)


In case of HTTPd server:

<title>413 Request Entity Too Large</title>
<h1>Request Entity Too Large</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator, and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>

In error log there are following records:

[Wed Nov 20 15:00:43 2013] [error] [client] Invalid Content-Length
[Wed Nov 20 15:00:43 2013] [error] [client] (-3)Unknown error: Error reading request entity data

Jaroslav Beran

Comments (10)

  1. domruf repo owner

    "413 Request Entity Too Large" indicates that you have so increase the LimitRequestFieldSize setting in apache (don't know the setting for tomcat t the moment). Kerberos authentication lets your headers grow significantly.

  2. Jaroslav Beran reporter

    My testing project has 8 kB in total. I set limit 10M (LimitRequestFieldSize 10485760) but result is the same. In my oppinion right reason is in Apache log:

    [Wed Nov 20 15:00:43 2013] [error] [client] Invalid Content-Length
    [Wed Nov 20 15:00:43 2013] [error] [client] (-3)Unknown error: Error reading request entity data

    I noticed in your source code you are sending content length 0:

    h.putheader('Content-Length', '0')

    Could it be reason?

  3. domruf repo owner

    Okay what kind of mercurial server do you have? Does it run in the same apache instance or is the apache only a reverse proxy?

  4. domruf repo owner

    OK you are right the Content-Length is (part of) the problem. I don't use NTLM anymore so I didn't run into with problem yet. But my code only works with PULL (GET requests) I will fix it this evening or tomorrow.

  5. Jaroslav Beran reporter

    Hello Dominik,

    I have tested your fix and it works well in both cases (Tomcat and Apache). Thank you very much for your fast reaction.

    This extension is really useful and I hope it will become part of Mercurial core.


  6. Log in to comment