{"record":{"id":"3484491bb5d25e16","repo":"pentaho/pentaho-kettle","slug":"ldapoutput-error-dnfieldmissing","errorCode":"LDAPOutput.Error.DNFieldMissing","errorMessage":"LDAPOutput.Error.DNFieldMissing","messagePattern":"LDAPOutput\\.Error\\.DNFieldMissing","errorType":"validation","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapoutput/LDAPOutput.java","lineNumber":151,"sourceCode":"        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 );\n\n        if ( data.indexOfDNField < 0 ) {\n          // the field is unreachable!\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPOutput.Error.CanNotFindField\", dnField ) );\n        }\n      }\n\n    }\n\n    incrementLinesInput();\n    String dn = null;\n\n    try {\n      if ( meta.getOperationType() != LDAPOutputMeta.OPERATION_TYPE_RENAME ) {","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapoutput/LDAPOutput.java#L133-L169","documentation":"In non-rename mode (Insert/Update/Delete), the step requires a single 'DN field' containing the entry's distinguished name; when meta.getDnField() is empty after substitution it throws LDAPOutput.Error.DNFieldMissing.","triggerScenarios":"LDAP Output in Insert, Update, or Delete mode with no DN field configured, or the DN field name resolves to empty via an undefined variable.","commonSituations":"Freshly added step never fully configured; transformation migrated between environments where the DN field variable is undefined; user switched modes and the DN field was cleared.","solutions":["Set the 'DN field' option in the LDAP Output dialog to a column from the incoming stream","Define any variable used in the DN field name (kettle.properties or Set Variables)","Verify the operation mode; rename mode uses Old/New DN fields instead, so configure those if renaming"],"exampleFix":"// before\n<dn_field/>\n// after\n<dn_field>dn</dn_field>","handlingStrategy":"validation","validationCode":"String dnField = environmentSubstitute(meta.getDnField());\nif (Utils.isEmpty(dnField)) {\n  throw new KettleException(\"DN field must be configured on LDAP Output\");\n}","typeGuard":null,"tryCatchPattern":"try { step.processRow(); } catch (KettleException e) {\n  if (e.getMessage().contains(\"DNFieldMissing\")) { logError(\"Set the DN field in the LDAP Output dialog\"); }\n  throw e;\n}","preventionTips":["Configure DN field immediately after adding the step","Define variables used in field names before deployment","Use transformation-level validation/check features (step 'check' results) before running"],"tags":["ldap","configuration","missing-field"],"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"}