Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-12054

Cumulative upgrades of OpenAM (e.g. 5.1.0 to 5.5.0 to 5.5.1) fail with "Writing Backup; Failed!" error

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 14.5.0
    • Fix Version/s: 6.0.0, 14.1.1.1, 14.1.2, 5.5.2
    • Component/s: upgrade
    • Environment:
      Tomcat 8.5.20
      java version "1.8.0_144"
      Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
    • Target Version/s:
    • Sprint:
      Sprint 2017.15 Curie
    • Needs backport:
      Yes
    • Support Ticket IDs:
    • Verified Version/s:
    • Needs QA verification:
      Yes
    • Functional tests:
      No
    • Are the reproduction steps defined?:
      Yes and I used the same an in the description

      Description

      Bug description

      Cumulative upgrades of OpenAM (e.g. 5.1.0 to 5.5.0 to 5.5.1) fail with a "Writing Backup; Failed!" and "Failed to write backup file, check debug logs for more information." error presented in the AM upgrade wizard. 

      Prior to AM 5.5.0 this was not experienced during cumulative upgrades.

      Looking in the amUpgrade log I get the following output:

       

      amUpgrade:11/06/2017 03:11:28:928 PM GMT: Thread[http-nio-18080-exec-6,5,main]: TransactionId[ab705026-3e06-40c0-9358-b8f0a5e0559f-192]
      ERROR: Failed to write backup file: 
      java.lang.NullPointerException
      at com.sun.identity.sm.ServiceManager.checkAndEncryptPasswordSyntax(ServiceManager.java:982)
      at com.sun.identity.sm.ServiceSchemaManagerImpl.toXML(ServiceSchemaManagerImpl.java:682)
      at com.sun.identity.sm.ServiceSchemaManager.toXML(ServiceSchemaManager.java:963)
      at com.sun.identity.sm.ServiceManager.toXML(ServiceManager.java:1206)
      at org.forgerock.openam.upgrade.UpgradeServices.writeBackup(UpgradeServices.java:289)
      at org.forgerock.openam.upgrade.UpgradeServices.upgrade(UpgradeServices.java:149)
      at com.sun.identity.config.upgrade.Upgrade.doUpgrade(Upgrade.java:68)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.click.util.ClickUtils.invokeMethod(ClickUtils.java:3317)
      at org.apache.click.util.ClickUtils.invokeListener(ClickUtils.java:2088)
      at org.apache.click.control.AbstractControl$1.onAction(AbstractControl.java:228)
      at org.apache.click.ActionEventDispatcher.fireActionEvent(ActionEventDispatcher.java:259)
      at org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatcher.java:236)
      at org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatcher.java:180)
      at org.apache.click.ClickServlet.performOnProcess(ClickServlet.java:746)
      at org.apache.click.ClickServlet.processAjaxPageEvents(ClickServlet.java:1860)
      at org.apache.click.ClickServlet.processPage(ClickServlet.java:559)
      at org.apache.click.ClickServlet.handleRequest(ClickServlet.java:383)
      at org.apache.click.ClickServlet.doGet(ClickServlet.java:276)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.forgerock.openam.validation.ResponseValidationFilter.doFilter(ResponseValidationFilter.java:36)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.forgerock.openam.headers.SetHeadersFilter.doFilter(SetHeadersFilter.java:80)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at com.sun.identity.setup.AMSetupFilter.doFilter(AMSetupFilter.java:123)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.forgerock.openam.audit.context.AuditContextFilter.doFilter(AuditContextFilter.java:46)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:748)
      

       

      How to reproduce the issue

      1. Download the following versions of AM from backstage:
        1. AM 5.1.1
        2. AM 5.5.0
        3. AM 5.5.1
      2. Install OpenAM 5.1.1 (you can use the default configuration as no extra steps are carried out following install)
      3. Upgrade to AM 5.5.0 (this should succeed)
      4. Upgrade to AM 5.5.1
      Expected behaviour
      AM should be upgrade to 5.5.1 successfully.
      Current behaviour
      AM is not upgraded to 5.5.1 as the upgrade process fails.
      

       

      Code analysis

       The logs seem to indicate a NullPointerException is being thrown from the ServiceManager class

      com.sun.identity.sm.ServiceManager.java
      ...
              // Check if the "syntax" attribute is "password"
              String syntax = XMLUtils.getNodeAttributeValue(node,
                      SMSUtils.ATTRIBUTE_SYNTAX);
              if (syntax.equals(AttributeSchema.Syntax.PASSWORD.toString())) {  <--- NPE here
      ....
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dipu.seminlal Dipu Seminlal
                Reporter:
                adam.heath Adam Heath
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: