[Zope] (Database Recovery) Help: Weird KeyError with 2.2.0a1

Pete Kazmier pete@kazmier.com
Wed, 7 Jun 2000 07:23:27 -0400


Is there any way to salvage any of my database?  I created a very cool
ZClass and I really don't want to start over from scratch.  Like I
said, I'm very new to Zope, but I did notice that I could just do a
'strings Data.fs' and pull out most of my custom DTML, but I was
hoping there would be an easier way.

It seems that most of the database is intact.  Does anyone have any
ideas?  Also, to help prevent this in the future, if I periodically
copy my Data.fs, what happens if I'm copying the database while Zope
is writing to it, will my copy not suffice as a recoverable database
in the event the database gets corrupted?

Thanks in advance,
Pete

On Tue, Jun 06, 2000 at 10:59:07PM +0100, Phil  Harris wrote:
> Pete,
> 
> This doesn't really fix the underlying problem, but if you'd like to carry
> on working with Zope you can rename the file <zopedir>/var/Data.fs and Zope
> will recreate a new (good) Data.fs for you.
> 
> hth
> 
> phil
> phil.harris@zope.co.uk
> 
> ----- Original Message -----
> From: "Pete Kazmier" <pete@kazmier.com>
> To: <zope@zope.org>
> Sent: 06 June 2000 22:41
> Subject: [Zope] Help: Weird KeyError with 2.2.0a1
> 
> 
> > Hi,
> >
> > I was playing around with 2.2.0a1 and I've stumbled upon a corrupted
> > database I think.  I'm new so please bare with me.  I was hoping
> > someone could help me recover.  Everytime I start Zope, I get the
> > following error:
> >
> > 2000-06-06T21:20:50 ERROR(200) ZODB Couldn't load state for
> > '\000\000\000\000\000\000\000\006'
> > Traceback (innermost last):
> >   File /home/zope/lib/python/ZODB/Connection.py, line 421, in setstate
> >   File /home/zope/lib/python/ZODB/FileStorage.py, line 584, in load
> >     (Object: /home/zope/var/Data.fs)
> >   File /home/zope/lib/python/ZODB/FileStorage.py, line 560, in _load
> >     (Object: /home/zope/var/Data.fs)
> > KeyError:
> >
> > Traceback (innermost last):
> >   File "/home/zope/z2.py", line 547, in ?
> >     exec "import "+MODULE in {}
> >   File "<string>", line 1, in ?
> >   File "/home/zope/lib/python/Zope/__init__.py", line 144, in ?
> >     OFS.Application.initialize(c)
> >   File "/home/zope/lib/python/OFS/Application.py", line 308, in
> >   initialize
> >     app.Control_Panel.initialize_cache()
> >   File "/home/zope/lib/python/ZODB/Connection.py", line 421, in
> >   setstate
> >     p, serial = self._storage.load(oid, self._version)
> >   File "/home/zope/lib/python/ZODB/FileStorage.py", line 584, in load
> >     try: return self._load(oid, version, self._index, self._file)
> >   File "/home/zope/lib/python/ZODB/FileStorage.py", line 560, in _load
> >     pos=_index[oid]
> > KeyError:
> >
> > Please tell me that I am not screwed.  Right before this problem
> > occurred, I had packed my database, but things were working ok
> > immediately following that, then a few moments later, I kept getting
> > errors, so I stopped the Zope processes and restarted.
> >
> > Could someone please point me in the right direction?  I wasn't sure
> > if I was supposed to post this to the dev list since I'm using an
> > alpha, but I'm hoping those people read this too.
> >
> > Thanks,
> > Pete
> >
> > --
> > Peter Kazmier                                 http://www.kazmier.com
> > PGP Fingerprint   4FE7 8DA3 D0B5 9CAA 69DC  7243 1855 BC2E 4B43 5654
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> 

-- 
Peter Kazmier                                 http://www.kazmier.com
PGP Fingerprint   4FE7 8DA3 D0B5 9CAA 69DC  7243 1855 BC2E 4B43 5654