pentaho/pentaho-kettle · error · KettleException

LDAPInput.Exception.CanNotReadLDAP

LDAPInput.Exception.CanNotReadLDAP

Error message

LDAPInput.Exception.CanNotReadLDAP

What it means

buildRow() wraps any exception during reading an LDAP entry and building the output row in this KettleException, with the original exception chained as cause. It covers search execution (non-dynamic path), attribute extraction, and value conversion for each row. It is the generic per-row read failure for the LDAP Input step.

Solutions

  1. Inspect the chained cause (e.getCause()) for the precise naming/conversion error.
  2. Verify every configured return field exists on the LDAP entries; adjust the filter so matched entries carry them.
  3. Mark binary attributes (e.g. objectGUID, jpegPhoto) as 'binary' in the step's Fields tab.
  4. Increase the directory-side size/time limits or narrow the search base/filter to reduce result size.
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight: ensure configured return fields exist on a sample entry
Attributes sample = ctx.getAttributes(sampleDn);
for (String f : returnFields) { if (sample.get(f) == null) logBasic("Field " + f + " absent on sample entry"); }

Try / catch

try { rowData = buildRow(meta, data); } catch (KettleException e) { logError("LDAP row read failed: " + e.getCause(), e); setErrors(1); stopAll(); }

Prevention

When it happens

Trigger: Any Exception in buildRow's try block: conn.getAttributes() failing, getAttributeValue() throwing (e.g. attribute missing, binary conversion error), or the initial LDAP connection/search throwing when reading rows.

Common situations: Requested attribute not present on entries (getAttribute returns null and conversion NPEs), binary attributes (photos, certificates) not marked as binary in field config, directory timeout on large subtree searches, wrong time/size limit settings.

Related errors


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

Appendix: source

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

      } // End of loop over fields...

      int fIndex = data.nrIncomingFields + data.nrfields;

      // See if we need to add the row number to the row...
      if ( meta.includeRowNumber() && !Utils.isEmpty( meta.getRowNumberField() ) ) {
        outputRowData[fIndex] = new Long( data.rownr );
      }

      RowMetaInterface irow = getInputRowMeta();

      data.previousRow = irow == null ? outputRowData : irow.cloneRow( outputRowData ); // copy it to make
      // surely the next step doesn't change it in between...
      data.rownr++;

      incrementLinesInput();

    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "LDAPInput.Exception.CanNotReadLDAP" ), e );
    }
    return outputRowData;
  }

  private Object getAttributeValue( LDAPInputField field, Attribute attr, int i, Object outputRowData ) throws Exception {

    if ( field.getType() == ValueMetaInterface.TYPE_BINARY ) {
      // It's a binary field
      // no need to convert, just return the value as it
      try {
        return attr.get();
      } catch ( java.lang.ClassCastException e ) {
        return attr.get().toString().getBytes();
      }
    }

    String retval = null;
    if ( field.getReturnType() == LDAPInputField.FETCH_ATTRIBUTE_AS_BINARY

View on GitHub (pinned to f3058517a1)