[MGNLPUR-124] Upgrade to 5.2.2 fails due to exception during install of PUR module Created: 07/Feb/14  Updated: 11/Nov/16  Resolved: 07/Feb/14

Status: Closed
Project: Magnolia Public User Registration
Component/s: management
Affects Version/s: 2.2.2
Fix Version/s: 2.2.3

Type: Bug Priority: Blocker
Reporter: Richard Unger Assignee: Roman Kovařík
Resolution: Fixed Votes: 1
Labels: maintenance, pur, support, upgrade
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Installer fails on update from 5.2.1 to 5.2.2:

Magnolia Public User Registration Module (version 2.2.2)
Error while installing or updating public-user-registration module. Task 'Remove empty tree node' failed. (PathNotFoundException: /modules/public-user-registration/trees)
General messages
Could not perform installation: javax.jcr.PathNotFoundException: /modules/public-user-registration/trees

The exception is:

2014-02-07 12:27:57,171 ERROR info.magnolia.module.InstallContextImpl : > Could not perform installation: javax.jcr.PathNotFoundException: /modules/public-user-registration/trees
java.lang.RuntimeException: javax.jcr.PathNotFoundException: /modules/public-user-registration/trees
at info.magnolia.module.delta.ChildrenExistsDelegateTask.condition(ChildrenExistsDelegateTask.java:75)
at info.magnolia.module.delta.ConditionalDelegateTask.execute(ConditionalDelegateTask.java:59)
at info.magnolia.module.ModuleManagerImpl.applyDeltas(ModuleManagerImpl.java:509)
at info.magnolia.module.ModuleManagerImpl.installOrUpdateModule(ModuleManagerImpl.java:491)
at info.magnolia.module.ModuleManagerImpl$1.doExec(ModuleManagerImpl.java:274)
at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:414)
at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:411)
at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:385)
at info.magnolia.module.ModuleManagerImpl.performInstallOrUpdate(ModuleManagerImpl.java:268)
at info.magnolia.module.ui.ModuleManagerWebUI$2.run(ModuleManagerWebUI.java:124)
at java.lang.Thread.run(Thread.java:744)
Caused by: javax.jcr.PathNotFoundException: /modules/public-user-registration/trees
at org.apache.jackrabbit.core.ItemManager.getNode(ItemManager.java:577)
at org.apache.jackrabbit.core.session.SessionItemOperation$6.perform(SessionItemOperation.java:129)
at org.apache.jackrabbit.core.session.SessionItemOperation$6.perform(SessionItemOperation.java:125)
at org.apache.jackrabbit.core.session.SessionItemOperation.perform(SessionItemOperation.java:187)
at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
at org.apache.jackrabbit.core.SessionImpl.perform(SessionImpl.java:361)
at org.apache.jackrabbit.core.SessionImpl.getNode(SessionImpl.java:1111)
at info.magnolia.jcr.wrapper.DelegateSessionWrapper.getNode(DelegateSessionWrapper.java:177)
at info.magnolia.jcr.wrapper.DelegateSessionWrapper.getNode(DelegateSessionWrapper.java:177)
at info.magnolia.jcr.decoration.ContentDecoratorSessionWrapper.getNode(ContentDecoratorSessionWrapper.java:120)
at info.magnolia.jcr.wrapper.DelegateSessionWrapper.getNode(DelegateSessionWrapper.java:177)
at info.magnolia.jcr.wrapper.NodeWrappingDelegateSessionWrapper.getNode(NodeWrappingDelegateSessionWrapper.java:53)
at info.magnolia.jcr.wrapper.DelegateSessionWrapper.getNode(DelegateSessionWrapper.java:177)
at info.magnolia.jcr.decoration.ContentDecoratorSessionWrapper.getNode(ContentDecoratorSessionWrapper.java:120)
at info.magnolia.module.delta.ChildrenExistsDelegateTask.condition(ChildrenExistsDelegateTask.java:69)
... 10 more



 Comments   
Comment by Tom Wespi [ 07/Feb/14 ]

I tried to update an Magnolia 5.2.1 instance without PUR installed. The installation of the PUR Module during the update to 5.2.2 failed due some PathNotFoundException. Unfortunately I do not have the StackeTrace anymore, but should be easy to reproduce.

Comment by Christian Ringele [ 07/Feb/14 ]

I just checked on our demo which is currently running on M5.2.1 and PUR 2.2.1 the configuration.
The tree node is existing (see print screen PUR-Configuration-2.2.1.png).

But our demo is a fresh deployment of 5.2.1.

Looking at the "PublicUserRegistrationVersionHandler" its quite obvious what the problem is:

        register(DeltaBuilder.update("2.2.1", "")
                .addTask(new RemoveNodeTask("Remove deprecate tree", "Removes deprecated 'usersPublic' tree", RepositoryConstants.CONFIG, "/modules/public-user-registration/trees/usersPublic"))
                .addTask(changeNodeTypeOfPublicUserBaseNode));
        register(DeltaBuilder.update("2.2.2", "")
                .addTask(new ChildrenExistsDelegateTask("Remove empty tree node", "Remove 'modules/public-user-registration/trees' if it's empty",
                        RepositoryConstants.CONFIG, "/modules/public-user-registration/trees", NodeTypes.ContentNode.NAME, null,
                        new RemoveNodeTask("Remove tree node", "Remove 'modules/public-user-registration/trees'.", RepositoryConstants.CONFIG, "/modules/public-user-registration/trees/"))));

Delta 2.2.1 removes the node, delta 2.2.2 tries to remove the node again, respectively check first its children.
That I think where the exception it thrown:

2014-02-07 12:27:57,171 ERROR info.magnolia.module.InstallContextImpl           : > Could not perform installation: javax.jcr.PathNotFoundException: /modules/public-user-registration/trees
java.lang.RuntimeException: javax.jcr.PathNotFoundException: /modules/public-user-registration/trees
	at info.magnolia.module.delta.ChildrenExistsDelegateTask.condition(ChildrenExistsDelegateTask.java:75)

Assuming here that the PUR module was not first deployed on PUR version 2.2.1.
So the delta 2.2.1 of PUR was already triggered on the last update.

Summarized:
Only if you update a fresh deployed M5.2.1/PUR2.2.1 it will work.
If a customer already had updated PUR form 2.2 or lower to 2.2.1 it will fail with this exception.

Comment by Christian Ringele [ 07/Feb/14 ]

Workaround:

1. If you update form Magnolia 5.2.1 to 5.2.2 (PUR module version 2.2.1 to 2.2.2):
Before update

  • Go into /config/modules/public-user-registration
  • Create a Node names "trees"

2. If you update from Magnolia 5.2 (or lower) to 5.2.2:

  • Update first to 5.2.1 and not directly to 5.2.2.
  • Go into /config/modules/public-user-registration
  • Create a Node names "trees"
  • Update now to 5.2.2
Comment by Matteo Pelucco [ 07/Feb/14 ]

An additional note.
If you have already replaced the jars and see the "red" error duting Magnolia 5.2.2 installation, your instance is gone.
To have it back, deploy for a while the PUR module 2.2.1, finalize installation and create the "tree" folder.
Then re-deploy version 2.2.2.

Comment by Christian Ringele [ 07/Feb/14 ]

Thanks Matteo for the tip!

PUR module V 2.2.3 is released which will update correctly.

Generated at Mon Feb 12 06:43:19 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.