On Wed, 5 Dec 2018 at 14:07, Alessandro Pisa <
alessan...@gmail.com> wrote:
>
> Hello everybody,
> I have a DB with missing blobs.
> What is the proper way to scan all the blobs and report the missing ones?
>
For the moment I am checking
https://pypi.org/project/zc.zodbdgc/
Running it on a DB where I removed on purpose on blob tells me:
$ cat zeo.conf
<zodb main>
<blobstorage>
blob-dir /path/to/blobs
<filestorage>
path /path/to/Data.fs
</filestorage>
</blobstorage>
</zodb>
$ ./bin/multi-zodb-check-refs zeo.conf
!!! main 328146 ?
POSKeyError: 'No blob file'
Then I can check the blob with:
$ fsoids Data.fs 328146
oid 0x0501d2 ZODB.blob.Blob 1 revision
tid 0x03be0bafcbf1f8dd offset=15782912 2017-03-16 17:19:47.799657
tid user=''
tid description=''
new revision ZODB.blob.Blob at 15897728
referenced by 0x0501c9 plone.app.blob.field.BlobWrapper at 15846484
and get it from the connection (running a zope instance in debug mode):
>>> from ZODB.utils import p64
>>> app._p_jar.get(p64(331142))
<ZODB.blob.Blob object at 0x7f3f79f91668>
Is this the mainstream way?
Any other tips for debugging?