0

最近我们的一个应用服务器出现故障,当它重新启动时,Python Beaker 模块停止生成缓存文件。

我得到的错误是:

Error - <type 'exceptions.KeyError'>: 'ver'
URL: http://127.0.0.1:3002/menuadmin/
File '/opt/csw/lib/python2.6/site-packages/WebError-0.10.1-py2.6.egg/weberror/errormiddleware.py', line 162 in __call__
  app_iter = self.application(environ, sr_checker)
File '/opt/csw/lib/python2.6/site-packages/Beaker-1.5.1-py2.6.egg/beaker/middleware.py', line 73 in __call__
  return self.app(environ, start_response)
File '/opt/csw/lib/python2.6/site-packages/Beaker-1.5.1-py2.6.egg/beaker/middleware.py', line 152 in __call__
  return self.wrap_app(environ, session_start_response)
File '/opt/csw/lib/python2.6/site-packages/repoze.who-1.0.18-py2.6.egg/repoze/who/middleware.py', line 107 in __call__
  app_iter = app(environ, wrapper.wrap_start_response)
File '/opt/csw/lib/python2.6/site-packages/inm-1.0.0dev_r2361-py2.6.egg/inm/middleware/middlewarecomponents.py', line 40 in _GroupsMiddleware
  return app(environ, start_response)
File '/opt/csw/lib/python2.6/site-packages/inm-1.0.0dev_r2361-py2.6.egg/inm/middleware/middlewarecomponents.py', line 121 in _AIMSStackedUserMiddleware
  return app(environ, start_response)
File '/opt/csw/lib/python2.6/site-packages/pulse-0.1.2-py2.6.egg/pulse/middleware.py', line 183 in __call__
  return self.app(environ, start_response)
File '/opt/csw/lib/python2.6/site-packages/Routes-1.12-py2.6.egg/routes/middleware.py', line 131 in __call__
  response = self.app(environ, start_response)
File '/opt/csw/lib/python2.6/site-packages/Pylons-0.9.7-py2.6.egg/pylons/wsgiapp.py', line 125 in __call__
  response = self.dispatch(controller, environ, start_response)
File '/opt/csw/lib/python2.6/site-packages/Pylons-0.9.7-py2.6.egg/pylons/wsgiapp.py', line 324 in dispatch
  return controller(environ, start_response)
File '/opt/csw/lib/python2.6/site-packages/menuadmin-0.9.7dev_r0-py2.6.egg/menuadmin/lib/base.py', line 18 in __call__
  return WSGIController.__call__(self, environ, start_response)
File '/opt/csw/lib/python2.6/site-packages/Pylons-0.9.7-py2.6.egg/pylons/controllers/core.py', line 217 in __call__
  response = self._inspect_call(self.__before__)
File '/opt/csw/lib/python2.6/site-packages/Pylons-0.9.7-py2.6.egg/pylons/controllers/core.py', line 107 in _inspect_call
  result = self._perform_call(func, args)
File '/opt/csw/lib/python2.6/site-packages/Pylons-0.9.7-py2.6.egg/pylons/controllers/core.py', line 60 in _perform_call
  return func(**args)
File '/opt/csw/lib/python2.6/site-packages/menuadmin-0.9.7dev_r0-py2.6.egg/menuadmin/controllers/admin.py', line 27 in __before__
  mcm.checkout()
File '/opt/csw/lib/python2.6/site-packages/menuadmin-0.9.7dev_r0-py2.6.egg/menuadmin/controllers/pagecache.py', line 35 in checkout
  ver = cm.get('ver')
File '/opt/csw/lib/python2.6/site-packages/Beaker-1.5.1-py2.6.egg/beaker/cache.py', line 222 in get
  return self._get_value(key, **kw).get_value()
File '/opt/csw/lib/python2.6/site-packages/Beaker-1.5.1-py2.6.egg/beaker/container.py', line 257 in get_value
  raise KeyError(self.key)
KeyError: 'ver'

我已经浏览了模块,发现缓存目录是:

cache_dir = /opt/pyapps/menuadmin/data

创建缓存的代码(主应用程序中名为 pagecache.py 的控制器模块):

cm = Cache('page_cache',type='ext:memcached',url=config['beaker.session.url'],data_dir=config['pylons.cache_dir'])

但是当我访问这个目录时,那里没有缓存文件。

谁能想到为什么烧杯会突然抛出这个错误?可能是某种权限错误吗?

4

1 回答 1

0

我不知道究竟是什么原因造成的,我猜是某种服务器重置,但我设法破解了程序并强制它在烧杯目录中创建一个新的保存文件。

于 2012-07-06T14:56:51.240 回答