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

Upgrade could fail with RemoveReferralsStep having too broad base DN

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.1
    • Fix Version/s: 6.5.0
    • Component/s: upgrade
    • Labels:
    • Target Version/s:
    • Sprint:
      AM Sustaining Sprint 49, AM Sustaining Sprint 50, AM Sustaining Sprint 51
    • Story Points:
      2
    • Needs backport:
      No
    • Support Ticket IDs:
    • Needs QA verification:
      Yes
    • Functional tests:
      No
    • Are the reproduction steps defined?:
      No (add reasons in the comment)

      Description

      Bug description

      Upgrade could fail with RemoveReferralsStep having too broad base DN

      How to reproduce the issue

      Haven't been recreated in house, but upgrade should fail if config DJ is slow.

      Expected behaviour

      Upgrade to succeed

      Current behaviour

      Upgrade fails with the following error :

      ERROR: An error occurred while initializing upgrade steps
      org.forgerock.openam.upgrade.UpgradeException: Unable to complete search for referrals
              at org.forgerock.openam.upgrade.steps.RemoveReferralsStep.interrogateExistingReferrals(RemoveReferralsStep.java:131)
              at org.forgerock.openam.upgrade.steps.RemoveReferralsStep.initialize(RemoveReferralsStep.java:123)
              at org.forgerock.openam.upgrade.UpgradeServices.<init>(UpgradeServices.java:96)
              at org.forgerock.openam.upgrade.UpgradeServices.getInstance(UpgradeServices.java:123)
              at com.sun.identity.config.upgrade.Upgrade.<init>(Upgrade.java:43)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
              at java.lang.Class.newInstance(Class.java:442)
              at org.apache.click.ClickServlet.newPageInstance(ClickServlet.java:1422)
              at org.apache.click.ClickServlet.initPage(ClickServlet.java:1257)
              at org.apache.click.ClickServlet.createPage(ClickServlet.java:1103)
              at org.apache.click.ClickServlet.handleRequest(ClickServlet.java:367)
              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:504)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
              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:803)
              at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
              at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
              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)
      Caused by: org.forgerock.opendj.ldap.ConnectionException: Connect Error: No operational connection factories available
              at org.forgerock.opendj.ldap.LdapException.newLdapException(LdapException.java:177)
              at org.forgerock.opendj.ldif.ConnectionEntryReader.hasNext(ConnectionEntryReader.java:224)
              at org.forgerock.openam.upgrade.steps.RemoveReferralsStep.searchForReferrals(RemoveReferralsStep.java:141)
              at org.forgerock.openam.upgrade.steps.RemoveReferralsStep.interrogateExistingReferrals(RemoveReferralsStep.java:129)
              ... 49 more
      Caused by: org.forgerock.opendj.ldap.TimeoutResultException: Client-Side Timeout: The request has failed because no response was received from the server within the 10000 ms timeout
              at org.forgerock.opendj.ldap.LdapException.newLdapException(LdapException.java:200)
              at org.forgerock.opendj.ldap.LdapClientImpl$LdapClientSocketImpl.newRequestTimeoutException(LdapClientImpl.java:537)
              at org.forgerock.opendj.ldap.LdapClientImpl$LdapClientSocketImpl.access$2100(LdapClientImpl.java:260)
              at org.forgerock.opendj.ldap.LdapClientImpl$Exchange.onError0(LdapClientImpl.java:676)
              at org.forgerock.opendj.ldap.LdapClientImpl$Exchange.onError(LdapClientImpl.java:662)
              at org.forgerock.opendj.ldap.DemultiplexerImpl$DemultiplexedStream.forwardDelagateTerminate(DemultiplexerImpl.java:624)
              at org.forgerock.opendj.ldap.DemultiplexerImpl$DemultiplexedStream.drainLoop(DemultiplexerImpl.java:548)
              at org.forgerock.opendj.ldap.DemultiplexerImpl$DemultiplexedStream.tryDrain(DemultiplexerImpl.java:523)
              at org.forgerock.opendj.ldap.DemultiplexerImpl$DemultiplexedStream.onErrorOrTimeout(DemultiplexerImpl.java:483)
              at org.forgerock.opendj.ldap.DemultiplexerImpl.checkForTimeout(DemultiplexerImpl.java:310)
              at org.forgerock.opendj.ldap.TimeoutScheduler$RootTask.run(TimeoutScheduler.java:77)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              ... 1 more
      

      Work around

      None

      Code analysis

      RemoveReferralsStep is using root DN which is "dc=openam,dc=forgerock,dc=org" by default, but the search base should be "ou=services,dc=openam,dc=forgerock,dc=org".

      org.forgerock.$RemoveReferralsStep.java
          private void searchForReferrals(Connection connection)
                  throws SearchResultReferenceIOException, LdapException, UpgradeException {
              SearchRequest request = LDAPRequests.newSearchRequest(
                      rootDN, SearchScope.WHOLE_SUBTREE, REFERRAL_SEARCH_FILTER, "sunKeyValue");
      
              try (ConnectionEntryReader reader = connection.search(request)) {
                  while (reader.hasNext()) {
                      extractReferralInformation(reader.readEntry());
                  }
              }
          }
      

        Attachments

          Activity

            People

            • Assignee:
              sachiko Sachiko Wallace
              Reporter:
              sachiko Sachiko Wallace
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: