0

我在使用 Pyramid 和 Beaker 时遇到了一些麻烦(使用 pyramid_beaker 和 memcached 后端)。这个错误开始似乎是随机发生的(我没有对代码进行任何更改)并且它持续存在于甚至不使用request.session.

我真的不知道从哪里开始,但尝试重新启动 memcached 并使用不同的 memcached 和 secret 实例。缓存在早些时候正常工作。如果有人有建议检查我可以提供更多信息。

Traceback (most recent call last):
  File "/var/www/web/local/lib/python2.7/site-packages/pyramid-1.3a3-py2.7.egg/pyramid/mako_templating.py", line 154, in __call__
    result = template.render_unicode(**system)
  File "/var/www/web/local/lib/python2.7/site-packages/Mako-0.5.0-py2.7.egg/mako/template.py", line 311, in render_unicode
    as_unicode=True)
  File "/var/www/web/local/lib/python2.7/site-packages/Mako-0.5.0-py2.7.egg/mako/runtime.py", line 660, in _render
    **_kwargs_for_callable(callable_, data))
  File "/var/www/web/local/lib/python2.7/site-packages/Mako-0.5.0-py2.7.egg/mako/runtime.py", line 692, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/var/www/web/local/lib/python2.7/site-packages/Mako-0.5.0-py2.7.egg/mako/runtime.py", line 718, in _exec_template
    callable_(context, *args, **kwargs)
  File "/var/www/web/local/lib/python2.7/site-packages/pyramid_debugtoolbar-0.9.7-py2.7.egg/pyramid_debugtoolbar/templates/toolbar.mako", line 61, in render_body
    ${panel.content()|n}
  File "/var/www/web/local/lib/python2.7/site-packages/pyramid_debugtoolbar-0.9.7-py2.7.egg/pyramid_debugtoolbar/panels/request_vars.py", line 44, in content
    'session': dictrepr(self.request.session),
  File "/var/www/web/local/lib/python2.7/site-packages/pyramid_debugtoolbar-0.9.7-py2.7.egg/pyramid_debugtoolbar/utils.py", line 145, in dictrepr
    for val in d:
  File "/var/www/web/local/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg/beaker/session.py", line 672, in __iter__
    return iter(self._session().keys())
  File "/var/www/web/local/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg/beaker/session.py", line 646, in _session
    **params)
  File "/var/www/web/local/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg/beaker/session.py", line 160, in __init__
    self.load()
  File "/var/www/web/local/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg/beaker/session.py", line 324, in load
    self.namespace.acquire_read_lock()
  File "/var/www/web/local/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg/beaker/container.py", line 211, in acquire_read_lock
    self.open('r', checkcount = True)
  File "/var/www/web/local/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg/beaker/container.py", line 243, in open
    self.do_open(flags, replace)
  File "/var/www/web/local/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg/beaker/container.py", line 659, in do_open
    self.hash = cPickle.load(fh)
ValueError: insecure string pickle
4

1 回答 1

1

我还没有找到根本原因,但两个小时后它似乎又开始工作了——据我所知,缓存无效或超时。

于 2012-01-30T19:58:56.510 回答