Description

If you use a standalone server wiki and a cgi wiki on the same machine and you have the same usernamne in both wikis, then werkzeug runs into a session problem because it uses the same session file for both installations and runs into permission problems because of the different uid/gid used for the different servers.

 
 
<type 'exceptions.IOError'>
Python 2.5.2: /usr/bin/python
Fri Nov 21 21:25:18 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 0xd8b190>)
  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 0xd8b190>, self.server = <flup.server.fcgi_single.WSGIServer object at 0xd84e90>, self.server.handler = <bound method WSGIServer.handler of <flup.server.fcgi_single.WSGIServer object at 0xd84e90>>
 /usr/lib/python2.5/site-packages/MoinMoin/support/flup/server/fcgi_base.py in handler(self=<flup.server.fcgi_single.WSGIServer object at 0xd84e90>, req=<flup.server.fcgi_base.CGIRequest object at 0xd8b190>)
 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 0xd84e90>, self.application = <function application at 0xdbf488>, environ = {'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=c5e9617e2ab26797c45c41da0766a9ac65d..._SESSION=92d54b4837e15669f63909a0fbac4122cbd15b2c', 'HTTP_HOST': 'localhost', 'HTTP_KEEP_ALIVE': '300', ...}, start_response = <function start_response at 0xdbf500>
 /usr/lib/python2.5/site-packages/MoinMoin/wsgiapp.py in application(environ={'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=c5e9617e2ab26797c45c41da0766a9ac65d..._SESSION=92d54b4837e15669f63909a0fbac4122cbd15b2c', 'HTTP_HOST': 'localhost', 'HTTP_KEEP_ALIVE': '300', ...}, start_response=<function start_response at 0xdbf500>)
  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 0xd9edd0>, context.cfg.session_service = <MoinMoin.web.session.FileSessionService object at 0xca1d50>, context.cfg.session_service.finalize = <bound method FileSessionService.finalize of <Mo...b.session.FileSessionService object at 0xca1d50>>, context.session = <MoinSession {'trail': [u'ReimarBauer', u'RecentChanges']}*>
 /usr/lib/python2.5/site-packages/MoinMoin/web/session.py in finalize(self=<MoinMoin.web.session.FileSessionService object at 0xca1d50>, request=<AllContext ['AllContext']>, session=<MoinSession {'trail': [u'ReimarBauer', u'RecentChanges']}*>)
   95                                  cookie_path, request.cfg.cookie_domain)
   96             request.headers.add('Set-Cookie', cookie)
   97 
   98         if session.should_save:
   99             self.store.save(session)
self = <MoinMoin.web.session.FileSessionService object at 0xca1d50>, self.store = <werkzeug.contrib.sessions.FilesystemSessionStore object at 0xca1d90>, self.store.save = <bound method FilesystemSessionStore.save of <we...sions.FilesystemSessionStore object at 0xca1d90>>, session = <MoinSession {'trail': [u'ReimarBauer', u'RecentChanges']}*>
 /usr/lib/python2.5/site-packages/MoinMoin/support/werkzeug/contrib/sessions.py in save(self=<werkzeug.contrib.sessions.FilesystemSessionStore object at 0xca1d90>, session=<MoinSession {'trail': [u'ReimarBauer', u'RecentChanges']}*>)
  209 
  210     def save(self, session):
  211         f = file(self.get_session_filename(session.sid), 'wb')
  212         try:
  213             dump(dict(session), f, HIGHEST_PROTOCOL)
f undefined, builtin file = <type 'file'>, self = <werkzeug.contrib.sessions.FilesystemSessionStore object at 0xca1d90>, self.get_session_filename = <bound method FilesystemSessionStore.get_session...sions.FilesystemSessionStore object at 0xca1d90>>, session = <MoinSession {'trail': [u'ReimarBauer', u'RecentChanges']}*>, session.sid = u'92d54b4837e15669f63909a0fbac4122cbd15b2c'

<type 'exceptions.IOError'>: [Errno 13] Permission denied: u'/tmp/werkzeug_92d54b4837e15669f63909a0fbac4122cbd15b2c.sess'
      args = (13, 'Permission denied')
      errno = 13
      filename = u'/tmp/werkzeug_92d54b4837e15669f63909a0fbac4122cbd15b2c.sess'
      message = ''
      strerror = 'Permission denied'

traceback_werkzeug.html

Component selection

Details

MoinMoin Version

moin-1.9 4429:574644cfc6d2

OS and Version

Python Version

Server Setup

cgi, standalone

Server Details

apache, python

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

Discussion

The problem is that session files are created in /tmp, not in the wiki instance.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/1.9WerkzeugPermissionDenied (last edited 2009-02-02 04:56:09 by ThomasWaldmann)