{"record":{"id":"99ab47908e4912b3","repo":"pentaho/pentaho-kettle","slug":"ldapinput-error-dynamicsearchfieldmissing","errorCode":"LDAPInput.Error.DynamicSearchFieldMissing","errorMessage":"LDAPInput.Error.DynamicSearchFieldMissing","messagePattern":"LDAPInput\\.Error\\.DynamicSearchFieldMissing","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPInput.java","lineNumber":141,"sourceCode":"  }\n\n  private boolean dynamicSearch() throws KettleException {\n\n    data.readRow = getRow();\n    // Get row from input rowset & set row busy!\n    if ( data.readRow == null ) {\n      if ( log.isDetailed() ) {\n        logDetailed( BaseMessages.getString( PKG, \"LDAPInput.Log.FinishedProcessing\" ) );\n      }\n      setOutputDone();\n      return false;\n    }\n    if ( first ) {\n      first = false;\n\n      if ( meta.isDynamicSearch() ) {\n        if ( Utils.isEmpty( meta.getDynamicSearchFieldName() ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPInput.Error.DynamicSearchFieldMissing\" ) );\n        }\n      }\n      if ( meta.isDynamicFilter() ) {\n        if ( Utils.isEmpty( meta.getDynamicFilterFieldName() ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPInput.Error.DynamicFilterFieldMissing\" ) );\n        }\n      }\n\n      // Create the output row meta-data\n      data.nrIncomingFields = getInputRowMeta().size();\n      data.outputRowMeta = getInputRowMeta().clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n                      metaStore );\n\n      // Create convert meta-data objects that will contain Date & Number formatters\n      //\n      data.convertRowMeta = data.outputRowMeta.cloneToType( ValueMetaInterface.TYPE_STRING );\n","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPInput.java#L123-L159","documentation":"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).","triggerScenarios":"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).","commonSituations":"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.","solutions":["Open the LDAP Input step and set 'Dynamic search base field' to an existing String field containing the DN.","Ensure the upstream step actually outputs that field (check with a 'Get Fields' on the hop).","If dynamic search is not intended, disable the 'Use dynamic search base' checkbox so the static search base is used."],"exampleFix":"// before (ktr XML, field missing)\n<dynamic_search_fieldname/>\n// after\n<dynamic_search_fieldname>dn_field</dynamic_search_fieldname>","handlingStrategy":"validation","validationCode":"// in custom metadata validation before running\nif (meta.isDynamicSearch() && (meta.getDynamicSearchFieldName() == null || meta.getDynamicSearchFieldName().isEmpty())) {\n  throw new IllegalStateException(\"Dynamic search is enabled but no dynamic search base field is set\");\n}","typeGuard":null,"tryCatchPattern":"try { row = getOneRow(); } catch (KettleException e) { if (e.getMessage().contains(\"DynamicSearchFieldMissing\")) { logError(\"Set the dynamic search base field in the step dialog\"); } throw e; }","preventionTips":["Always pick the DN-supplier field in the step dialog when enabling dynamic search","Re-check step settings after copying steps between transformations","Use Spoon's field dropdown rather than hand-editing ktr XML"],"tags":["configuration","ldap","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}