hgweb Odd-string length error
Jérôme Godbout
jerome at bodycad.com
Wed Jul 16 14:15:11 UTC 2014
Just to give a follow up in case it affect other people, I try the same
configuration at home (Python 2.7.8, Mercurial 3.0.2 via Fink and Apache
2.2 built-in) under OS X.9 and copied config file (modify path that's all).
The hgweb (browse, pull, push) work under this platform. At least I can
confirm it's not the the hg.config or hgweb.cgi or apache config that's
wrong. It seem like this bug only affect the Windows platform.
1. I try to catch the error into the hgweb.cgi script to see what went
wrong, but nothing there.
def addToLog(info):
file = open("c:/tempo/trace.log", "a+")
file.write(info)
file.write("\r\n")
file.close()
def debugExceptionHook(exctype, value, traceback):
addToLog(exctype)
addToLog(value)
addToLog(traceback)
sys.excepthook = debugExceptionHook
addToLog("New run")
try:
application = hgweb(config)
WSGIServer(application).run()
except errorInfo:
addToLog(errorInfo)
I only end up with "New run"
2. I try to enable ScriptLog into apache VirtualHost tag, nothing appear
there either
ScriptLog "logs/cgi-bin.log"
3. Activate DumpIO module (stripped line header for times):
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 40 bytes
dumpio_in (data-HEAP): GET /hg/toto?cmd=capabilities HTTP/1.1\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 27 bytes
dumpio_in (data-HEAP): Accept-Encoding: identity\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 20 bytes
dumpio_in (data-HEAP): host: build_server\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 35 bytes
dumpio_in (data-HEAP): accept: application/mercurial-0.1\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 33 bytes
dumpio_in (data-HEAP): user-agent: mercurial/proto-1.0\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 2 bytes
dumpio_in (data-HEAP): \r\n
AH01626: authorization result of Require all granted: granted
AH01626: authorization result of <RequireAny>: granted
AH01626: authorization result of Require all granted: granted
AH01626: authorization result of <RequireAny>: granted
dumpio_out
dumpio_out (data-HEAP): 182 bytes
dumpio_out (data-HEAP): HTTP/1.1 200 Script output follows\r\nDate: Wed,
16 Jul 2014 14:05:10 GMT\r\nServer: Apache/2.4.9 (Win64)
OpenSSL/1.0.1f\r\nContent-Length: 130\r\nContent-Type:
application/mercurial-0.1\r\n\r\n
dumpio_out
dumpio_out (data-HEAP): 130 bytes
dumpio_out (data-HEAP): lookup changegroupsubset branchmap pushkey known
getbundle unbundlehash batch stream unbundle=HG10GZ,HG10BZ,HG10UN
httpheader=1024
dumpio_out (metadata-FLUSH): 0 bytes
dumpio_out
dumpio_out (data-IMMORTAL): 0 bytes
dumpio_out (metadata-EOS): 0 bytes
dumpio_out
dumpio_out (metadata-EOR): 0 bytes
dumpio_in [speculative-nonblocking] 1 readbytes
dumpio_in (data-HEAP): 1 bytes
dumpio_in (data-HEAP): G
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 1 bytes
dumpio_in (data-HEAP): G
dumpio_in (data-HEAP): 32 bytes
dumpio_in (data-HEAP): ET /hg/toto?cmd=batch HTTP/1.1\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 27 bytes
dumpio_in (data-HEAP): Accept-Encoding: identity\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 41 bytes
dumpio_in (data-HEAP): x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 20 bytes
dumpio_in (data-HEAP): host: build_server\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 17 bytes
dumpio_in (data-HEAP): vary: X-HgArg-1\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 35 bytes
dumpio_in (data-HEAP): accept: application/mercurial-0.1\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 33 bytes
dumpio_in (data-HEAP): user-agent: mercurial/proto-1.0\r\n
dumpio_in [getline-blocking] 0 readbytes
dumpio_in (data-HEAP): 2 bytes
dumpio_in (data-HEAP): \r\n
AH01626: authorization result of Require all granted: granted
AH01626: authorization result of <RequireAny>: granted
AH01626: authorization result of Require all granted: granted
AH01626: authorization result of <RequireAny>: granted
dumpio_out
dumpio_out (data-HEAP): 181 bytes
dumpio_out (data-HEAP): HTTP/1.1 200 Script output follows\r\nDate: Wed,
16 Jul 2014 14:05:10 GMT\r\nServer: Apache/2.4.9 (Win64)
OpenSSL/1.0.1f\r\nContent-Length: 42\r\nContent-Type:
application/mercurial-0.1\r\n\r\n
dumpio_out
dumpio_out (data-HEAP): 43 bytes
dumpio_out (data-HEAP): 779d1659558261acdbdc5a83bbd6a081b42eedfb\r\n;
dumpio_out (metadata-FLUSH): 0 bytes
dumpio_out
dumpio_out (data-IMMORTAL): 0 bytes
dumpio_out (metadata-EOS): 0 bytes
dumpio_out
dumpio_out (metadata-EOR): 0 bytes
dumpio_in [speculative-nonblocking] 1 readbytes
dumpio_in - 730054
dumpio_out
dumpio_out (metadata-FLUSH): 0 bytes
dumpio_in [getline-blocking] 0 readbytes
dumpio_in - 730054
dumpio_out
dumpio_out (metadata-FLUSH): 0 bytes
dumpio_out (metadata-EOC): 0 bytes
Not sure if the problems lie into the client handling the answer or the
actual data shape send by server (not much knowledge about the protocol
used by mercurial here). Any other way to debug this? Anyone have a slight
idea why? (time like those I wish my work was on *nix machine!)
On Thu, Jul 10, 2014 at 1:20 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Thu, 2014-07-10 at 10:59 -0400, Jérôme Godbout wrote:
> > I tried without the proxy by using the document root directly pointing on
> > cgi-bin
> > DocumentRoot "${SRVROOT}/cgi-bin/"
> > <Directory "${SRVROOT}/cgi-bin/">
> > Require all granted
> > Options ExecCGI FollowSymLinks
> > AddHandler cgi-script .cgi
> > </Directory>
> >
> > Changed the baseurl and staticurl into the web section of hgweb.config:
> > baseurl = /hgweb.cgi/
> > staticurl = /hgweb.cgi/static/
> >
> > Accessing website with web browser
> > http://myserver/hgweb.cgi/ see the list ok
> > http://myserver/hgweb.cgi/MyRepos see the repos info ok
> >
> > I still can browse the content with the web browser, but still got the
> > Odd-length string error when cloning repos. (Apache 2.4, Python 2.7.8,
> > Mercurial 3.0.2 python). Tested with 32 and 64 bits of Python/Apache. I
> > also created a new repos to serve (making sure a comment encoding was
> not a
> > problems), only have a single commit from repos default encoding (cp1252
> on
> > Windows).
> >
> > This is bare bone hgweb setup, cannot go with less to serve it. Is the
> .cgi
> > script still supported??? should I move to the .fcgi directly? would it
> > make any difference?
>
> The CGI script is fine.
>
> Turn off stack traces: the client is choking on the trace and the server
> is not logging the error because it's sending it to the client. Then
> maybe you'll get to actually see the error.
>
> If that doesn't work, use wireshark to capture the connection.
>
> --
> Mathematics is the supreme nostalgia of our time.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20140716/eb6daf85/attachment-0002.html>
More information about the Mercurial
mailing list