Bug 2332 - Internal error in HGwebdir raw-rev for one specific status.
Summary: Internal error in HGwebdir raw-rev for one specific status.
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-16 06:45 UTC by Ton
Modified: 2012-05-13 05:11 UTC (History)
3 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 Ton 2010-08-16 06:45 UTC
I have one specific changeset that causes HGWEBDIR and HGWEB to throw an
'internal server error' on Windows and on Linux.

Here's the log from the error-hg.log for an apache serve on Linux:
-----------------------------------------
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] Traceback (most
recent call last):
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/share/hg/index.cgi", line 67, in <module>
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]
wsgicgi.launch(application)
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/lib/pymodules/python2.6/mercurial/hgweb/wsgicgi.py", line 71, in launch
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] content =
application(environ, start_response)
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/lib/pymodules/python2.6/mercurial/hgweb/hgwebdir_mod.py", line 105, in
__call__
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] return
self.run_wsgi(req)
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/lib/pymodules/python2.6/mercurial/hgweb/hgwebdir_mod.py", line 162, in
run_wsgi
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] return
hgweb(repo).run_wsgi(req)
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/lib/pymodules/python2.6/mercurial/hgweb/hgweb_mod.py", line 194, in
run_wsgi
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] content =
getattr(webcommands, cmd)(self, req, tmpl)
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/lib/pymodules/python2.6/mercurial/hgweb/webcommands.py", line 258, in
changeset
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] parity=parity.next()))
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/lib/pymodules/python2.6/mercurial/templater.py", line 226, in __call__
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] stream =
proc.process(t, mapping)
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/lib/pymodules/python2.6/mercurial/templater.py", line 73, in process
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] return
_flatten(self._process(self._load(t), mapping))
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/lib/pymodules/python2.6/mercurial/templater.py", line 78, in _load
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] self._cache[t] =
self._parse(self._loader(t))
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]   File
"/usr/lib/pymodules/python2.6/mercurial/templater.py", line 213, in load
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24]     
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] self.cache[t] =
open(self.map[t][1]).read()
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] KeyError
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] : 
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] 'filenolink'
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] 
[Mon Aug 16 14:15:53 2010] [error] [client 192.168.1.24] Premature end of
script headers: index.cgi
-------------------------------
here's the log for a hg serve on Windows:
----------------------------------------
127.0.0.1 - - [16/Aug/2010 14:40:25] Exception happened during processing
request '/raw-rev/fd6084214c7d':
Traceback (most recent call last):
  File "mercurial\hgweb\server.pyc", line 65, in do_POST
  File "mercurial\hgweb\server.pyc", line 58, in do_write
  File "mercurial\hgweb\server.pyc", line 122, in do_hgweb
  File "mercurial\hgweb\hgweb_mod.pyc", line 85, in __call__
  File "mercurial\hgweb\hgweb_mod.pyc", line 194, in run_wsgi
  File "mercurial\hgweb\webcommands.pyc", line 258, in changeset
  File "mercurial\templater.pyc", line 226, in __call__
  File "mercurial\templater.pyc", line 73, in process
  File "mercurial\templater.pyc", line 78, in _load
  File "mercurial\templater.pyc", line 213, in load
KeyError: 'filenolink'
---------------------------------------------
A new commit allows me to read the raw-rev of tip, but this specifc revision
is not traceable via raw-rev. I have tried using hg verify to fix this but
that doesn't work.
Comment 1 kiilerix 2010-08-16 07:01 UTC
Do adding 
filenolink = ''
to templates/raw/map make it work?
Comment 2 Ton 2010-08-16 07:48 UTC
Yes adding
filelink = ''
resolves the issue.
Comment 3 kiilerix 2010-08-16 16:14 UTC
filelink? you meant filenolink, right?
Comment 4 Ton 2010-08-16 23:33 UTC
Yes, sorry
filenolink = ''
resolves this, however I would like to have this fixed inside filenolink.
Or am I misunderstanding what I have done/what the bug is.

Ton
Comment 5 HG Bot 2010-08-17 16:00 UTC
Fixed by http://hg.intevation.org/mercurial/crew/rev/5b559934d504
Matt Mackall <mpm@selenic.com>
templates: add filenolink to raw style (issue2332)
Comment 6 Bugzilla 2012-05-12 09:11 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:11 EDT  ---

This bug was previously known as _bug_ 2332 at http://mercurial.selenic.com/bts/issue2332