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 #1

Updated by François ARMAND over 4 years ago

  • Status changed from New to In progress
Actions #2

Updated by François ARMAND over 4 years ago

  • Assignee changed from François ARMAND to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/rudder/pull/2803
Actions #3

Updated by François ARMAND over 4 years ago

With the proposed PR, we get a more concise and explicit error message:

Fiber failed.
An unchecked error was produced.
bootstrap.liftweb.RudderConfig$NoStackTraceError: An error occured when testing for LDAP connection: BackendException: An error occured; cause was: 
java.lang.Error: Error during LDAP connection pool initialisation. Exception: LDAPException:An error occurred while attempting to send the LDAP message to 
server localhost:1389:  SocketException(Socket closed), ldapSDKVersion=4.0.7, revision=28484; Details: null 
 -> com.normation.ldap.sdk.PooledConnectionProvider.liftedTree1$1(LDAPConnectionProvider.scala:245)
 -> com.normation.ldap.sdk.PooledConnectionProvider.pool(LDAPConnectionProvider.scala:238)
 -> com.normation.ldap.sdk.PooledConnectionProvider.pool$(LDAPConnectionProvider.scala:238)

Fiber:0 was supposed to continue to:
  a future continuation at bootstrap.liftweb.RudderConfig$.new(RudderConfig.scala:512)

Fiber:0 execution trace:
  at zio.ZIO.orDieWith(ZIO.scala:669)
  at bootstrap.liftweb.RudderConfig$.new(RudderConfig.scala:516)

Fiber:0 was spawned by: <empty trace>
[2020-03-02T17:25:41.815+01:00] ERROR FATAL An error happen during Rudder boot. Rudder will stop now.
Actions #4

Updated by François ARMAND over 4 years ago

  • Status changed from In progress to Pending release
Actions #5

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 6.0.5 to 6.0.4
Actions #6

Updated by Nicolas CHARLES over 4 years ago

  • Fix check changed from To do to Checked
Actions #7

Updated by Vincent MEMBRÉ over 4 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 6.0.4 which was released today.

Actions

Also available in: Atom PDF