Project

General

Profile

Actions

Bug #16847

closed

LDAP connection pool error are not correctly reported

Added by François ARMAND over 4 years ago. Updated over 4 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Maintenance
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:

Description

We have a case where an user report an error with LDAP, with the following log:

[2020-03-02 13:32:07+0100] ERROR com.normation.rudder.repository.ldap.LDAPGitRevisionProvider - Error when trying to read persisted version of the current technique reference library revision to use. Using the last available from Git. Error was: BackendException: An error occured; cause was: java.lang.Error: null
-> com.normation.ldap.sdk.PooledConnectionProvider.liftedTree1$1(LDAPConnectionProvider.scala:243)
-> com.normation.ldap.sdk.PooledConnectionProvider.pool(LDAPConnectionProvider.scala:238)
-> com.normation.ldap.sdk.PooledConnectionProvider.pool$(LDAPConnectionProvider.scala:238)
Fiber failed.
A checked error was not handled.
BackendException(An error occured,java.lang.Error)

Fiber:1 was supposed to continue to:
a future continuation at com.normation.errors$IOResult$.effectNonBlocking(ZioCommons.scala:90)
a future continuation at com.normation.ldap.sdk.LDAPIOResult$.effectNonBlocking(LDAPIOResult.scala:64)
a future continuation at com.normation.ldap.sdk.LDAPConnectionProvider.flatMap(LDAPConnectionProvider.scala:92)
a future continuation at com.normation.rudder.repository.ldap.LDAPGitRevisionProvider.currentId(LDAPGitRevisionProvider.scala:77)
a future continuation at com.normation.cfclerk.services.impl.GitTechniqueReader.currentTechniquesInfoCache(GitTechniqueReader.scala:181)
a future continuation at zio.ZIO.run(ZIO.scala:1123)
a future continuation at zio.Semaphore.withPermits(Semaphore.scala:114)
a future continuation at com.normation.cfclerk.services.impl.GitTechniqueReader.currentTechniquesInfoCache(GitTechniqueReader.scala:204)
a future continuation at zio.ZIO.run(ZIO.scala:1123)
a future continuation at zio.ZIO.bracket(ZIO.scala:144)
a future continuation at zio.ZIO.run(ZIO.scala:1123)
a future continuation at zio.ZIO.bracket(ZIO.scala:144)
a future continuation at com.normation.zio$ZioRuntime$.runNow(ZioCommons.scala:358)

Fiber:1 execution trace:
at com.normation.ldap.sdk.RWPooledSimpleAuthConnectionProvider.newConnection(LDAPConnectionProvider.scala:410)
at com.normation.rudder.repository.ldap.LDAPGitRevisionProvider.currentId(LDAPGitRevisionProvider.scala:77)
at com.normation.rudder.repository.ldap.LDAPGitRevisionProvider.getAvailableRevTreeId(LDAPGitRevisionProvider.scala:105)
at com.normation.rudder.repository.ldap.LDAPGitRevisionProvider.getAvailableRevTreeId(LDAPGitRevisionProvider.scala:104)
at com.normation.errors$IOResult$.effectM(ZioCommons.scala:104)
at com.normation.rudder.repository.xml.GitFindUtils$.findRevTreeFromRevString(GitFindUtils.scala:135)

The interesting part is:

BackendException: An error occured; cause was: java.lang.Error: null
-> com.normation.ldap.sdk.PooledConnectionProvider.liftedTree1$1(LDAPConnectionProvider.scala:243)

But clearly, we don't know at all what happens with "null".
Corresponding code id:

  protected lazy val pool = try {
    new LDAPConnectionPool(self.newUnboundidConnection, poolSize)
  } catch {
    case ex: LDAPException =>
      LDAPConnectionLogger.error(s"Error during LDAP connection pool initialisation. Exception: ${ex.getDiagnosticMessage}")
      throw new Error(ex.getDiagnosticMessage)
  }

So, we can know that:

- something want wrong with Pool creation, and it lead to an exception,
- and that exception doesn't have a diagnosticMessage.

We need to know:

- exception type
- exception message

Which works even for non LDAP exception.

Actions

Also available in: Atom PDF