{"record":{"id":"7e4e4733d53ada3a","repo":"pentaho/pentaho-kettle","slug":"ldapinput-exception-couldnotfindfield","errorCode":"LDAPInput.Exception.CouldnotFindField","errorMessage":"LDAPInput.Exception.CouldnotFindField","messagePattern":"LDAPInput\\.Exception\\.CouldnotFindField","errorType":"validation","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPInput.java","lineNumber":164,"sourceCode":"          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\n      if ( meta.isDynamicSearch() ) {\n        data.indexOfSearchBaseField = getInputRowMeta().indexOfValue( meta.getDynamicSearchFieldName() );\n        if ( data.indexOfSearchBaseField < 0 ) {\n          // The field is unreachable !\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPInput.Exception.CouldnotFindField\", meta\n            .getDynamicSearchFieldName() ) );\n        }\n      }\n      if ( meta.isDynamicFilter() ) {\n        data.indexOfFilterField = getInputRowMeta().indexOfValue( meta.getDynamicFilterFieldName() );\n        if ( data.indexOfFilterField < 0 ) {\n          // The field is unreachable !\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPInput.Exception.CouldnotFindField\", meta\n            .getDynamicFilterFieldName() ) );\n        }\n      }\n    } // end if\n\n    String searchBase = data.staticSearchBase;\n    if ( data.indexOfSearchBaseField > 0 ) {\n      // retrieve dynamic search base value\n      searchBase = getInputRowMeta().getString( data.readRow, data.indexOfSearchBaseField );\n    }","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPInput.java#L146-L182","documentation":"dynamicSearch() throws 'CouldnotFindField' when dynamic search is on, the field name is set, but getInputRowMeta().indexOfValue(dynamicSearchFieldName) returns -1 — the configured search-base field does not exist in the incoming row. The configured name is included in the message. Unlike error 3133, configuration exists but the field is unreachable in the actual row stream.","triggerScenarios":"Run with isDynamicSearch()==true and indexOfSearchBaseField < 0 because the field name in metadata doesn't match any field arriving at the step.","commonSituations":"Upstream step renamed/removed the DN field, field name differs in case or has trailing spaces, or the LDAP Input step sits directly after an input step that never produced that field.","solutions":["Compare the field name in the LDAP Input dialog against actual hop fields (right-click hop → 'Show fields').","Fix case/spelling mismatches between the configured name and the upstream field.","Insert/repair the upstream step that generates the DN field (e.g. a 'Get values' or previous input step)."],"exampleFix":"// before\nmeta.setDynamicSearchFieldName(\"Distinguished Name\");\n// after (matches actual upstream field)\nmeta.setDynamicSearchFieldName(\"dn\");","handlingStrategy":"validation","validationCode":"int idx = inputRowMeta.indexOfValue(meta.getDynamicSearchFieldName());\nif (idx < 0) throw new IllegalStateException(\"Field \" + meta.getDynamicSearchFieldName() + \" not found on incoming rows\");","typeGuard":null,"tryCatchPattern":"try { row = getOneRow(); } catch (KettleException e) { if (e.getMessage().contains(\"CouldnotFindField\")) { logError(\"Configured field no longer exists upstream: \" + e.getMessage()); } throw e; }","preventionTips":["Inspect hop fields ('Show fields') after any upstream change","Avoid renaming fields consumed by LDAP Input without updating the step","Pin field names with an explicit 'Select values' step upstream"],"tags":["ldap","row-metadata","field-lookup"],"backgroundTag":"resource-not-found","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"}