[Zope] POSKeyError, help, please.

BZ bz@bwanazulia.com
Mon, 24 Mar 2003 18:03:07 -0600 (CST)


Wow. Thanks Dieter. I can't wait to try this.

Are these the steps?

1) Dump Data.fs (backup copy) to text file using fsdump
2) Convert POSKeyError to hex OID (object ID) using U64
3) Find last UID in the Data.fs dump using text editor
4) Find TID of next transaction's and  offset number
5) Truncate Data.fs to that given offset (tool? how?)
6) Start Zope with truncated Data.fs
7) Find object with problem and export it
9) Import object into new Zope installation

Questions:
- How do you truncate a Data.fs to an offset?
- How do I know where the object is that had the problem (will I see it in
the Data.fs dump I did?)

Thanks for all your help.

BZ


> Stefan A. Nagey wrote at 2003-3-23 15:23 -0500:
>  > I've been struggling with this one non-stop since last night.
>  >
>  > I work at an ISP, we keep our customer records in zope.
>  >
>  > Somehow, i seem to have lost records for nearly 1/4 of our customers.
>  >
>  > I've tried deleting the index, packing the DB, exporting and then
>  > importing into a fresh Data.fs, using fsrecover.py
>  >
>  > i've also tried fsrefs.py, which tells me that i'm missing a bunch of
>  > objects.
>  >
>  > The size of my Data.fs is prettymuch unchanged, which might suggest
>  > that the data is still there, but how do i get to it?
>
> Provided you have enough disk space, use
> "fsdump" to get a textual representation of your "Data.fs".
>
> You will see object records containing "oid" values.
> These are hexadecimal representations of the values reported
> in "POSKeyError" (side node: why do "POSKeyError" not report
> the hexadecimal value?).
> To convert between hexadecimal and textual representation,
> you can use "U64" and "p64" from "ZODB.utils".
> "U64" converts a textual representation into a long
> and "p64" converts a long into a textual representation.
>
> Use a text editor to find the last reference to your missing
> object in the textual
> representation of your "Data.fs" (obtained by "fsdump").
> That's the last time, the object has been modified.
>
> Look at the next transaction record. It has a "tid" field.
> Note the "offset" for this transaction.
> Truncate your "Data.fs" to the given offset (in a copy, of course).
> Start Zope with the truncated "Data.fs".
> Your object should be there.
> Export it (you will get the state as it was at the time of the
> transaction where you have cut "Data.fs"; you may try to use
> later transaction, to be more up-to-date).
>
> Import the exported object into a Data.fs where you want to
> work with.
>
>
>
> Dieter
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>