Re: [ZODB-Dev] zeopack error in zrpc.connection

2013-01-07 Thread Jim Fulton
On Mon, Jan 7, 2013 at 1:20 PM, Claudiu Saftoiu  wrote:
>> > I'm afraid this doesn't seem to help me figure out what's wrong...
>>
>> I suspect your database is corrupted.  You'd probably want to look at
>> the record in question to be sure.
>
>
> Sure, I've re-run the pack and will dump the pickled object to a file to
> inspect it - is that what you meant? (How else would I figure out what the
> record is?)

Yes.  Exactly how you do this depends on your level of expertise, I'm afraid.
Also, knowing the position in the file where this record is stored.

>
>>
>> You could disable garbage collection, but if you have a damaged
>> record, you might want to use the previous version of the record
>> (if it exists) to recover it.
>
>
> What do you mean by disable garbage collection - you mean disable removing
> old versions of records that are no longer used? I can't do that
> unfortunately, the database gets too large.

Packing involves 2 operations:

- Removing old versions of objects.

- Garbage collection: removing objects that are no-longer reachable
from the root.
  Garbage collection requires un-pickling database records.

  You can disable garbage collection by including:

 pack-gc false

  in your filestorage tag in your zeo.conf file.

  This would allow the pack to proceed, and probably free up lots of
  space, but would remove old object versions that you might
  wish you had to recover a damaged record.

> How would I go about attempting to find the previous version of the record?

File-storage database records have a previous-record field
that gives the file position of the previous version of an object, if any.

> If I know what the record is I can just decide whether to let it be lost -
> would catching the TypeError and 'pass'ing accomplish that?

That's probably not the only error that can be raised.  Also, if the
damaged record held the only references to lots of other objects,
you'd potentially lose more objects through garbage collection.

The first step is to find out if the record is really damaged.

Maybe make a back up of your database if you can and then
pack without garbage collection to free up space while you
figure out what's wrong with your data.

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm
___
For more information about ZODB, see http://zodb.org/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] zeopack error in zrpc.connection

2013-01-07 Thread Claudiu Saftoiu
>
> > I'm afraid this doesn't seem to help me figure out what's wrong...
>
> I suspect your database is corrupted.  You'd probably want to look at
> the record in question to be sure.
>

Sure, I've re-run the pack and will dump the pickled object to a file to
inspect it - is that what you meant? (How else would I figure out what the
record is?)


> You could disable garbage collection, but if you have a damaged
> record, you might want to use the previous version of the record
> (if it exists) to recover it.
>

What do you mean by disable garbage collection - you mean disable removing
old versions of records that are no longer used? I can't do that
unfortunately, the database gets too large.

How would I go about attempting to find the previous version of the record?
If I know what the record is I can just decide whether to let it be lost -
would catching the TypeError and 'pass'ing accomplish that?

Thanks,
- Claudiu
___
For more information about ZODB, see http://zodb.org/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] zeopack error in zrpc.connection

2013-01-07 Thread Jim Fulton
On Mon, Jan 7, 2013 at 1:04 PM, Claudiu Saftoiu  wrote:
>
>> How do I go about fixing this? Let me know if I can provide any other
>> information that would be helpful.
>
>
> I took the advice in this thread:
> https://mail.zope.org/pipermail/zodb-dev/2012-January/014526.html
>
> The exception that comes up, from the zeo server log, is:
>
> 2013-01-07T13:01:49 ERROR ZEO.zrpc (14891) Error raised in delayed method
> Traceback (most recent call last):
>   File "/home/tsa/env/lib/python2.6/site-packages/ZEO/StorageServer.py",
> line 1377, in run
> result = self._method(*self._args)
>   File "/home/tsa/env/lib/python2.6/site-packages/ZEO/StorageServer.py",
> line 343, in _pack_impl
> self.storage.pack(time, referencesf)
>   File "/home/tsa/env/lib/python2.6/site-packages/ZODB/blob.py", line 796,
> in pack
> result = unproxied.pack(packtime, referencesf)
>   File
> "/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/FileStorage.py",
> line 1078, in pack
> pack_result = self.packer(self, referencesf, stop, gc)
>   File
> "/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/FileStorage.py",
> line 1034, in packer
> opos = p.pack()
>   File
> "/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/fspack.py", line
> 397, in pack
> self.gc.findReachable()
>   File
> "/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/fspack.py", line
> 190, in findReachable
> self.findReachableAtPacktime([z64])
>   File
> "/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/fspack.py", line
> 275, in findReachableAtPacktime
> for oid in self.findrefs(pos):
>   File
> "/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/fspack.py", line
> 328, in findrefs
> return self.referencesf(self._file.read(dh.plen))
>   File "/home/tsa/env/lib/python2.6/site-packages/ZODB/serialize.py", line
> 630, in referencesf
> u.noload()
> TypeError: 'NoneType' object does not support item assignment
>
>
> I'm afraid this doesn't seem to help me figure out what's wrong...

I suspect your database is corrupted.  You'd probably want to look at
the record in question to be sure.

You could disable garbage collection, but if you have a damaged
record, you might want to use the previous version of the record
(if it exists) to recover it.

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm
___
For more information about ZODB, see http://zodb.org/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] zeopack error in zrpc.connection

2013-01-07 Thread Claudiu Saftoiu
> How do I go about fixing this? Let me know if I can provide any other
> information that would be helpful.
>

I took the advice in this thread:
https://mail.zope.org/pipermail/zodb-dev/2012-January/014526.html

The exception that comes up, from the zeo server log, is:

2013-01-07T13:01:49 ERROR ZEO.zrpc (14891) Error raised in delayed method
Traceback (most recent call last):
  File "/home/tsa/env/lib/python2.6/site-packages/ZEO/StorageServer.py",
line 1377, in run
result = self._method(*self._args)
  File "/home/tsa/env/lib/python2.6/site-packages/ZEO/StorageServer.py",
line 343, in _pack_impl
self.storage.pack(time, referencesf)
  File "/home/tsa/env/lib/python2.6/site-packages/ZODB/blob.py", line 796,
in pack
result = unproxied.pack(packtime, referencesf)
  File
"/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/FileStorage.py",
line 1078, in pack
pack_result = self.packer(self, referencesf, stop, gc)
  File
"/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/FileStorage.py",
line 1034, in packer
opos = p.pack()
  File
"/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/fspack.py",
line 397, in pack
self.gc.findReachable()
  File
"/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/fspack.py",
line 190, in findReachable
self.findReachableAtPacktime([z64])
  File
"/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/fspack.py",
line 275, in findReachableAtPacktime
for oid in self.findrefs(pos):
  File
"/home/tsa/env/lib/python2.6/site-packages/ZODB/FileStorage/fspack.py",
line 328, in findrefs
return self.referencesf(self._file.read(dh.plen))
  File "/home/tsa/env/lib/python2.6/site-packages/ZODB/serialize.py", line
630, in referencesf
u.noload()
TypeError: 'NoneType' object does not support item assignment


I'm afraid this doesn't seem to help me figure out what's wrong...

- Claudiu
___
For more information about ZODB, see http://zodb.org/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] zeopack error in zrpc.connection

2013-01-07 Thread Claudiu Saftoiu
I noticed my DB had swelled to 132 gigabytes (as of 3 days ago; it's 160
gigabytes today) and it seems to be because zeopack has started failing:

tsa@sp2772c:~/db$ /home/tsa/env/bin/zeopack -u /home/tsa/db/zeo.sock
Traceback (most recent call last):
  File "/home/tsa/env/lib/python2.6/site-packages/ZEO/scripts/zeopack.py",
line 159, in _main
cs.pack(packt, wait=True)
  File "/home/tsa/env/lib/python2.6/site-packages/ZEO/ClientStorage.py",
line 916, in pack
return self._server.pack(t, wait)
  File "/home/tsa/env/lib/python2.6/site-packages/ZEO/ServerStub.py", line
155, in pack
self.rpc.call('pack', t, wait)
  File "/home/tsa/env/lib/python2.6/site-packages/ZEO/zrpc/connection.py",
line 730, in call
raise inst # error raised by server
TypeError: 'NoneType' object does not support item assignment
Error:
Error packing storage 1 in '/home/tsa/db/zeo.sock'


The runzeo log is:

2013-01-07T11:29:11 INFO ZEO.StorageServer new connection :

--
2013-01-07T11:29:11 INFO ZEO.zrpc.Connection(S) () received handshake
'Z3101'
--
2013-01-07T11:29:11 INFO ZEO.StorageServer pack(time=1357576151.4019079)
started...
--
2013-01-07T11:55:37 ERROR ZEO.zrpc (8174) Error raised in delayed method
None
--
2013-01-07T11:55:37 INFO ZEO.StorageServer disconnected


The zeo.conf is:

%define INSTANCE .


  address $INSTANCE/zeo.sock
  read-only false
  invalidation-queue-size 100
  pid-filename $INSTANCE/zeo.pid



  
path $INSTANCE/Data.fs
  
  blob-dir $INSTANCE/blobs



I tried shutting down the server that uses the database and re-running
zeopack, but the same thing happened.

I also tried re-starting 'runzeo' and re-running the pack (with the server
still off), and the same thing happened yet again.

How do I go about fixing this? Let me know if I can provide any other
information that would be helpful.

Thanks in advance,
- Claudiu
___
For more information about ZODB, see http://zodb.org/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev