Description
The superuser mode for select user is broken and gives the following traceback
<type 'exceptions.AttributeError'> | Python 2.5.2: /usr/bin/python Fri Nov 21 22:00:57 2008 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/usr/lib/python2.5/site-packages/MoinMoin/support/flup/server/fcgi_base.py in run(self=<flup.server.fcgi_base.CGIRequest object at 0xd8b150>) |
556 """Runs the handler, flushes the streams, and ends the request.""" |
557 try: |
558 protocolStatus, appStatus = self.server.handler(self) |
559 except: |
560 traceback.print_exc(file=self.stderr) |
protocolStatus undefined, appStatus undefined, self = <flup.server.fcgi_base.CGIRequest object at 0xd8b150>, self.server = <flup.server.fcgi_single.WSGIServer object at 0xd84e50>, self.server.handler = <bound method WSGIServer.handler of <flup.server.fcgi_single.WSGIServer object at 0xd84e50>> |
/usr/lib/python2.5/site-packages/MoinMoin/support/flup/server/fcgi_base.py in handler(self=<flup.server.fcgi_single.WSGIServer object at 0xd84e50>, req=<flup.server.fcgi_base.CGIRequest object at 0xd8b150>) |
1114 try: |
1115 try: |
1116 result = self.application(environ, start_response) |
1117 try: |
1118 for data in result: |
result = None, self = <flup.server.fcgi_single.WSGIServer object at 0xd84e50>, self.application = <function application at 0xdbe488>, environ = {'CONTENT_LENGTH': '172', 'CONTENT_TYPE': 'application/x-www-form-urlencoded', 'DOCUMENT_ROOT': '/var/www/', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'en,de-de;q=0.8,de;q=0.5,en-us;q=0.3', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'MOIN_SESSION=2b075c689cb60c66359f660e3ba7801b71f779e8', ...}, start_response = <function start_response at 0xdbe500> |
/usr/lib/python2.5/site-packages/MoinMoin/wsgiapp.py in application(environ={'CONTENT_LENGTH': '172', 'CONTENT_TYPE': 'application/x-www-form-urlencoded', 'DOCUMENT_ROOT': '/var/www/', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'en,de-de;q=0.8,de;q=0.5,en-us;q=0.3', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'MOIN_SESSION=2b075c689cb60c66359f660e3ba7801b71f779e8', ...}, start_response=<function start_response at 0xdbe500>) |
235 request = Request(environ) |
236 context = init(request) |
237 response = run(context) |
238 context.clock.stop('total') |
239 except HTTPException, e: |
response undefined, global run = <function run at 0xd88938>, context = <AllContext ['AllContext']> |
/usr/lib/python2.5/site-packages/MoinMoin/wsgiapp.py in run(context=<AllContext ['AllContext']>) |
71 else: |
72 response = dispatch(request, context, action_name) |
73 context.cfg.session_service.finalize(context, context.session) |
74 return response |
75 except MoinMoinFinish: |
context = <AllContext ['AllContext']>, context.cfg = <wikiconfig.Config object at 0xd9ed90>, context.cfg.session_service = <MoinMoin.web.session.FileSessionService object at 0xca7d10>, context.cfg.session_service.finalize = <bound method FileSessionService.finalize of <Mo...b.session.FileSessionService object at 0xca7d10>>, context.session = <MoinSession {'setuid': u'1225487592.8.2974', 't...hod': 'moin', 'user.id': '1225487494.69.41466'}*> |
/usr/lib/python2.5/site-packages/MoinMoin/web/session.py in finalize(self=<MoinMoin.web.session.FileSessionService object at 0xca7d10>, request=<AllContext ['AllContext']>, session=<MoinSession {'setuid': u'1225487592.8.2974', 't...hod': 'moin', 'user.id': '1225487494.69.41466'}*>) |
75 if userobj and userobj.valid: |
76 if 'user.id' in session and session['user.id'] != userobj.id: |
77 request.cfg.session_service.delete(session) |
78 session['user.id'] = userobj.id |
79 session['user.auth_method'] = userobj.auth_method |
request = <AllContext ['AllContext']>, request.cfg = <wikiconfig.Config object at 0xd9ed90>, request.cfg.session_service = <MoinMoin.web.session.FileSessionService object at 0xca7d10>, request.cfg.session_service.delete undefined, session = <MoinSession {'setuid': u'1225487592.8.2974', 't...hod': 'moin', 'user.id': '1225487494.69.41466'}*> |
<type 'exceptions.AttributeError'>: 'FileSessionService' object has no attribute 'delete'
args =
("'FileSessionService' object has no attribute 'delete'",)
message =
"'FileSessionService' object has no attribute 'delete'"
FileSessionService_traceback.html
How to reproduce
- Have 2 users, one with superuser capabilities (easily tested with standalone).
- Login as the superuser.
- Go to preferences, select "switch user"
- Choose the other user and submit.
- See the crash.
Details
MoinMoin Version |
moin-1.9 4429:574644cfc6d2 |
OS and Version |
|
Python Version |
|
Server Setup |
|
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
|
Workaround
Discussion
MoinMoin/web/session.py ... userobj = request.user if userobj and userobj.valid: if 'user.id' in session and session['user.id'] != userobj.id: request.cfg.session_service.delete(session) # <-- obviously wrong/non-existant and was never tested session['user.id'] = userobj.id session['user.auth_method'] = userobj.auth_method session['user.auth_attribs'] = userobj.auth_attribs
Plan
- Priority:
Assigned to: ThomasWaldmann
Status: fixed by http://hg.moinmo.in/moin/1.9/rev/0ac99fdbe65d