我遇到了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
答案 0 :(得分:1)
我没有找到根本原因,但两小时后它似乎再次起作用 - 据我所知,缓存无效或超时。