{"record":{"id":"556733550ba5d792","repo":"pentaho/pentaho-kettle","slug":"ldapoutput-error-olddnfieldmissing","errorCode":"LDAPOutput.Error.OldDNFieldMissing","errorMessage":"LDAPOutput.Error.OldDNFieldMissing","messagePattern":"LDAPOutput\\.Error\\.OldDNFieldMissing","errorType":"validation","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapoutput/LDAPOutput.java","lineNumber":124,"sourceCode":"          data.fieldsAttributeToUpdate = new String[data.nrfieldsToUpdate];\n          for ( int i = 0; i < fieldsToUpdateInStreaml.size(); i++ ) {\n            data.fieldStreamToUpdate[i] = fieldsToUpdateInStreaml.get( i );\n            data.fieldsAttributeToUpdate[i] = fieldsToUpdateAttributel.get( i );\n          }\n        }\n        fieldsToUpdateInStreaml = null;\n        fieldsToUpdateAttributel = null;\n\n        data.attributes = new String[data.nrfields];\n        if ( meta.getOperationType() == LDAPOutputMeta.OPERATION_TYPE_UPSERT && data.nrfieldsToUpdate > 0 ) {\n          data.attributesToUpdate = new String[data.nrfieldsToUpdate];\n        }\n      }\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 ) {","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapoutput/LDAPOutput.java#L106-L142","documentation":"Thrown in LDAPOutput.processRows when the operation type is RENAME but the configured 'Old DN' field name is empty (after environment substitution). Renaming an LDAP entry requires knowing the entry's current DN from an input field; without it the rename cannot be performed.","triggerScenarios":"meta.getOperationType() == OPERATION_TYPE_RENAME and Utils.isEmpty(environmentSubstitute(meta.getOldDnFieldName())) — the Old DN field was never set, or its variable resolved to empty.","commonSituations":"User switched the operation to 'Rename entry' but forgot to fill the Old DN / New DN field names; a variable holding the field name is undefined in the target environment; transformation copied with settings cleared.","solutions":["Open the LDAP Output dialog (Rename operation) and set the 'Old DN field name' to an incoming field containing the current DN","Also set the 'New DN field name' (the same check throws NewDNFieldMissing next)","Verify any variable used in these settings resolves at runtime","Ensure the upstream step actually emits a field with that name containing valid DNs"],"exampleFix":"// before\nOperation: Rename entry, Old DN field: (empty)\n// after\nOperation: Rename entry, Old DN field: old_dn, New DN field: new_dn","handlingStrategy":"validation","validationCode":"// Validate rename settings before execution\nLDAPOutputMeta meta = (LDAPOutputMeta) stepMeta.getStepMetaInterface();\nif (meta.getOperationType() == LDAPOutputMeta.OPERATION_TYPE_RENAME) {\n  if (meta.getOldDnFieldName() == null || meta.getOldDnFieldName().isEmpty()) {\n    throw new IllegalStateException(\"Rename requires an Old DN field name\");\n  }\n  if (meta.getNewDnFieldName() == null || meta.getNewDnFieldName().isEmpty()) {\n    throw new IllegalStateException(\"Rename requires a New DN field name\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  runTransformation();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"OldDNFieldMissing\") || e.getMessage().contains(\"NewDNFieldMissing\")) {\n    throw new IllegalStateException(\"Set Old DN / New DN field names in the LDAP Output rename settings\");\n  }\n  throw e;\n}","preventionTips":["Whenever switching the operation to Rename, fill both DN field names immediately","Confirm variables used for these settings are defined per environment","Ensure the upstream step emits fields containing valid current/new DNs"],"tags":["ldap","configuration","rename"],"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"}