[Zope] Data.fs gone crazy

Steve Spicklemire steve@spvi.com
Sat, 11 Aug 2001 00:11:28 -0500


Hi Tom,

	I just constructed this scenario:

1) Install a Python Product that is a base class for some ZClasses.

2) Install some ZClasses that inherit from the Python Product class

3) Delete the Python Product and the ZClasses

You may now have (I did) some "ghost" zclass entries in the Product
registry. The only way I found to get rid of them was to run the code
below. (stop Zope, cd to 'lib/python',  execute fixit.py from the
command line.) You might try running it a few times with the last two
lines commented out to make sure your only removing the zclasses you
mean to. You might also make a backup of your Data.fs before you do
anything else. I have no idea if this has any other nasty side effects,
but it worked for me.

Good Luck!
-steve

fixit.py:

import Zope

x = Zope.app(  )

theList = list( x._getProductRegistryData('zclasses'))

newList = []
for d in theList:
    if d['id'] == 'the name of your zclass':
        print "Skipping  .. ", d
    else:
        newList.append(d)

print newList

x._setProductRegistryData( 'zclasses', tuple(newList ))

get_transaction().commit()



Tom Cameron wrote:
> 
> Steve,
> I am certain there are no instances. What do you mean by "registered with
> the system". How do you "unregister" it? BTW, POPMailBase is a Python
> Product. I have deleted it from the Products directory and restarted Zope.
> What more should I do?
> 
> Tom
> 
> => -----Original Message-----
> => From: Steve Spicklemire [mailto:steve@spvi.com]
> => Sent: Friday, 10 August 2001 11:06 PM
> => To: tom@mooball.com; Sebastien Bigaret
> => Cc: Steve Spicklemire; zope@zope.org
> => Subject: Re: [Zope] Data.fs gone crazy
> =>
> =>
> => Hi Tom,
> =>
> => I think the clue is here. The ZClass that went with POPMailBase is still
> => registered with the system, and (maybe?) there are some instances
> => around? Or maybe the ZClass just needs to get "unregistered". Have you
> => checked for abandoned instances of the POPMail product?
> =>
> => -steve
> =>
> =>
> => On Friday, August 10, 2001, at 06:01 AM, Sebastien Bigaret wrote:
> => >>   File D:\Zope\23229D~1.3\lib\python\Shared\DC\ZRDB\DA.py,
> => line 544, in
> => >> manage_product_zclass_info
> => >>     (Object: insertintolists)
> => >>   File D:\Zope\23229D~1.3\lib\python\ZODB\Connection.py, line 533, in
> => >> setstate
> => >> ImportError: (see above)
> => >>
> => >> POPMailBase is a completely different Product that I removed a few
> => >> days ago.
> => >> How could the two be related and how do I fix this mess?
> => >>
> => >> My Database connection keeps dying now and I cant seem to get it to
> => >> work
> => >> anymore.
> => >>
> => >> This is a Windows 2000 machine zope 2.3.2
> => >>
> => >> Tom
> => >
> => >
> => > _______________________________________________
> => > 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 )
> =>