当试图打包我的zope实例的ZODB时,我收到此错误:
2011-02-28 10:47:21 ERROR ZODB.DB packing
Traceback (most recent call last):
File "/usr/local/www/cstools/parts/zope2/lib/python/ZODB/DB.py", line 618, in pack
self._storage.pack(t, referencesf)
File "/usr/local/www/cstools/parts/zope2/lib/python/ZEO/ClientStorage.py", line 865, in pack
return self._server.pack(t, wait)
File "/usr/local/www/cstools/parts/zope2/lib/python/ZEO/ServerStub.py", line 161, in pack
self.rpc.call('pack', t, wait)
File "/usr/local/www/cstools/parts/zope2/lib/python/ZEO/zrpc/connection.py", line 539, in call
raise inst # error raised by server
AttributeError: 'NoneType' object has no attribute 'append'
2011-02-28 10:47:21 ERROR Zope.SiteErrorLog https://conservationtoolstest.tnc.org:54321/Control_Panel/Database/main/manage_pack
Traceback (innermost last):
Module ZPublisher.Publish, line 115, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 41, in call_object
Module <string>, line 3, in _facade
Module AccessControl.requestmethod, line 64, in _curried
Module App.ApplicationManager, line 430, in manage_pack
Module ZODB.DB, line 618, in pack
Module ZEO.ClientStorage, line 865, in pack
Module ZEO.ServerStub, line 161, in pack
Module ZEO.zrpc.connection, line 539, in call
AttributeError: 'NoneType' object has no attribute 'append'
传递给调用方法的是:
call(self, method, *args)
self: <ManagedClientConnection ('<IP REMOVED>', 8100)>
method: pack
args: (1298908370.5440209, 1)
来自zeoserver.log:
(11117) Error raised in delayed method
Traceback (most recent call last):
File "/usr/local/www/cstools/buildout-cache/eggs/ZODB3-3.8.1-py2.4-linux-i686.egg/ZEO/StorageServer.py", line 1247, in run
result = self._method(*self._args)
File "/usr/local/www/cstools/buildout-cache/eggs/ZODB3-3.8.1-py2.4-linux-i686.egg/ZEO/StorageServer.py", line 416, in _pack_impl
self.storage.pack(time, referencesf)
File "/usr/local/www/cstools/buildout-cache/eggs/ZODB3-3.8.1-py2.4-linux-i686.egg/ZODB/FileStorage/FileStorage.py", line 1247, in pack
opos = p.pack()
File "/usr/local/www/cstools/buildout-cache/eggs/ZODB3-3.8.1-py2.4-linux-i686.egg/ZODB/FileStorage/fspack.py", line 481, in pack
self.gc.findReachable()
File "/usr/local/www/cstools/buildout-cache/eggs/ZODB3-3.8.1-py2.4-linux-i686.egg/ZODB/FileStorage/fspack.py", line 227, in findReachable
self.findReachableAtPacktime([z64])
File "/usr/local/www/cstools/buildout-cache/eggs/ZODB3-3.8.1-py2.4-linux-i686.egg/ZODB/FileStorage/fspack.py", line 303, in findReachableAtPacktime
todo.extend(self.findrefs(pos))
File "/usr/local/www/cstools/buildout-cache/eggs/ZODB3-3.8.1-py2.4-linux-i686.egg/ZODB/FileStorage/fspack.py", line 376, in findrefs
return referencesf(self._file.read(dh.plen))
File "/usr/local/www/cstools/buildout-cache/eggs/ZODB3-3.8.1-py2.4-linux-i686.egg/ZODB/serialize.py", line 622, in referencesf
u.noload()
AttributeError: 'NoneType' object has no attribute 'append'
最后,这里是钉住的版本:
buildout.dumppickedversions=0.4
elementtree=1.2.6-20050316
hexagonit.recipe.cmmi=1.1.1
hexagonit.recipe.download=1.2.1
html5lib=0.11.1
infrae.subversion=1.1
ipython=0.8.4
lxml=2.1.5
MySQL-python=1.2.2
PILwoTk = 1.1.6.4
plone.recipe.command=1.0
plone.recipe.distros=1.3
plone.recipe.zope2install=2.2
plone.recipe.zope2instance=2.3.1
plone.recipe.zope2zeoserver=0.13
py=0.9.0
python-ldap=2.3.4
pisa=3.0.32
reportlab=2.4
SessionCrumbler=0.2
setuptools = 0.6c11
simplejson=2.0.9
topp.helpers=1.0
zc.buildout=1.1.1
z3c.recipe.staticlxml=0.7.1
zc.recipe.egg=1.1.0
zc.recipe.cmmi=1.1.5
ZODB3=3.8.1
ZConfig=2.6.1
zdaemon=2.0.2
zest.recipe.mysql=0.7
zlib=1.2.4
zope.interface=3.4.1
zope.proxy=3.4.0
zope.testing=3.5.1
有人可以帮我弄清楚为什么会这样吗?
谢谢! :)
答案 0 :(得分:1)
注意:这是使用追溯和版本信息更新问题后的修订答案
您的包在垃圾回收期间失败,因为您的ZODB数据库中有一个损坏的pickle。您可以通过在Data.fs上运行fsrefs.py
脚本来验证这一点。如果你的buildout中有一个zopepy
或类似的部分(一个脚本只是将参数作为python脚本运行,并且sys.path扩展了你的所有鸡蛋),你可以这样做:
bin/zopepy /usr/local/www/cstools/buildout-cache/eggs/ZODB3-3.8.1-py2.4-linux-i686.egg/ZODB/scripts/fsrefs.py var/filestorage/Data.fs
这是fsrefs.py脚本的完整路径。它只会确认是否存在泡菜错误。很可能这是您不再关心的旧事务的问题,您可以通过编辑serialize.py
模块来忽略此特定的pickle错误来解决此问题。你会在追溯结束时找到它的路径。
编辑referencesf
函数(第608行和第60行)以捕获有问题的异常。最初该功能的顶部如下所示:
refs = []
u = cPickle.Unpickler(cStringIO.StringIO(p))
u.persistent_load = refs
u.noload()
u.noload()
将其更改为:
refs = []
u = cPickle.Unpickler(cStringIO.StringIO(p))
u.persistent_load = refs
u.noload()
try:
u.noload()
except AttributeError:
print "Ignoring AttributeError during garbage collection unpickling."
pass
风险在于垃圾收集算法不会检测到仍在使用的一组对象,因此收拾得太多,但这种风险会随着受影响交易的年龄而减少。风险似乎微乎其微,毕竟泡菜已经破坏,任何应用程序代码都无法通过任何拿来的泡菜进入任何对象。