pentaho/pentaho-kettle · error · KettleException

LDAPInput.Error.DynamicSearchFieldMissing

LDAPInput.Error.DynamicSearchFieldMissing

Error message

LDAPInput.Error.DynamicSearchFieldMissing

What it means

LDAPInput.dynamicSearch() throws this when the step is configured for dynamic search (meta.isDynamicSearch()) but the 'dynamic search base field' name is empty. The step needs a field in the incoming row that supplies the per-row search base DN. It is a configuration validation failure raised on the first row (first==true).

Solutions

  1. Open the LDAP Input step and set 'Dynamic search base field' to an existing String field containing the DN.
  2. Ensure the upstream step actually outputs that field (check with a 'Get Fields' on the hop).
  3. If dynamic search is not intended, disable the 'Use dynamic search base' checkbox so the static search base is used.

Example fix

// before (ktr XML, field missing)
<dynamic_search_fieldname/>
// after
<dynamic_search_fieldname>dn_field</dynamic_search_fieldname>
Defensive patterns

Strategy: validation

Validate before calling

// in custom metadata validation before running
if (meta.isDynamicSearch() && (meta.getDynamicSearchFieldName() == null || meta.getDynamicSearchFieldName().isEmpty())) {
  throw new IllegalStateException("Dynamic search is enabled but no dynamic search base field is set");
}

Try / catch

try { row = getOneRow(); } catch (KettleException e) { if (e.getMessage().contains("DynamicSearchFieldMissing")) { logError("Set the dynamic search base field in the step dialog"); } throw e; }

Prevention

When it happens

Trigger: Transformation runs with 'Use dynamic search base' enabled but the 'Dynamic search base field' combo in the step dialog was never populated (meta.getDynamicSearchFieldName() is null/empty).

Common situations: Copying an LDAP Input step between transformations where the upstream field providing the DN was renamed or dropped; hand-editing the ktr XML and omitting the field tag.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

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

  }

  private boolean dynamicSearch() throws KettleException {

    data.readRow = getRow();
    // Get row from input rowset & set row busy!
    if ( data.readRow == null ) {
      if ( log.isDetailed() ) {
        logDetailed( BaseMessages.getString( PKG, "LDAPInput.Log.FinishedProcessing" ) );
      }
      setOutputDone();
      return false;
    }
    if ( first ) {
      first = false;

      if ( meta.isDynamicSearch() ) {
        if ( Utils.isEmpty( meta.getDynamicSearchFieldName() ) ) {
          throw new KettleException( BaseMessages.getString( PKG, "LDAPInput.Error.DynamicSearchFieldMissing" ) );
        }
      }
      if ( meta.isDynamicFilter() ) {
        if ( Utils.isEmpty( meta.getDynamicFilterFieldName() ) ) {
          throw new KettleException( BaseMessages.getString( PKG, "LDAPInput.Error.DynamicFilterFieldMissing" ) );
        }
      }

      // Create the output row meta-data
      data.nrIncomingFields = getInputRowMeta().size();
      data.outputRowMeta = getInputRowMeta().clone();
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
                      metaStore );

      // Create convert meta-data objects that will contain Date & Number formatters
      //
      data.convertRowMeta = data.outputRowMeta.cloneToType( ValueMetaInterface.TYPE_STRING );

View on GitHub (pinned to f3058517a1)