Description
At the farmconfig.py when its used a special char (like "-") at the wikiname, the CGI "engine" stops to work.
As example. My initial config:
wikis = [ ("finance", r"^wiki.clusterfs.com/cfs/finance2.*$"), ("intra", r"^wiki.clusterfs.com/cfs/intra2.*$"), ("cfs-pnnl", r"^wiki.clusterfs.com/customer/pnnl-20042.*$"), ("course", r"^wiki.clusterfs.com/project/course2.*$"), ("lmacfs", r"^wiki.clusterfs.com/project/lmacfs2.*$"), ("lmt", r"^wiki.clusterfs.com/project/lmt2.*$"), ("lwinfs", r"^wiki.clusterfs.com/project/lwinfs2.*$"), ]
The line with wikiname "cfs-pnnl" is causing the error. If I took off the "-" then it starts to work. So, this is the new config without "-" at wikiname. (at the URL there is no problem to have a "-" on it, only at the wikiname)
The new config: (that's working now):
wikis = [ ("finance", r"^wiki.clusterfs.com/cfs/finance2.*$"), ("intra", r"^wiki.clusterfs.com/cfs/intra2.*$"), ("cfspnnl", r"^wiki.clusterfs.com/customer/pnnl-20042.*$"), ("course", r"^wiki.clusterfs.com/project/course2.*$"), ("lmacfs", r"^wiki.clusterfs.com/project/lmacfs2.*$"), ("lmt", r"^wiki.clusterfs.com/project/lmt2.*$"), ("lwinfs", r"^wiki.clusterfs.com/project/lwinfs2.*$"), ]
And looking at apache log file I have when I had the "-" at the wikiname: (all the wikis go down.. so any wiki I try to access I had the same error)
[Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] Premature end of script headers: moin.cgi, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] Traceback (most recent call last):, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] File "/var/www/wikis2/moin.cgi", line 38, in ?, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] request = RequestCGI(), referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] File "/usr/local2/lib/python2.3/site-packages/MoinMoin/request.py", line 1109, in __init__, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] self._setup_vars_from_std_env(os.environ), referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] File "/usr/local2/lib/python2.3/site-packages/MoinMoin/request.py", line 261, in _setup_vars_from_std_env, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] self._load_multi_cfg(), referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] File "/usr/local2/lib/python2.3/site-packages/MoinMoin/request.py", line 155, in _load_multi_cfg, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] self.cfg = multiconfig.getConfig(self.url), referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] File "/usr/local2/lib/python2.3/site-packages/MoinMoin/multiconfig.py", line 59, in getConfig, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] match = url_re().match(url), referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] File "/usr/local2/lib/python2.3/site-packages/MoinMoin/multiconfig.py", line 37, in url_re, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] _url_re = re.compile(pattern), referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] File "/usr/lib/python2.3/sre.py", line 179, in compile, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] return _compile(pattern, flags), referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] File "/usr/lib/python2.3/sre.py", line 230, in _compile, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] raise error, v # invalid expression, referer: https://wiki.clusterfs.com/cfs/intra2 [Wed Jan 26 21:01:27 2005] [error] [client 200.171.58.186] sre_constants.error: bad character in group name, referer: https://wiki.clusterfs.com/cfs/intra2
Steps to reproduce
- Just add a char like "-" at the wikiname at the farmconfig.py
Details
MoinMoin Version: 1.3.3 |
1.3.3 |
Os Version: Red Hat 8 |
Red Hat 8 |
Python Version: 2.3.4 |
2.3.4 |
Server Setup: |
Apache 2.0.40, using SSL and LDAP auth |
Contact: |
André Couto <andre AT NO SPAM yordan DOT com> |
Workaround
Just avoid to use special chars at the wikiname on farmconfig.py
OBS1: I tried to use "_" (underscore) instead of "-" (minus) and it works! OBS2: I did not tested other special chars...
Discussion
This is not a bug, simply a limit of the current configuration system. Wiki configuration files are Python modules - and Python modules can not use special characters in the names.
Here are good Python modules names:
- goodname.py
- good_name.py
And some bad:
- bad-name.py
- badname
- no+plus+allowed.py
Suggestion
Couldn't you handle the exception being raised and print to stderr just what has gone wrong? If anything is the bug, it's that, IMHO. Then something more descriptive would show up in the web server logs. Even better might be serving up a page explaining the problem.
True, but thats low priority. Try to provide a clean patch (See HelpOnPatchCreation).
Plan
Document this in master and in farmconfig.
- Priority:
- Assigned to:
- Status: closed