= Description = Describe the bug... Setting up moinmoin with mod_python using farmconfig.py and its regular expressions causes a moinmoin to be unstabele. Regular expression suggested in the farmconfig.py does not provide enough examples/details to general user. Examples set provide quick fix to naming of the wiki website and file structure and do not promote easy configuration or "zero configuration". Requireing a (non-general knowladge) Regular Expression to be part of '''general''' configuration is bug. Name convetions and wikipage access on multiple domains are not addressed at all (localhost, 192.168.0.1, mycompany.localnetwork,mydomain.com, mydomain.net, mydomain.org) == Steps to reproduce == ## Describe the steps needed to reproduce the bug. If we can't reproduce it, we probably can't fix it. 1. Changing any configuration in formconfig under wikis = [ causes unexpected errors. Change regular expression to: r".*$" causes {{{ error nothing to repeat If you want to report a bug, please save this page and attach it to your bug report. }}} {{{ # /usr/lib/python2.4/sre.py in _compile (*key=('(?P?.*$)', 0)) 1. 225 p = sre_compile.compile(pattern, flags) 2. 226 except error, v: 3. 227 raise error, v # invalid expression 4. 228 if len(_cache) >= _MAXCACHE: 5. 229 _cache.clear() * global error = * v = }}} But then if reloaded few times wiki decides to work. There is no way to predict its behavior because base installation design is unstable. == Example == ##Add URL that show the bug, screenshot or test wiki markup that fail... {{{ A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. 1. /usr/lib/python2.4/site-packages/MoinMoin/request.py in __init__ (self=, req=) 1. 1863 env=req.subprocess_env 2. 1864 self._setup_vars_from_std_env(env) 3. 1865 RequestBase.__init__(self) 4. 1866 5. 1867 except Exception, err: * global RequestBase = * RequestBase.__init__ = * self = 2. /usr/lib/python2.4/site-packages/MoinMoin/request.py in __init__ (self=, properties={}) 1. 111 # order is important here! 2. 112 self.__dict__.update(properties) 3. 113 self._load_multi_cfg() 4. 114 5. 115 # Set decode charsets. Input from the user is always in * self = * self._load_multi_cfg = > 3. /usr/lib/python2.4/site-packages/MoinMoin/request.py in _load_multi_cfg (self=) 1. 240 if not hasattr(self, 'cfg'): 2. 241 from MoinMoin import multiconfig 3. 242 self.cfg = multiconfig.getConfig(self.url) 4. 243 5. 244 def setAcceptedCharsets(self, accept_charset): * self = * self.cfg undefined * multiconfig = * multiconfig.getConfig = * self.url = '192.168.254.79/mywiki/' 4. /usr/lib/python2.4/site-packages/MoinMoin/multiconfig.py in getConfig (url='192.168.254.79/mywiki/') 1. 147 @return: config object for specific wiki 2. 148 """ 3. 149 configName = _getConfigName(url) 4. 150 try: 5. 151 config = _config_cache[configName] * configName undefined * global _getConfigName = * url = '192.168.254.79/mywiki/' 5. /usr/lib/python2.4/site-packages/MoinMoin/multiconfig.py in _getConfigName (url='192.168.254.79/mywiki/') 1. 122 def _getConfigName(url): 2. 123 """ Return config name for url or raise """ 3. 124 match = _url_re().match(url) 4. 125 if not (match and match.groups()): 5. 126 msg = ''' * match undefined * global _url_re = * ).match undefined * url = '192.168.254.79/mywiki/' 6. /usr/lib/python2.4/site-packages/MoinMoin/multiconfig.py in _url_re () 1. 66 pattern = '|'.join([r'(?P<%s>%s)' % (name, regex) 2. 67 for name, regex in farmconfig.wikis]) 3. 68 _url_re_cache = re.compile(pattern) 4. 69 except AttributeError: 5. 70 msg = """ * global _url_re_cache = None * global re = * re.compile = * pattern = '(?P?.*$)' 7. /usr/lib/python2.4/sre.py in compile (pattern='(?P?.*$)', flags=0) 1. 178 def compile(pattern, flags=0): 2. 179 "Compile a regular expression pattern, returning a pattern object." 3. 180 return _compile(pattern, flags) 4. 181 5. 182 def purge(): * global _compile = * pattern = '(?P?.*$)' * flags = 0 8. /usr/lib/python2.4/sre.py in _compile (*key=('(?P?.*$)', 0)) 1. 225 p = sre_compile.compile(pattern, flags) 2. 226 except error, v: 3. 227 raise error, v # invalid expression 4. 228 if len(_cache) >= _MAXCACHE: 5. 229 _cache.clear() * global error = * v = error nothing to repeat * args = ('nothing to repeat',) System Details * Date: Mon, 20 Nov 2006 15:26:38 +0000 * Platform: Linux mis7 2.6.15-27-386 #1 PREEMPT Sat Sep 16 01:51:59 UTC 2006 i686 * Python: Python 2.4.3 (/usr/bin/python) * MoinMoin: Release 1.5.2 (release) }}} ##URL: ##attachment:screenshot.png == Details == ## If you got a traceback, please save the traceback page as html and attach here: ## attachment:traceback.html ## if the bug is in this wiki, just kill the table and write: This Wiki. ## If a traceback is not available, please fill in the details here: || '''!MoinMoin Version''' || || || '''OS and Version''' |Linux| |Ubuntu stable| || '''Python Version''' |2.4| || || '''Server Setup''' |apache2| |mod_python| || '''Server Details''' |http://moinmoin.wikiwikiweb.de/MoinMoinPackages/DebianLinux?highlight=%28debian%29#head-1b39156a3daa5689018369273b567ce421eb6313| || || '''Language you are using the wiki in''' (set in the browser/UserPreferences) |en| || == Workaround == ## How to deal with the bug until it is fixed 1.learn regular expression and manipulate it until it works. 1.Keep reloading the page. In my case i press reload wiki shows up. I press reload again i get an error, i press reload again and it works, and again broken/good/broken/good = Discussion = Some suggestions: * check your REs for typos * don't use mod_python, but either cgi (until you have stuff working) or fastcgi or standalone (few users) * if you use anything else than cgi, restart your web server process after every config change * use a recent moin and python version and try to reproduce your problem * read this: {{{ >>> re.compile(r"?.*$") Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.4/sre.py", line 180, in compile return _compile(pattern, flags) File "/usr/lib/python2.4/sre.py", line 227, in _compile raise error, v # invalid expression sre_constants.error: nothing to repeat }}} = Plan = ## This part is for Moin``Moin developers: * Priority: * Assigned to: * Status: configuration problem combined with mod_py needing a server restart to reload config. -- JohannesBerg <> ---- ## If you are a moin core developer, replace the category to Category* in these cases: ## Category MoinMoinNoBug - if this is not a bug. ## Category MoinMoinBugConfirmed - if you can confirm the bug on current code. ## Category MoinMoinBugFixed - after the bug is fixed in current code. CategoryMoinMoinNoBug