{"record":{"id":"d984c3479522072e","repo":"pentaho/pentaho-kettle","slug":"ldapoutput-error-cannotfindfield","errorCode":"LDAPOutput.Error.CanNotFindField","errorMessage":"LDAPOutput.Error.CanNotFindField","messagePattern":"LDAPOutput\\.Error\\.CanNotFindField","errorType":"validation","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapoutput/LDAPOutput.java","lineNumber":137,"sourceCode":"      }\n\n      if ( meta.getOperationType() == LDAPOutputMeta.OPERATION_TYPE_RENAME ) {\n        String oldDnField = environmentSubstitute( meta.getOldDnFieldName() );\n        if ( Utils.isEmpty( oldDnField ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPOutput.Error.OldDNFieldMissing\" ) );\n        }\n\n        String newDnField = environmentSubstitute( meta.getNewDnFieldName() );\n        if ( Utils.isEmpty( newDnField ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPOutput.Error.NewDNFieldMissing\" ) );\n        }\n\n        // return the index of the field in the input stream\n        data.indexOfOldDNField = getInputRowMeta().indexOfValue( oldDnField );\n\n        if ( data.indexOfOldDNField < 0 ) {\n          // the field is unreachable!\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPOutput.Error.CanNotFindField\", oldDnField ) );\n        }\n        // return the index of the field in the input stream\n        data.indexOfNewDNField = getInputRowMeta().indexOfValue( newDnField );\n\n        if ( data.indexOfNewDNField < 0 ) {\n          // the field is unreachable!\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPOutput.Error.CanNotFindField\", newDnField ) );\n        }\n\n      } else {\n        String dnField = environmentSubstitute( meta.getDnField() );\n        // Check Dn field\n        if ( Utils.isEmpty( dnField ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPOutput.Error.DNFieldMissing\" ) );\n        }\n\n        // return the index of the field in the input stream\n        data.indexOfDNField = getInputRowMeta().indexOfValue( dnField );","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapoutput/LDAPOutput.java#L119-L155","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the step dialog and re-select the Old DN field from the dropdown so it matches a real incoming column","Use 'Preview' on the previous step to confirm the exact field name/type reaching LDAP Output","Fix the variable definition if the field name uses environment substitution"],"exampleFix":"// before\noldDnField = \"oldDistingueshedName\"; // typo\n// after\noldDnField = \"oldDistinguishedName\"; // matches stream field","handlingStrategy":"validation","validationCode":"int idx = getInputRowMeta().indexOfValue(oldDnField);\nif (idx < 0) {\n  throw new KettleException(\"Old DN field '\" + oldDnField + \"' not found in stream\");\n}","typeGuard":null,"tryCatchPattern":"try { step.processRow(); } catch (KettleException e) {\n  if (e.getMessage().contains(\"CanNotFindField\")) { logError(\"Re-map the Old DN field in the step dialog\"); }\n  throw e;\n}","preventionTips":["Pick fields from the dropdown rather than typing names","Re-open and re-save steps after upstream schema changes","Use Get Fields to refresh field mappings after modifying upstream steps"],"tags":["ldap","field-lookup","row-metadata"],"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"}