{"record":{"id":"bbcdb6ecc9cb591d","repo":"pentaho/pentaho-kettle","slug":"ldapconnection-error-update","errorCode":"LDAPConnection.Error.Update","errorMessage":"LDAPConnection.Error.Update","messagePattern":"LDAPConnection\\.Error\\.Update","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java","lineNumber":325,"sourceCode":"          log\n            .logDebug( BaseMessages.getString( PKG, \"LDAPConnection.Update.Attribute\", attributes[i], values[i] ) );\n        }\n        // Save update action on attribute\n        mods[i] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, mod );\n      }\n      // We have all requested attribute\n      // let's update now\n      getInitialContext().modifyAttributes( dn, mods );\n      return STATUS_UPDATED;\n    } catch ( NameNotFoundException n ) {\n      // The entry is not found\n      if ( checkEntry ) {\n        throw new KettleException(\n          BaseMessages.getString( PKG, \"LDAPConnection.Error.Deleting.NameNotFound\", dn ), n );\n      }\n      return STATUS_SKIPPED;\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"LDAPConnection.Error.Update\", dn ), e );\n    }\n  }\n\n  public int add( String dn, String[] attributes, String[] values, String multValuedSeparator, boolean checkEntry ) throws KettleException {\n    try {\n      Attributes attrs = buildAttributes( dn, attributes, values, multValuedSeparator );\n      // We had all attributes\n      getInitialContext().modifyAttributes( dn, DirContext.ADD_ATTRIBUTE, attrs );\n      return STATUS_ADDED;\n    } catch ( NameNotFoundException n ) {\n      // The entry is not found\n      if ( checkEntry ) {\n        throw new KettleException(\n          BaseMessages.getString( PKG, \"LDAPConnection.Error.Deleting.NameNotFound\", dn ), n );\n      }\n      return STATUS_SKIPPED;\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"LDAPConnection.Error.Add\", dn ), e );","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java#L307-L343","documentation":"LDAPConnection.update(dn, attributes, values, checkEntry) wraps any non-NameNotFound exception from modifyAttributes() in a KettleException with message key 'LDAPConnection.Error.Update' (dn interpolated). The original javax.naming exception (permission problem, invalid attribute, schema violation, connection issue) is the cause.","triggerScenarios":"Updating with an attribute not defined in the schema for the entry's objectClass; modifying an attribute the bind user may not write (e.g. uid, entryDN); passing an attribute name that doesn't exist; connection dropped mid-operation.","commonSituations":"Bind account without write ACI on the target OU; trying to modify a operational/immutable attribute; schema in target directory (e.g. AD vs OpenLDAP) lacking the attribute; single-valued attribute receiving multiple values.","solutions":["Inspect e.getCause() (SchemaViolationException, NoPermissionException, InvalidAttributeValueException) and address the specific problem.","Grant write permission to the bind account on the target subtree.","Verify each attribute is allowed by the entry's objectClass schema.","Test the same modification with ldapmodify before running the transformation."],"exampleFix":"// before\nconnection.update(dn, new String[]{\"homePostalAddress\"}, new String[]{addr}, true);\n// after (use a schema-allowed attribute and ensure write rights)\nconnection.update(dn, new String[]{\"description\"}, new String[]{addr}, true);","handlingStrategy":"try-catch","validationCode":"// Validate attributes against schema before update\nfor (String attr : attrs) {\n  Attributes schema = ctx.getSchema(dn);\n  Attribute objClasses = ctx.getAttributes(dn).get(\"objectClass\");\n  // ensure attr is in the may/must list of the entry's objectClasses\n}","typeGuard":null,"tryCatchPattern":"try {\n  connection.update(dn, attrs, vals, true);\n} catch (KettleException e) {\n  Throwable root = ExceptionUtils.getRootCause(e);\n  if (root instanceof SchemaViolationException) { /* attribute not allowed / wrong syntax for objectClass */ }\n  else if (root instanceof NoPermissionException) { /* grant write ACI */ }\n  throw e;\n}","preventionTips":["Confirm each attribute is permitted by the entry's objectClass schema","Give the bind account write permission on the target OU","Test the exact modification with ldapmodify first","Avoid modifying operational/immutable attributes (uid, entryUUID, etc.)"],"tags":["ldap","kettle","update","jndi"],"backgroundTag":"database-write-failed","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"}