Mikko Ohtamaa
Mikko Ohtamaa

Reputation: 83358

Cleaning up POSKeyError: 'No blob file' content from Plone site

We have an old Plone site with Data.fs and blobstorage which has probably been copied wrongly in some point of the past. portal_catalog rebuild does not run because of POSKeyErrors

    Module plone.indexer.wrapper, line 59, in __getattr__
    Module plone.indexer.delegate, line 16, in __call__
    Module Products.CMFPlone.CatalogTool, line 221, in getObjSize
    Module Products.ATContentTypes.content.base, line 198, in get_size
    Module plone.app.blob.field, line 273, in get_size
    Module plone.app.blob.field, line 85, in get_size
    Module plone.app.blob.utils, line 52, in openBlob
    Module ZODB.Connection, line 860, in setstate
    Module ZODB.Connection, line 922, in _setstate
    Module ZODB.blob, line 644, in loadBlob
  POSKeyError: 'No blob file'

The site itself works fine. Blobs are probably used for file downloads and images somewhere in not-so-often accessed content which does not matter.

How do I track down the content having blob errors, print it out and delete it?

Upvotes: 2

Views: 2345

Answers (3)

keul
keul

Reputation: 7819

Try also this experimental.gracefulblobmissing

Upvotes: 2

Ulrich Schwarz
Ulrich Schwarz

Reputation: 7727

When I came across this, I (locally) patched blob.py to read

def loadBlob(self, oid, serial):
    """Return the filename where the blob file can be found.
    """
    filename = self.fshelper.getBlobFilename(oid, serial)
    if not os.path.exists(filename):
        raise POSKeyError("No blob file oid=%s, serial=%s" % (oid, serial,) , oid, serial)
    return filename

(the oid=... being the addition) and tracked on further manually. (IIRC, the path in a blobstorage of type bushy corresponds to the first bytes of the oid, and in my case, I was merging two blobstorages, so that was enough to find it.)

Upvotes: 1

Related Questions