Re: [Zope-dev] POSKeyError how to remove

2009-07-23 Thread Jim Fulton
The object is already gone. It's odd that it is in the index.
You can try deleting the object from the index and then saving the
index.  You might need to use ZODB 3.9 to do that, as I think __del__
was only recently added to file-storage indexes.

Jim

On Thu, Jul 23, 2009 at 6:57 AM, Rupesh P Rajroopesh.p...@gmail.com wrote:
 Hi,

 Using Zope Debug Console, I used a part of the code fsrefs.py to find the
 oid's of POSKeyError:

     fs = FileStorage(path, read_only=1)
     undone = {}

     noload = {}

     for oid in fs._index.keys():
     try:
     data, serial = fs.load(oid, )
     except (KeyboardInterrupt, SystemExit):
     raise
     except POSKeyError:
     undone[oid] = 1
     except:
     if VERBOSE:
     traceback.print_exc()
     noload[oid] = 1

 This gave me one oid.Then I tried something like below :

 obj = app._p_jar[oid]

 But this gave me another POSKeyError instead :(

 Why does this happen? How can I delete this object.

 Thanks,
 Roopesh
 ___
 Zope-Dev maillist  -  zope-...@zope.org
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )





-- 
Jim Fulton
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] POSKeyError how to remove

2009-07-23 Thread Rupesh P Raj
Hi Jim,

But I am using ZODB 3.4.4 :( Are there any other options? How can I find
where this invalid object is being referenced?

Will something like packing resolve this?

Thanks,
Roopesh


On Thu, Jul 23, 2009 at 4:45 PM, Jim Fulton j...@zope.com wrote:

 The object is already gone. It's odd that it is in the index.
 You can try deleting the object from the index and then saving the
 index.  You might need to use ZODB 3.9 to do that, as I think __del__
 was only recently added to file-storage indexes.

 Jim

 On Thu, Jul 23, 2009 at 6:57 AM, Rupesh P Rajroopesh.p...@gmail.com
 wrote:
  Hi,
 
  Using Zope Debug Console, I used a part of the code fsrefs.py to find the
  oid's of POSKeyError:
 
  fs = FileStorage(path, read_only=1)
  undone = {}
 
  noload = {}
 
  for oid in fs._index.keys():
  try:
  data, serial = fs.load(oid, )
  except (KeyboardInterrupt, SystemExit):
  raise
  except POSKeyError:
  undone[oid] = 1
  except:
  if VERBOSE:
  traceback.print_exc()
  noload[oid] = 1
 
  This gave me one oid.Then I tried something like below :
 
  obj = app._p_jar[oid]
 
  But this gave me another POSKeyError instead :(
 
  Why does this happen? How can I delete this object.
 
  Thanks,
  Roopesh
  ___
  Zope-Dev maillist  -  Zope-Dev@zope.org
  http://mail.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope )
 
 



 --
 Jim Fulton

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] POSKeyError how to remove

2009-07-23 Thread Andreas Jung
http://spamsch.blogspot.com/2009/04/how-to-repair-broken-zodb-poskeyerror.html

-aj

On 23.07.09 12:57, Rupesh P Raj wrote:
 Hi,

 Using Zope Debug Console, I used a part of the code fsrefs.py to find
 the oid's of POSKeyError:

 fs = FileStorage(path, read_only=1)
 undone = {}

 noload = {}

 for oid in fs._index.keys():
 try:
 data, serial = fs.load(oid, )
 except (KeyboardInterrupt, SystemExit):
 raise
 except POSKeyError:
 undone[oid] = 1
 except:
 if VERBOSE:
 traceback.print_exc()
 noload[oid] = 1

 This gave me one oid.Then I tried something like below :

 obj = app._p_jar[oid]

 But this gave me another POSKeyError instead :(

 Why does this happen? How can I delete this object.

 Thanks,
 Roopesh
 

 ___
 Zope-Dev maillist  -  Zope-Dev@zope.org
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )
   


-- 
ZOPYX Ltd.  Co KG  \  ZOPYX  Friends
Charlottenstr. 37/1  \  The experts for your Python, Zope and
D-72070 Tübingen  \  Plone projects
www.zopyx.com, i...@zopyx.com  \  www.zopyx.de/friends, frie...@zopyx.de

E-Publishing, Python, Zope  Plone development, Consulting


begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd.  Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:i...@zopyx.com
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )