pentaho/pentaho-kettle · error · KettleException

LDAPConnection.Error.Deleting.NameNotFound

LDAPConnection.Error.Deleting.NameNotFound

Error message

LDAPConnection.Error.Deleting.NameNotFound

What it means

LDAPConnection.delete(dn, checkEntry) catches NameNotFoundException from the JNDI delete operation. When checkEntry is true it rethrows as a KettleException with message key 'LDAPConnection.Error.Deleting.NameNotFound', meaning the DN targeted for deletion does not exist in the directory. When checkEntry is false the deletion is silently skipped (STATUS_SKIPPED).

Solutions

  1. Verify the exact DN with ldapsearch before deleting, or pass checkEntry=false if absence is acceptable (it will be skipped instead of failing).
  2. Trim and normalize the DN string coming from your source data (spaces, case, escaping of '/' and ',').
  3. Confirm the entry has not already been deleted by a previous run.
  4. Check the connection is bound to the expected base DN / naming context.

Example fix

// before
connection.delete(dn, true); // fails if DN already gone
// after
if (connection.delete(dn, false) == LDAPConnection.STATUS_DELETED) { /* deleted */ } else { logBasic("Entry not found, skipped: " + dn); }
Defensive patterns

Strategy: validation

Validate before calling

// Check existence before delete
String filter = "(entryDN=" + dn + ")"; // or search by RDN
connection.search(); // returns results; if empty, the DN is absent -> skip or log instead of deleting with checkEntry=true

Try / catch

try {
  connection.delete(dn, true);
} catch (KettleException e) {
  if (ExceptionUtils.getRootCause(e) instanceof NameNotFoundException) {
    logBasic("DN already absent, treating as deleted: " + dn); // idempotent handling
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling delete(dn, true) where dn is not present in the LDAP tree (already deleted, wrong DN spelling, wrong base context, or case/space mismatch in the RDN).

Common situations: Running a deletion transformation twice so the second run finds nothing; building the DN from stream fields with stray whitespace or wrong attribute casing (LDAP DN attribute names are case-insensitive but values matter); deleting an entry whose parent OU was renamed.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/aca725c854b6cdd4. Report an issue: GitHub.

Appendix: source

Thrown at plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java:290

  }

  public int delete( String dn, boolean checkEntry ) throws KettleException {
    try {

      if ( checkEntry ) {
        // First Check entry
        getInitialContext().lookup( dn );
      }
      // The entry exists
      getInitialContext().destroySubcontext( dn );
      if ( log.isDebug() ) {
        log.logDebug( BaseMessages.getString( PKG, "LDAPinput.Exception.Deleted", dn ) );
      }
      return STATUS_DELETED;
    } catch ( NameNotFoundException n ) {
      // The entry is not found
      if ( checkEntry ) {
        throw new KettleException(
          BaseMessages.getString( PKG, "LDAPConnection.Error.Deleting.NameNotFound", dn ), n );
      }
      return STATUS_SKIPPED;
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "LDAPConnection.Error.Delete", dn ), e );
    }
  }

  public int update( String dn, String[] attributes, String[] values, boolean checkEntry ) throws KettleException {
    try {
      int nrAttributes = attributes.length;
      ModificationItem[] mods = new ModificationItem[nrAttributes];
      for ( int i = 0; i < nrAttributes; i++ ) {
        // Define attribute
        Attribute mod = new BasicAttribute( attributes[i], values[i] );
        if ( log.isDebug() ) {
          log
            .logDebug( BaseMessages.getString( PKG, "LDAPConnection.Update.Attribute", attributes[i], values[i] ) );

View on GitHub (pinned to f3058517a1)