Re: [Zope] CorruptedDataError: How to fix a corrupted

2008-08-02 Thread Dieter Maurer
Remy Pinsonnault wrote at 2008-7-31 15:48 -0500:
>For an unknown reason, it seems our data.fs got corrupted last night. In the
>event.log I can see the following:
>--
>2008-07-30T22:51:59 ERROR ZODB.Connection Couldn't load state for 0x086540
>Traceback (most recent call last):
>  File "C:\PloneExt\Zope\lib\python\ZODB\Connection.py", line 704, in
>setstate
>self._setstate(obj)
>  File "C:\PloneExt\Zope\lib\python\ZODB\Connection.py", line 740, in
>_setstate
>p, serial = self._storage.load(obj._p_oid, self._version)
>  File "C:\PloneExt\Zope\lib\python\ZODB\FileStorage\FileStorage.py", line
>549, in load
>h = self._read_data_header(pos, oid)
>  File "C:\PloneExt\Zope\lib\python\ZODB\FileStorage\format.py", line 193,
>in _read_data_header
>raise CorruptedDataError(oid, s, pos)
>CorruptedDataError: Error reading oid 0x086540.  Found
>'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>at 10020462

This almost surely indicates some problem with you hardware.
Check it, be even more careful with backups, maybe replace doubtful
components.

"fsrecover" may help you to recover most of the data in
your current storage file (unless your backup is not already
sufficiently good to continue from this).



-- 
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 )


Re: [Zope] CorruptedDataError: How to fix a corrupted

2008-08-01 Thread Martijn Pieters
On Fri, Aug 1, 2008 at 7:01 PM, Remy Pinsonnault
<[EMAIL PROTECTED]> wrote:
> I tried fsdump but it did not work I got a FileStorageFormatError...

You only get that error if a) the first four bytes of the file are not
'FS21', or b) the file is smaller than 4 bytes. Are you sure you were
trying this on the corrupted Data.fs? If so, you may have a bigger
problem on your hands.

> Is there any other way I can obtain the needed paramater (position) for the
> truncate function where the CorruptedDataError occured?

The exception included the position: 10020462. I just advised you to
double-check it.

> Another question, is there a way of extracting all data or transaction
> between two dates?

Take a look at what fsdump.py does, it uses a FileIterator to list all
transactions in the Data.fs. The returned objects (RecordIterators)
represent the transactions and you can iterate over these to pull out
all data associated with the transaction. Each transaction id is based
on the timestamp (use ZODB.TimeStamp.TimeStamp to decode it) so it
should be but a small job to extract everything between two given
dates.

See the sourcecode for fsdump.py and FileStorage.py in ZODB/FileStorage.

-- 
Martijn Pieters
___
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 )


Re: [Zope] CorruptedDataError: How to fix a corrupted

2008-08-01 Thread Remy Pinsonnault
Thanks Martijn for your answer.

I tried fsdump but it did not work I got a FileStorageFormatError...

Is there any other way I can obtain the needed paramater (position) for the
truncate function where the CorruptedDataError occured?

Another question, is there a way of extracting all data or transaction
between two dates?

On Thu, Jul 31, 2008 at 4:21 PM, Martijn Pieters <[EMAIL PROTECTED]> wrote:

> On Thu, Jul 31, 2008 at 10:48 PM, Remy Pinsonnault
> <[EMAIL PROTECTED]> wrote:
> > For an unknown reason, it seems our data.fs got corrupted last night. In
> the
> > event.log I can see the following:
>
> > CorruptedDataError: Error reading oid 0x086540.  Found
> >
> '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
> > at 10020462
>
> You have 2 pieces of info there, the oid and the file position. You
> could use fsdump to verify the oid and position, then truncate the
> file at that position. Short recipe (may be outdated a bit) of the
> procedure:
>
>  http://kelpi.com/script/018315
>
> I certainly have performed truncations like that in the past.
>
> --
> Martijn Pieters
>
___
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 )


Re: [Zope] CorruptedDataError: How to fix a corrupted

2008-07-31 Thread Martijn Pieters
On Thu, Jul 31, 2008 at 10:48 PM, Remy Pinsonnault
<[EMAIL PROTECTED]> wrote:
> For an unknown reason, it seems our data.fs got corrupted last night. In the
> event.log I can see the following:

> CorruptedDataError: Error reading oid 0x086540.  Found
> '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
> at 10020462

You have 2 pieces of info there, the oid and the file position. You
could use fsdump to verify the oid and position, then truncate the
file at that position. Short recipe (may be outdated a bit) of the
procedure:

  http://kelpi.com/script/018315

I certainly have performed truncations like that in the past.

-- 
Martijn Pieters
___
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 )