Errors when migrating from Plone 2.5 to 3.0

24 views
Skip to first unread message

Maurits van Rees

unread,
Dec 7, 2007, 4:48:12 PM12/7/07
to Get Paid Devs
Hi,

I tried installing PloneGetPaid in 2.5, then migrating to 3.0. But
that gave me big problems. The Plone Site was totally unusable. And
I could not reach portal_migration or the quick_installer to improve
this. Errors were:

2007-12-07 21:22:16 WARNING OFS.Uninstalled Could not import class 'FiveActionsTool' from module 'Products.CMFonFive.fiveactionstool'
2007-12-07 21:22:16 WARNING OFS.Uninstalled Could not import class 'LocalSiteHook' from module 'Products.Five.site.localsite'
2007-12-07 21:22:22 ERROR ZPublisher BeforeTraverse: Error while invoking hook: "__local_site_hook__"
...
SystemError: This object was originally created by a product that
is no longer installed. It cannot be updated.
(<LocalSiteHook at broken>)


What I tried then was go back to Plone 2.5 (I had a separate instance
for testing) and uninstall CMFonFive. Then I copied the Data.fs again
to the 3.0 buildout and started that instance again. This removed the
warning about the fiveactionstool as this object was removed by
uninstalling CMFonFive.

But the warning and subsequent error about the LocalSiteHook did not
go away. I was conveniently thrown into a pdb so I could investigate
a bit:

(Pdb) container.__local_site_hook__
<LocalSiteHook at /test/broken>
(Pdb) container.__local_site_hook__.__class__
<class 'Products.Five.site.localsite.LocalSiteHook'>

And then I could solve it with this:

(Pdb) del container.__local_site_hook__
(Pdb) import transaction
(Pdb) transaction.commit()
(Pdb) c

Now the site works: I can go to portal_migration, etcetera. But this
is not something we want to tell our users to do. :)


The problem is started in PloneGetPaid/Extensions/install.py

from Products.Five.site.localsite import enableLocalSiteHook
...
def setup_site( self ):
portal = getToolByName( self, 'portal_url').getPortalObject()

if ISite.providedBy( portal ):
setSite( portal )
return
enableLocalSiteHook( portal )
setSite( portal )

The enableLocalSiteHook line enables a local site in a way that breaks
in Plone 3 as the LocalSite class in Five has been moved to a
different module, so the already added hook can no longer be found:
its class is gone. In the Plone 3 buildout (so made with "-c 30.cfg")
the parts/zope2/lib/python/Products/Five/site/localsite.py has some
hints, and especially doc/localsite.txt can be interesting. It says:

Migrating the actual sites
..........................

Go to the object of the site, and add "manage_site.html" to the URL
to open the old site management view. There you have a button
"Migrate to Five.component". Press it to migrate the site.

But in fact when loading the manage_site.html page I get those same
errors so I never reach the actual page. Hm, I can cheat by calling
it like this:
http://myplonesite/manage_site.html?UPDATE_MIGRATE=1

But that fails with this traceback:

Module Products.Five.site.browser, line 37, in update
Module Products.Five.site.browser, line 73, in migrateToFive15
Module Products.Five.site.browser, line 59, in unmakeSite
Module Products.Five.site.localsite, line 188, in disableLocalSiteHook
Module Products.Five.component, line 88, in disableSite
Module zope.interface.declarations, line 969, in noLongerProvides
ValueError: Can only remove directly provided interfaces.
> .../zope2/lib/python/zope/interface/declarations.py(969)noLongerProvides()
-> raise ValueError("Can only remove directly provided interfaces.")
(Pdb) a
object = <PloneSite at test>
interface = <InterfaceClass zope.app.component.interfaces.ISite>
(Pdb) interface
<InterfaceClass zope.app.component.interfaces.ISite>
(Pdb) interface.providedBy(object)
True

So ISite is expected to be an 'alsoProvides' here but it is not.
Something like that.


The way to solve this is probably to call
Products.Five.site.localsite.disableLocalSiteHook somewhere before
going to 3.0. Grrr, when doing this in a pdb on Plone 3 with that
hook still installed I get:

(Pdb) container
<PloneSite at /test>
(Pdb) from Products.Five.site.localsite import disableLocalSiteHook
(Pdb) disableLocalSiteHook(container)
*** ValueError: Can only remove directly provided interfaces.

That is the same as above. But on 2.5 it might work.

Well, these are some thoughts. I hope this post has enough clues for
someone else to suggest a proper way to solve this.

Now why am I looking at Kapil? ;-)

--
Maurits van Rees | http://maurits.vanrees.org/ [NL]
Work | http://zestsoftware.nl/
"I am trapped in a Klein Bottle and can't get in."

Maurits van Rees

unread,
Mar 1, 2008, 8:26:56 AM3/1/08
to Get Paid Devs, KEH...@sandia.gov
Hello Karl,

Please keep the discussion on the list. Much more chance of getting
an answer. But I will answer your question anyway. :)

On Fri, Feb 29, 2008 at 03:59:11PM -0800, KEH...@sandia.gov wrote:
> Maurits,
>
> I'm having the same problem with slightly different symptoms. As you were, I am upgrading from 2.5.5 to 3.0. I am seeing LocalSiteHook errors. When I remove CMFonFive, I can not even reach my Plone object. This is possibly due to some dependency with CMFNotification, Poi, or CalendarX, which are products my site uses.
>
> Adding CMFNotification lets me access my site, but the migration fails. Using manage_site.html?UPDATE_MIGRATE=1 also fails, as it did for you.
>
> I see that your post was dated a few weeks ago and I was hoping that someone has solved this problem since then. Can you point me in the direction of a solution?
>
> Thanks,
>
> Karl Horak

Okay, so this is about this issue:

http://groups.google.com/group/getpaid-dev/browse_thread/thread/eb7b681511667e42

I investigated a bit and I am closer to a solution now. When
migrating PloneGetPaid from Plone 2.5 to 3.0 you have to do two things
while you are still in Plone 2.5:

1. In the quick installer uninstall CMFonFive.

2. Go to http://<your plone site>/manage_site.html
Click on the "Unmake site" button.

This will fail with an error:

ComponentLookupError: (<InterfaceClass getpaid.core.interfaces.IShoppingCartUtility>, '')

This is because manage_site.html renders the Plone interface and
during that some lookups are done that now fail because we have just
unmaked the site. And at that point the unmaking is reversed so
nothing actually happens.

The best solution is to fix Five. You could do that yourself. Go to
parts/productdistros/Five/site/managesite.pt and remove the macro and
the div:

< <html metal:use-macro="context/@@standard_macros/view"
< i18n:domain="zope">
---
> <html i18n:domain="zope">
5d3
< <div metal:fill-slot="body">
22d19
< </div>

So the template should now look like this:

<tal:tag condition="view/update"/>
<html i18n:domain="zope">
<body>

<form action="." tal:attributes="action request/URL" method="POST"
enctype="multipart/form-data">
<div class="row">
<div class="controls">
<input type="submit" value="Make site" name="UPDATE_MAKESITE"
i18n:attributes="value"
tal:attributes="disabled view/isSite"/>
<input type="submit" value="Unmake site" name="UPDATE_UNMAKESITE"
i18n:attributes="value"
tal:attributes="disabled not:view/isSite"/>

</div>
</div>
</form>

</body>

</html>

Now visit manage_site.html again, click "Unmake site" and now it
works. Visiting your Plone Site will now fail with those same
component lookup errors, but that is okay as you are going to move to
Plone 3 right now and fix that.

I will see about reporting this to the developers of Five.


Now get Plone 3 (and a newer Zope) and put your Data.fs in it. If you
use the getpaid buildout it should be enough to stop your current 2.5
instance and do "bin/buildout -c 30.cfg". Now start your instance
again. Visiting your site should give errors as you have not run the
plone_migration yet. So:

1. Go to the ZMI. Since you clicked "Unmake site" in the second step
above you should be able to see it without errros. If you have
failed to uninstall CMFonFive you will see a broken
portal_fiveactions in your Plone site root.

2. Run the standard Plone migration in plone_migration.

3. When you now look to your home page you will get an error, probably
because that local site hook is now missing but maybe because of
other problems:

ComponentLookupError: (<InterfaceClass getpaid.core.interfaces.IShoppingCartUtility>, '')

4. So go to portal_quickinstaller and reinstall PloneGetPaid. But
this gives a new error:

...
Module Products.CMFQuickInstallerTool.InstalledProduct, line 282, in uninstall
Module Products.CMFQuickInstallerTool.InstalledProduct, line 305, in _cascadeRemove
ValueError: too many values to unpack
> /home/maurits/buildout/getpaid30/parts/plone/CMFQuickInstallerTool/InstalledProduct.py(305)_cascadeRemove()
-> for category, action in self.actions:
(Pdb) self
<InstalledProduct at /test/portal_quickinstaller/PloneGetPaid>
(Pdb) self.actions
['getpaid_make_buyable', 'getpaid_make_shippable', 'getpaid_make_donatable', 'getpaid_make_not_buyable', 'getpaid_make_not_shippable', 'getpaid_make_not_premium', 'getpaid_make_not_donatable', 'getpaid_manage_cart']

This could be a genuine error in the current PloneGetPaid code. At
least I also see failures in actions when running the PloneGetPaid
tests. So this may or may not have anything to do with migration. I
don't know. Solving this is left as an exercise to the reader. :)

--
Maurits van Rees | http://maurits.vanrees.org/

Kapil Thangavelu

unread,
Mar 2, 2008, 11:56:36 AM3/2/08
to getpa...@googlegroups.com
On Sat, Mar 1, 2008 at 8:26 AM, Maurits van Rees
<maurits...@gmail.com> wrote:
>
>
> Okay, so this is about this issue:
>
> http://groups.google.com/group/getpaid-dev/browse_thread/thread/eb7b681511667e42
>
> I investigated a bit and I am closer to a solution now. When
> migrating PloneGetPaid from Plone 2.5 to 3.0 you have to do two things
> while you are still in Plone 2.5:
>
> 1. In the quick installer uninstall CMFonFive.
>
> 2. Go to http://<your plone site>/manage_site.html
> Click on the "Unmake site" button.
>
> This will fail with an error:
>


> ComponentLookupError: (<InterfaceClass getpaid.core.interfaces.IShoppingCartUtility>, '')


we can fix this one pretty easily by registering a with the global
site, a session based shopping cart utility ( ie.. why what we used to
have by default).


<snip html munge fix>

>
> I will see about reporting this to the developers of Five.

i think its a pgp issue, we install actions that depends on the
installation of a local utility.

>
>
> Now get Plone 3 (and a newer Zope) and put your Data.fs in it. If you
> use the getpaid buildout it should be enough to stop your current 2.5
> instance and do "bin/buildout -c 30.cfg". Now start your instance
> again. Visiting your site should give errors as you have not run the
> plone_migration yet. So:
>
> 1. Go to the ZMI. Since you clicked "Unmake site" in the second step
> above you should be able to see it without errros. If you have
> failed to uninstall CMFonFive you will see a broken
> portal_fiveactions in your Plone site root.
>
> 2. Run the standard Plone migration in plone_migration.
>
> 3. When you now look to your home page you will get an error, probably
> because that local site hook is now missing but maybe because of
> other problems:
>
> ComponentLookupError: (<InterfaceClass getpaid.core.interfaces.IShoppingCartUtility>, '')

with a global shopping cart utility this will go away.

>
> 4. So go to portal_quickinstaller and reinstall PloneGetPaid. But
> this gives a new error:
>
> ...
> Module Products.CMFQuickInstallerTool.InstalledProduct, line 282, in uninstall
> Module Products.CMFQuickInstallerTool.InstalledProduct, line 305, in _cascadeRemove
> ValueError: too many values to unpack
> > /home/maurits/buildout/getpaid30/parts/plone/CMFQuickInstallerTool/InstalledProduct.py(305)_cascadeRemove()
> -> for category, action in self.actions:
> (Pdb) self
> <InstalledProduct at /test/portal_quickinstaller/PloneGetPaid>
> (Pdb) self.actions
> ['getpaid_make_buyable', 'getpaid_make_shippable', 'getpaid_make_donatable', 'getpaid_make_not_buyable', 'getpaid_make_not_shippable', 'getpaid_make_not_premium', 'getpaid_make_not_donatable', 'getpaid_manage_cart']
>
> This could be a genuine error in the current PloneGetPaid code. At
> least I also see failures in actions when running the PloneGetPaid
> tests. So this may or may not have anything to do with migration. I
> don't know. Solving this is left as an exercise to the reader. :)

actually that looks more like a bug/change in cmfquickinstaller tool..
its the one recording installed actions via delta diff of before /
after install into a persistent object thats tossing this error.

-kapil

Karl

unread,
Mar 3, 2008, 3:14:54 PM3/3/08
to getpaid-dev
Still no joy... In Plone 2.5.5 uninstalled CMFonFive, clicked on
"Unmake site," and so far all is well. But after moving over to
3.0.5, althought the site is visible in ZMI, migration fails. The
migration log follows:

Result of the attempt...

* Starting the migration from version: 2.5.5
* Attempting to upgrade from: 2.5.5
* Upgrade aborted
* Error type: exceptions.KeyError
* Error value: 'Products.CMFPlone:plone'
* File "C:\Program Files\Plone 3\Data\Products\CMFPlone
\MigrationTool.py", line 210, in upgrade newv, msgs =
self._upgrade(newv)
* File "C:\Program Files\Plone 3\Data\Products\CMFPlone
\MigrationTool.py", line 321, in _upgrade res =
function(self.aq_parent)
* File "C:\Program Files\Plone 3\Data\Products\CMFPlone\migrations
\v3_0\alphas.py", line 97, in three0_alpha1
updateImportStepsFromBaseProfile(portal, out)
* File "C:\Program Files\Plone 3\Data\Products\CMFPlone\migrations
\v3_0\alphas.py", line 1361, in updateImportStepsFromBaseProfile
tool.setBaselineContext("profile-Products.CMFPlone:plone")
* File "C:\Program Files\Plone 3\Data\Products\GenericSetup
\tool.py", line 225, in setBaselineContext
self.applyContextById(context_id, encoding)
* File "C:\Program Files\Plone 3\Data\Products\GenericSetup
\tool.py", line 230, in applyContextById context =
self._getImportContext(context_id)
* File "C:\Program Files\Plone 3\Data\Products\GenericSetup
\tool.py", line 893, in _getImportContext info =
_profile_registry.getProfileInfo(context_id)
* File "C:\Program Files\Plone 3\Data\Products\GenericSetup
\registry.py", line 584, in getProfileInfo result =
self._profile_info[ profile_id ]
* End of upgrade path, migration has finished
* The upgrade path did NOT reach current version
* Migration has failed

_________________________________

Meanwhile, the error.log is showing this when I attempt to view the
site:

------
2008-03-03T13:03:52 ERROR root Exception while rendering an error
message
Traceback (most recent call last):
File "C:\Program Files\Plone 3\Zope\lib\python\OFS\SimpleItem.py",
line 227, in raise_standardErrorMessage
v = s(**kwargs)
File "C:\Program Files\Plone 3\Data\Products\CMFCore
\FSPythonScript.py", line 140, in __call__
return Script.__call__(self, *args, **kw)
File "C:\Program Files\Plone 3\Zope\lib\python\Shared\DC\Scripts
\Bindings.py", line 313, in __call__
return self._bindAndExec(args, kw, None)
File "C:\Program Files\Plone 3\Zope\lib\python\Shared\DC\Scripts
\Bindings.py", line 350, in _bindAndExec
return self._exec(bound_data, args, kw)
File "C:\Program Files\Plone 3\Data\Products\CMFCore
\FSPythonScript.py", line 196, in _exec
result = f(*args, **kw)
File "Script (Python)", line 34, in standard_error_message
File "C:\Program Files\Plone 3\Zope\lib\python\Shared\DC\Scripts
\Bindings.py", line 313, in __call__
return self._bindAndExec(args, kw, None)
File "C:\Program Files\Plone 3\Zope\lib\python\Shared\DC\Scripts
\Bindings.py", line 350, in _bindAndExec
return self._exec(bound_data, args, kw)
File "C:\Program Files\Plone 3\Data\Products\CMFCore
\FSPageTemplate.py", line 216, in _exec
result = self.pt_render(extra_context=bound_names)
File "C:\Program Files\Plone 3\Data\Products\CMFCore
\FSPageTemplate.py", line 155, in pt_render
result = FSPageTemplate.inheritedAttribute('pt_render')(
File "C:\Program Files\Plone 3\Zope\lib\python\Products\PageTemplates
\PageTemplate.py", line 89, in pt_render
return super(PageTemplate, self).pt_render(c, source=source)
File "C:\Program Files\Plone 3\Zope\lib\python\zope\pagetemplate
\pagetemplate.py", line 117, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "C:\Program Files\Plone 3\Zope\lib\python\zope\tal
\talinterpreter.py", line 271, in __call__
self.interpret(self.program)
File "C:\Program Files\Plone 3\Zope\lib\python\zope\tal
\talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "C:\Program Files\Plone 3\Zope\lib\python\zope\tal
\talinterpreter.py", line 870, in do_useMacro
macro = self.engine.evaluateMacro(macroExpr)
File "C:\Program Files\Plone 3\Zope\lib\python\zope\tales\tales.py",
line 696, in evaluate
return expression(self)
File "C:\Program Files\Plone 3\Zope\lib\python\zope\tales
\expressions.py", line 217, in __call__
return self._eval(econtext)
File "C:\Program Files\Plone 3\Zope\lib\python\Products\PageTemplates
\Expressions.py", line 153, in _eval
ob = self._subexprs[-1](econtext)
File "C:\Program Files\Plone 3\Zope\lib\python\zope\tales
\expressions.py", line 124, in _eval
ob = self._traverser(ob, element, econtext)
File "C:\Program Files\Plone 3\Zope\lib\python\Products\PageTemplates
\Expressions.py", line 83, in boboAwareZopeTraverse
request=request)
File "C:\Program Files\Plone 3\Zope\lib\python\zope\traversing
\adapters.py", line 161, in traversePathElement
raise TraversalError('No traversable adapter found', obj)
[There follows a very long dump of the traversable object--keh]
_________________________________

And the QuickInstaller fails with this:

------
2008-03-03T12:50:12 ERROR Zope.SiteErrorLog
http://localhost:8080/5700/portal_quickinstaller/manage_installProductsForm
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
Module Products.PageTemplates.PageTemplate, line 89, in pt_render
Module zope.pagetemplate.pagetemplate, line 117, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 534, in do_optTag_tal
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 534, in do_optTag_tal
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 824, in do_loop_tal
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 379, in do_startEndTag
Module zope.tal.talinterpreter, line 408, in do_startTag
Module zope.tal.talinterpreter, line 485, in attrAction_tal
Module Products.PageTemplates.Expressions, line 228, in evaluateText
Module zope.tales.tales, line 696, in evaluate
- URL: manage_installProductsForm
- Line 34, Column 12
- Expression: <PathExpr standard:'product/id'>
- Names:
{'container': <QuickInstallerTool at /5700/
portal_quickinstaller>,
'context': <QuickInstallerTool at /5700/portal_quickinstaller>,
'default': <object object at 0x0071C528>,
'here': <QuickInstallerTool at /5700/portal_quickinstaller>,
'loop': {'product':
<Products.PageTemplates.Expressions.PathIterator object at
0x060BAAB0>},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping
object at 0x027CF0A8>,
'request': <HTTPRequest, URL=http://localhost:8080/5700/
portal_quickinstaller/manage_installProductsForm>,
'root': <Application at >,
'template': <PageTemplateFile at /5700/portal_quickinstaller/
manage_installProductsForm>,
'user': <User 'zopemaster'>}
Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 153, in _eval
Module zope.tales.expressions, line 124, in _eval
Module Products.PageTemplates.Expressions, line 83, in
boboAwareZopeTraverse
Module zope.traversing.adapters, line 161, in traversePathElement
- __traceback_info__: ({'status': 'uninstalled', 'hasError': 0,
'id': 'CMFonFive', 'title': 'CMFonFive'}, 'id')
TraversalError: ('No traversable adapter found', {'status':
'uninstalled', 'hasError': 0, 'id': 'CMFonFive', 'title':
'CMFonFive'})
[There follows a very long dump of the traversable object--keh]
_________________________________

This appears to be more than a PloneGetPaid problem (it was the
local_site_hook error that got me involved with this list). Perhaps
this should be cross-posted to one of the general discussions over on
Nabble.

Thanks,

Karl


On Mar 1, 6:26 am, Maurits van Rees <maurits.vanr...@gmail.com> wrote:
> Hello Karl,
>
> Please keep the discussion on the list. Much more chance of getting
> an answer. But I will answer your question anyway. :)
>
> On Fri, Feb 29, 2008 at 03:59:11PM -0800, KEHO...@sandia.gov wrote:
> > Maurits,
>
> > I'm having the same problem with slightly different symptoms. As you were, I am upgrading from 2.5.5 to 3.0. I am seeing LocalSiteHook errors. When I remove CMFonFive, I can not even reach my Plone object. This is possibly due to some dependency with CMFNotification, Poi, or CalendarX, which are products my site uses.
>
> > Adding CMFNotification lets me access my site, but the migration fails. Using manage_site.html?UPDATE_MIGRATE=1 also fails, as it did for you.
>
> > I see that your post was dated a few weeks ago and I was hoping that someone has solved this problem since then. Can you point me in the direction of a solution?
>
> > Thanks,
>
> > Karl Horak
>
> Okay, so this is about this issue:
>
> http://groups.google.com/group/getpaid-dev/browse_thread/thread/eb7b6...
>
> I investigated a bit and I am closer to a solution now. When
> migrating PloneGetPaid from Plone 2.5 to 3.0 you have to do two things
> while you are still in Plone 2.5:
>
> 1. In the quick installer uninstall CMFonFive.
>
> 2. Go to http://<your plone site>/manage_site.html
> Click on the "Unmake site" button.
>
>
> Now visit manage_site.html again, click "Unmake site" and now it
> works. Visiting your Plone Site will now fail with those same
> component lookup errors, but that is okay as you are going to move to
> Plone 3 right now and fix that.
>
> I will see about reporting this to the developers of Five.
>
> Now get Plone 3 (and a newer Zope) and put your Data.fs in it. If you
> use the getpaid buildout it should be enough to stop your current 2.5
> instance and do "bin/buildout -c 30.cfg". Now start your instance
> again. Visiting your site should give errors as you have not run the
> plone_migration yet. So:
>
> 1. Go to the ZMI. Since you clicked "Unmake site" in the second step
> above you should be able to see it without errros. If you have
> failed to uninstall CMFonFive you will see a broken
> portal_fiveactions in your Plone site root.
>
> 2. Run the standard Plone migration in plone_migration.
>
> 3. When you now look to your home page you will get an error, probably
> because that local site hook is now missing but maybe because of
> other problems...
Reply all
Reply to author
Forward
0 new messages