Delete corrupted object from zodb

Hi All,

We are facing problems while running a report due to a corrupted object in Data.fs. We have the oid and path of the object which is corrupted. We tried to delete it from frontend but couldn't do it. We have uncataloged the object using catalog.uncatalog_object(path). Now we can't see the object but it is still present in the database.

Can someone please help us to delete this object from database? We are using plone 3.3.5.
Here is the log:

Maybe you can first replace the object and then delete that. i.e:

from OFS.SimpleItem import SimpleItem
new_obj = SimpleItem(obj_id)
container._setOb(obj_id, new_obj)
container.manage_delObjects(ids=[obj_id])

where obj_id is the id of the corrupted object.

Hey David,

It worked! Thank you.

However, when I run the zeopack, I get the following error:
No handlers could be found for logger "ZODB.blob"
Traceback (most recent call last):
File "/usr/local/Plone/zeocluster/bin/zeopack", line 36, in ?
plone.recipe.zope2zeoserver.pack.main(host, port, unix, days, username, password, realm, blob_dir, storage)
File "/usr/local/Plone/buildout-cache/eggs/plone.recipe.zope2zeoserver-1.4-py2.4.egg/plone/recipe/zope2zeoserver/pack.py", line 36, in main
cs.pack(wait=wait, days=int(days))
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.8.3-py2.4-linux-x86_64.egg/ZEO/ClientStorage.py", line 831, in pack
return self._server.pack(t, wait)
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.8.3-py2.4-linux-x86_64.egg/ZEO/ServerStub.py", line 166, in pack
self.rpc.call('pack', t, wait)
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.8.3-py2.4-linux-x86_64.egg/ZEO/zrpc/connection.py", line 699, in call
raise inst # error raised by server
ZODB.FileStorage.format.CorruptedError: /usr/local/Plone/zeocluster/var/filestorage/Data.fs:28589556708:data record does not point to transaction header: 28317763084 != 28588177528
No handlers could be found for logger "ZODB.blob"

Any suggestions?

Hmm, I guess the pack job still needs to read from the part of the file that is corrupt. Repairing this is beyond what I know how to do, unfortunately. If the database isn't too big you could try making a zexp export of the entire site (which should only include current objects without transaction history) and importing it to a fresh database.