pentaho/pentaho-kettle · error · KettleException

LDAPOutput.Error.CanNotFindField

LDAPOutput.Error.CanNotFindField

Error message

LDAPOutput.Error.CanNotFindField

What it means

After computing the index of the configured Old DN field in the input row metadata, the step finds indexOfValue() < 0, meaning the Old DN field configured on the step does not exist in the incoming row stream, and throws KettleException with LDAPOutput.Error.CanNotFindField.

Solutions

  1. Check the step dialog and re-select the Old DN field from the dropdown so it matches a real incoming column
  2. Use 'Preview' on the previous step to confirm the exact field name/type reaching LDAP Output
  3. Fix the variable definition if the field name uses environment substitution

Example fix

// before
oldDnField = "oldDistingueshedName"; // typo
// after
oldDnField = "oldDistinguishedName"; // matches stream field
Defensive patterns

Strategy: validation

Validate before calling

int idx = getInputRowMeta().indexOfValue(oldDnField);
if (idx < 0) {
  throw new KettleException("Old DN field '" + oldDnField + "' not found in stream");
}

Try / catch

try { step.processRow(); } catch (KettleException e) {
  if (e.getMessage().contains("CanNotFindField")) { logError("Re-map the Old DN field in the step dialog"); }
  throw e;
}

Prevention

When it happens

Trigger: Rename-mode LDAP Output whose 'Old DN field' name (after variable substitution) does not match any column of the row arriving at the step at runtime.

Common situations: Typo in the field name; upstream step renamed or removed the column; case-sensitive mismatch; field produced by a step that was disabled; variable-substituted field name points to a nonexistent column.

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/d984c3479522072e. Report an issue: GitHub.

Appendix: source

Thrown at plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapoutput/LDAPOutput.java:137

      }

      if ( meta.getOperationType() == LDAPOutputMeta.OPERATION_TYPE_RENAME ) {
        String oldDnField = environmentSubstitute( meta.getOldDnFieldName() );
        if ( Utils.isEmpty( oldDnField ) ) {
          throw new KettleException( BaseMessages.getString( PKG, "LDAPOutput.Error.OldDNFieldMissing" ) );
        }

        String newDnField = environmentSubstitute( meta.getNewDnFieldName() );
        if ( Utils.isEmpty( newDnField ) ) {
          throw new KettleException( BaseMessages.getString( PKG, "LDAPOutput.Error.NewDNFieldMissing" ) );
        }

        // return the index of the field in the input stream
        data.indexOfOldDNField = getInputRowMeta().indexOfValue( oldDnField );

        if ( data.indexOfOldDNField < 0 ) {
          // the field is unreachable!
          throw new KettleException( BaseMessages.getString( PKG, "LDAPOutput.Error.CanNotFindField", oldDnField ) );
        }
        // return the index of the field in the input stream
        data.indexOfNewDNField = getInputRowMeta().indexOfValue( newDnField );

        if ( data.indexOfNewDNField < 0 ) {
          // the field is unreachable!
          throw new KettleException( BaseMessages.getString( PKG, "LDAPOutput.Error.CanNotFindField", newDnField ) );
        }

      } else {
        String dnField = environmentSubstitute( meta.getDnField() );
        // Check Dn field
        if ( Utils.isEmpty( dnField ) ) {
          throw new KettleException( BaseMessages.getString( PKG, "LDAPOutput.Error.DNFieldMissing" ) );
        }

        // return the index of the field in the input stream
        data.indexOfDNField = getInputRowMeta().indexOfValue( dnField );

View on GitHub (pinned to f3058517a1)