openam-jp / openam

Other
32 stars 15 forks source link

OpenDJ version checks are inconsistent #291

Open tsujiguchitky opened 10 months ago

tsujiguchitky commented 10 months ago

Description

OpenDJ version checks by OpenAM and OpenDJ are inconsistent. If OpenDJ is fixed, the OpenAM upgrade will not complete and will not start.

OpenDJ requires an upgrade process depending on the version change. Therefore, OpenDJ checks version during several processes. OpenAM also checks OpenDJ version to kick the upgrade process. However, these checks are inconsistent.

OpenDJ holds version information in a format as {majorVersion}.{minorVersion}.{incrementalVersion}.{buildRevision}. Then, buildRevision is the Git commit hash. Therefore, if OpenDJ is fixed, the version number will change.

OpenAM and OpenDJ check at the following timings.

  1. Check during OpenAM startup process
  2. Check during OpenDJ upgrade process (If a difference is found in the previous step)
  3. Check during OpenDJ startup process

Steps 1 and 3 also check for buildRevision. But step 2 doesn't check for buildRevision. Therefore, the upgrade process will not be performed and OpenDJ fails to start.

I think it is not necessary to consider buildRevision when checking the version for upgrading.

Steps to reproduce

Upgrade with OpenAM including new buildRevision OpenDJ.

Expected Results

The OpenAM upgrade screen is displayed.

Actual Results

The servlet container error screen is displayed.

Debug Log

amSetupServlet:11/15/2023 04:14:55:920 PM JST: Thread[localhost-startStop-1,5,main]: TransactionId[89779da4-520c-4c68-afce-0e0190f6be6d-0]
Debug file can't be written : Failed to create debug directory Current Debug File : DebugFileImpl{debugDirectorynulldebugName='Configuration', fileCreationTime=01/01/1970 09:00:00:000 AM JST}
amSetupServlet:11/15/2023 04:14:55:920 PM JST: Thread[localhost-startStop-1,5,main]: TransactionId[89779da4-520c-4c68-afce-0e0190f6be6d-0]
ERROR: Upgrade required: upgrading from 3.0.2.34a2a5900df4853ffe507f331e83f233b3aabec5 to 3.0.2.8781c81c8da4bfc4e3cf6514e060946149b6c1a2
 * OpenDJ has already been upgraded to version
 3.0.2.8781c81c8da4bfc4e3cf6514e060946149b6c1a2
BootstrapData.startEmbeddedDS: org.opends.server.types.InitializationException: The OpenDJ binary version '3.0.2.8781c81c8da4bfc4e3cf6514e060946149b6c1a2' does not match the installed version '3.0.2.34a2a5900df4853ffe507f331e83f233b3aabec5'. Please run upgrade before continuing
amSMSLdap:11/15/2023 04:14:59:218 PM JST: Thread[localhost-startStop-1,5,main]: TransactionId[89779da4-520c-4c68-afce-0e0190f6be6d-0]
ERROR: SMDataLayer:getConnection() - Failed to get Connection
org.forgerock.opendj.ldap.ConnectionException: Connect Error: No operational connection factories available
    at org.forgerock.opendj.ldap.LdapException.newLdapException(LdapException.java:163)
    at org.forgerock.opendj.ldap.LdapException.newLdapException(LdapException.java:124)
    at org.forgerock.opendj.ldap.AbstractLoadBalancingAlgorithm.getMonitoredConnectionFactory(AbstractLoadBalancingAlgorithm.java:343)
    at org.forgerock.opendj.ldap.AbstractLoadBalancingAlgorithm.access$100(AbstractLoadBalancingAlgorithm.java:59)
...
Caused by: org.forgerock.opendj.ldap.ConnectionException: Connect Error: Connection refused
    at org.forgerock.opendj.ldap.LdapException.newLdapException(LdapException.java:163)
    at org.forgerock.opendj.ldap.LdapException.newLdapException(LdapException.java:124)
    at org.forgerock.opendj.grizzly.GrizzlyLDAPConnectionFactory$CompletionHandlerAdapter.adaptConnectionException(GrizzlyLDAPConnectionFactory.java:133)
    ... 17 more
Caused by: java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:716)
    at org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler.onConnectedAsync(TCPNIOConnectorHandler.java:210)
    ... 14 more