[Setup] Re: Migration problem: 'Import Error: No module namedValidators'
alan runyan
alan at enfoldsystems.com
Mon Dec 19 16:35:33 UTC 2005
Thanks for the hint. Whew.. I got PloneShell running and it's
> fun indeed. I don't have any experience in using such a nice
> tool, but I managed to find out what's causing the trouble:
Great.
> Several instances of my derived ATContentTypes objects in the
> root throw the error when a function on them is called. A
> call of __dict__ reveals that they dont't contain anything.
> It just returns {}.
> Now, this only happened with some instances. Others, of the
> same type, are completely fine, both in the root and deeper
> in the site. It seems that the ones that are broken are the
> older ones.
> So, this means that they got mangled as soon as I opened the
> Data.fs with the new Products installed, right?
Empty {} in __dict__ means they could be ghosts. Read more about ZODB.
> So I deleted these objects on the old setup and then tried to
> run it with the new setup again. Worked! No more Import
> Errors!! The migration worked, too. But now, of course, there
> are a lot of other problems to address, because my Plone is
> somewhat heavily customized ;)
Well - best practices really say you should not rely on Plone Templates.
Atleast make a copy of them and be as protective as possible. Of course I
dont know your customizations. But in building large websites I would say
the best practice is creating two skins: admin skin and retail skin. Retail
skin should not depend on any plone functionality or if it does; you should
make copies and put them in your skin.
Main reason: Plone's skins change. Plone is an application/Product and to
be subjected to its UI enhancements in the future is not a great path to
choose, i.e. dont depend on the application in the future to remain the
same.
Alan
> Thanks a lot for your help!
>
> andré>
>
> alan at enfoldsystems.com wrote:
> > so i diagnosed an error like this recently with regards to exif in
> > ATPhoto or ATImage or whatever. Its rather difficult - if not
> > impossible to debug this w/o zopectl. I would download the
> PloneShell
> > from enfoldsystems.com website.
> >
> > I would read over the 'conversing with zope' article.
> basically what
> > you can do is use post-mortem debugging. zope will throw
> exception;
> > you get a python debugger:
> >
> > - then you step up the call stack finding where you actually ahve
> > your 'broken' object orthe object that is causign the problem.
> >
> > - poke the object and see what has a reference to Validators
> >
> > I would *imagine* your problem is something like you have a
> persistent
> > Validator in your databse; and validators shouldnt be
> persistent. It
> > would be nice to have objects in ZOpe that not possible to
> persist ;-)
> > like
> >
> > class Validator:
> > _p_never_persist = True
> >
> > this would tell the zodb that its impossible to persist a
> instance of
> > this type. and would throw a runtime error in zodb. but this isnt
> > the zodb list ;-)
> >
> > I would imagine its something in your own code base if you have
> > written anotehr product.
> >
> > alan
>
> _______________________________________________
> Setup mailing list
> Setup at lists.plone.org
> http://lists.plone.org/mailman/listinfo/setup
>
More information about the Setup
mailing list