Finding missing blobs

15 views
Skip to first unread message

Alessandro Pisa

unread,
Dec 5, 2018, 8:07:53 AM12/5/18
to zodb
Hello everybody,
I have a DB with missing blobs.
What is the proper way to scan all the blobs and report the missing ones?

Thanks in advance!
--
@ale_pisa - http://ale-rt.github.io - http://alepisa.blogspot.com -
https://it.linkedin.com/in/apisa

Alessandro Pisa

unread,
Dec 5, 2018, 8:35:18 AM12/5/18
to zodb
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?

Jim Fulton

unread,
Dec 8, 2018, 1:33:27 PM12/8/18
to Alessandro Pisa, zo...@googlegroups.com
That's pretty cool. Well done!
 
Is this the mainstream way?

I don't think there's a "mainstream way", as I don't think this is a common (commonly-known?) problem.  I haven't encountered or heard of it before.

Jim

--
Reply all
Reply to author
Forward
0 new messages