Bug 3804 - hgweb.cgi Throws HTTP Error 500 after every pull Win32/Apache2.2
Summary: hgweb.cgi Throws HTTP Error 500 after every pull Win32/Apache2.2
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: hgweb (show other bugs)
Version: 3.2-rc
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords: regression
: 3777 3807 3811 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-02-04 10:04 UTC by Teddy
Modified: 2014-11-04 13:45 UTC (History)
8 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Teddy 2013-02-04 10:04 UTC
This morning I upgraded our internal server to 2.5. Any pul requested executed against the server caused it throw an HTTP Error 500 at the end of each request. 

I had to roll back to 2.4.2 for today. I only have one web server running.

Windows 2003 R2 x32
Apache 2.2.17
Python 2.7.2
mod_wsgi 3.3


---------------- Server Running 2.5 ------------------------------------------
PS C:\users\xxxxxx\tc-extract\TcMig-Nx> hg in
comparing with http://hgserver/hg/TcMig-Nx
searching for changes
changeset:   132:154c2525a3d5
user:        xxxxxx xxxxxx<xxxxxx_xxxxxx@xxxxxx.com>
date:        Fri Feb 01 16:07:40 2013 -0500
summary:     Add a flag for skipping the volume read when working remotely

changeset:   133:1526fd7cf6e9
tag:         tip
user:        xxxxxx xxxxxx<xxxxxx_xxxxxx@xxxxxx.com>
date:        Fri Feb 01 16:48:15 2013 -0500
summary:     Error checking for null inputs from the initial relationship list

PS C:\users\xxxxxx\tc-extract\TcMig-Nx> hg pull
pulling from http://hgserver/hg/TcMig-Nx
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 3 changes to 2 files
abort: HTTP Error 500: Internal Server Error

PS C:\users\xxxxxx\tc-extract\TcMig-Nx> hg pull
pulling from http://hgserver/hg/TcMig-Nx
searching for changes
no changes found
abort: HTTP Error 500: Internal Server Error

-----------------Roll Server Back to 2.4.2 -----------------------------------
PS C:\users\xxxxxx\tc-extract\TcMig-Nx> hg pul
pulling from http://hgserver/hg/TcMig-Nx
searching for changes
no changes found
PS C:\users\xxxxxx\tc-extract\TcMig-Nx>
Comment 1 Teddy 2013-02-04 10:28 UTC
Server Error Log just shows the following information

Mon Feb 04 09:28:14 2013] [error] [client XXX.XXX.XXX.XXX] Premature end of script headers: hgweb.cgi

[Mon Feb 04 09:28:22 2013] [error] [client XXX.XXX.XXX.XXX] Premature end of script headers: hgweb.cgi

[Mon Feb 04 09:29:25 2013] [error] [client XXX.XXX.XXX.XXX] Premature end of script headers: hgweb.cgi

[Mon Feb 04 09:32:32 2013] [error] [client XXX.XXX.XXX.XXX] Premature end of script headers: hgweb.cgi

[Mon Feb 04 09:38:26 2013] [error] [client XXX.XXX.XXX.XXX] Premature end of script headers: hgweb.cgi

[Mon Feb 04 09:38:57 2013] [error] [client XXX.XXX.XXX.XXX] Premature end of script headers: hgweb.cgi
Comment 2 kiilerix 2013-02-04 10:31 UTC
Yes, there is a new bug there.

You mention mod_wsgi 3.3 ... but are using hgweb.cgi?

As a temporary workaround I suggest using wsgi.
Comment 3 Matt Mackall 2013-02-04 14:46 UTC
Regression -> urgent
Comment 4 Pierre-Yves David 2013-02-04 15:38 UTC
Can you add the output of pull with --debug. The 500 must be triggered by some the pushkey call (bookmarks, phase, obsolescence?). I would like to know which one.
Comment 5 Pierre-Yves David 2013-02-04 15:58 UTC
nevermind, the issue is actually diagnose and a patch is in progress
Comment 6 HG Bot 2013-02-04 17:46 UTC
Fixed by http://selenic.com/repo/hg/rev/e8efcc8ff5c0
Mads Kiilerich <madski@unity3d.com>
hgweb.cgi: fix internal WSGI emulation (issue3804)

The internal WSGI emulation in wsgicgi.py was not fully WSGI compliant and
assumed that all responses sent a body. With 3fbdbeab38cc that caused a real
bug when using hgweb.cgi.

wsgicgi.py will now make sure headers always are sent, using the pattern from
PEP 333 and similar to how it is done in c007e5c54b16.

(please test the fix)
Comment 7 Teddy 2013-02-05 09:52 UTC
This appears to be fixed. We'll run with it all day and will report back at the COB today EST.
Comment 8 Teddy 2013-02-05 15:59 UTC
We've been running with this all day and have seen no problems.
Comment 9 kiilerix 2013-02-08 05:10 UTC
*** Bug 3811 has been marked as a duplicate of this bug. ***
Comment 10 Jesús Cea Avión 2013-02-08 11:38 UTC
I am hitting this bug too. I have spend 45 minuted diagnosing this.

I think this bug should be documented in the release noted *OR* better, publish 2.5.1 ASAP.
Comment 11 Julio C. Rocha 2013-02-08 17:55 UTC
For what it's worth, the issue also shows up in Linux (my hosting provider's CloudLinux server). It's not limited to Windows, but seems consistent with version 2.5.

========================================================================
$ hg --verbose clone http://myhost/hg/cgi-bin/hgweb.cgi/myrepo/
destination directory: myrepo
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
abort: HTTP Error 500: Internal Server Error
========================================================================

Actually, the repository does get cloned, but the working dir doesn't get updated and I get the HTTP-500 error.

I hope the fix gets released (as in 2.5.1) soon.
Comment 12 Matt Mackall 2013-02-08 18:03 UTC
*** Bug 3807 has been marked as a duplicate of this bug. ***
Comment 13 Ben Allums 2013-02-12 18:04 UTC
*** Bug 3777 has been marked as a duplicate of this bug. ***
Comment 14 Pierre-Yves David 2014-11-04 13:45 UTC
Reopened without explanation. reclosing.