Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6593

resource-loader module throws NPE upon clean install when using the empty-webapp

    XMLWordPrintable

    Details

    • Sprint:
      Saigon 74, Saigon 75
    • Story Points:
      5
    • Magnolia Release:
      5.4.11, 5.5.1

      Description

      When using the empy-webapp as foundation for any project, the resource-loader module throws an NPE exception upon install. The actual install is not affected.

      Stacktrace:

      2016-03-11 16:26:21,050 ERROR info.magnolia.module.InstallContextImpl           : [56/216 tasks - Magnolia Resource Loader (version 5.4.6-SNAPSHOT)]> Could not install or update resource-loader module. Task 'Setup module repositories' failed. (NullPointerException: )
      info.magnolia.module.delta.TaskExecutionException: Could not bootstrap workspace: null
      	at info.magnolia.module.delta.SetupModuleRepositoriesTask.execute(SetupModuleRepositoriesTask.java:91)
      	at info.magnolia.module.ModuleManagerImpl.applyDeltas(ModuleManagerImpl.java:531)
      	at info.magnolia.module.ModuleManagerImpl.installOrUpdateModule(ModuleManagerImpl.java:513)
      	at info.magnolia.module.ModuleManagerImpl$1.doExec(ModuleManagerImpl.java:288)
      	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:421)
      	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:418)
      	at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:392)
      	at info.magnolia.module.ModuleManagerImpl.performInstallOrUpdate(ModuleManagerImpl.java:282)
      	at info.magnolia.module.ui.ModuleManagerWebUI$2.run(ModuleManagerWebUI.java:123)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
      	at info.magnolia.module.delta.SetupModuleRepositoriesTask.grantRepositoryToSuperuser(SetupModuleRepositoriesTask.java:99)
      	at info.magnolia.module.delta.SetupModuleRepositoriesTask.execute(SetupModuleRepositoriesTask.java:86)
      	... 9 more
      

      How to reproduce

      Do a clean install using the empty-webapp (and additionally excluding all lang-modules from the webapp).

      Source of the problem

      During installation SecuritySupport might not yet be available and therefore is replaced with info.magnolia.cms.security.SecuritySupportObservedComponentFactory.InitPhaseSecuritySupportImpl. This implementation doesn't have an InitPhaseRoleManager so giving access to superuser role (as part of the installation of the module) fails, as the returned role manager is null (see info.magnolia.module.delta.SetupModuleRepositoriesTask#grantRepositoryToSuperuser(String) which is part of every DefaultModuleVersionHandler).

      Adding such an InitPhaseRoleManager solves the NPE, but also doesn't properly execute the task, i.e. superuser doesn't have explicit access to the resources workspace after the installation (superuser has access to it thought, only the explicit ACL is missing in the role).

      Additional info

      It is not yet clear which module addition to the webapp solves the problem (by being installed after core and before resources-module) as the problem doesn't seem to be occuring in community-webapp.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hieu.nguyen Hieu Nguyen Duc
              Reporter:
              pmundt Philip Mundt
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  Time Tracking

                  Estimated:
                  Original Estimate - 5d Original Estimate - 5d
                  5d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 7.75d
                  7.75d