WrenSecurity / wrenam

Community fork of OpenAM, an authentication and authorization system originally developed by ForgeRock.
Other
43 stars 27 forks source link

NoSuchElementException when querying expired CTS tokens during realm configuration #118

Open karelmaxa opened 1 year ago

karelmaxa commented 1 year ago

When configuring realm using ssoadm in an HA environment (two nodes), I got the following error on the second node:

amThreadManager:05/31/2023 10:03:02:221 AM UTC: Thread[amThreadManager-8,5,main]: TransactionId[66b705b9-c6bc-4f12-bd4e-a440cd62093d-0]
ERROR: ThreadMonitor: Thread WatchDog detected error, restarting
java.util.concurrent.ExecutionException: com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.util.NoSuchElementException
  at org.forgerock.openam.sm.datalayer.impl.ldap.LdapQueryBuilder.<init>(Unknown Source)
  while locating org.forgerock.openam.sm.datalayer.impl.ldap.LdapQueryBuilder

1 error
    at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
    at org.forgerock.openam.shared.concurrency.ThreadMonitor$WatchDog.run(ThreadMonitor.java:294)
    at org.forgerock.openam.audit.context.AuditRequestContextPropagatingRunnable.run(AuditRequestContextPropagatingRunnable.java:42)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.util.NoSuchElementException
  at org.forgerock.openam.sm.datalayer.impl.ldap.LdapQueryBuilder.<init>(Unknown Source)
  while locating org.forgerock.openam.sm.datalayer.impl.ldap.LdapQueryBuilder

1 error
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
    at org.forgerock.openam.sm.datalayer.impl.ldap.LdapQueryFactory.createInstance(LdapQueryFactory.java:44)
    at org.forgerock.openam.cts.impl.query.worker.queries.CTSWorkerPastExpiryDateQuery.getQuery(CTSWorkerPastExpiryDateQuery.java:66)
    at org.forgerock.openam.cts.impl.query.worker.queries.CTSWorkerBaseQuery.nextPage(CTSWorkerBaseQuery.java:69)
    at org.forgerock.openam.cts.worker.process.CTSWorkerBaseProcess.handle(CTSWorkerBaseProcess.java:46)
    at org.forgerock.openam.cts.worker.CTSWorkerTask.run(CTSWorkerTask.java:51)
    at org.forgerock.openam.audit.context.AuditRequestContextPropagatingRunnable.run(AuditRequestContextPropagatingRunnable.java:42)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
    ... 3 more
Caused by: java.util.NoSuchElementException
    at java.base/java.util.StringTokenizer.nextToken(StringTokenizer.java:347)
    at org.forgerock.openam.ldap.LDAPUtils.prioritizeServers(LDAPUtils.java:301)
    at org.forgerock.openam.sm.datalayer.impl.ldap.ExternalLdapConfig.getLDAPURLs(ExternalLdapConfig.java:89)
    at org.forgerock.openam.sm.ConnectionConfigFactory$DelegatingConnectionConfig.getLDAPURLs(ConnectionConfigFactory.java:137)
    at org.forgerock.openam.sm.utils.ConfigurationValidator.validate(ConfigurationValidator.java:34)
    at org.forgerock.openam.sm.ConnectionConfigFactory.getConfig(ConnectionConfigFactory.java:90)
    at org.forgerock.openam.sm.datalayer.providers.LdapConnectionFactoryProvider.createFactory(LdapConnectionFactoryProvider.java:97)
    at org.forgerock.openam.sm.datalayer.impl.ldap.LdapQueryBuilder.<init>(LdapQueryBuilder.java:90)
    at jdk.internal.reflect.GeneratedConstructorAccessor94.newInstance(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:85)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
    ... 13 more