{"record":{"id":"6e6c894dd8f9c8a0","repo":"pentaho/pentaho-kettle","slug":"ldapinputmeta-exception-errorsavingtorepository","errorCode":"LDAPInputMeta.Exception.ErrorSavingToRepository","errorMessage":"LDAPInputMeta.Exception.ErrorSavingToRepository","messagePattern":"LDAPInputMeta\\.Exception\\.ErrorSavingToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPInputMeta.java","lineNumber":905,"sourceCode":"        rep.saveStepAttribute( id_transformation, id_step, i, \"field_name\", field.getName() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_attribute\", field.getAttribute() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_attribute_fetch_as\", field\n          .getFetchAttributeAsCode() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"sorted_key\", field.isSortedKey() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_type\", field.getTypeDesc() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_format\", field.getFormat() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_currency\", field.getCurrencySymbol() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_decimal\", field.getDecimalSymbol() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_group\", field.getGroupSymbol() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_length\", field.getLength() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_precision\", field.getPrecision() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_trim_type\", field.getTrimTypeCode() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_repeat\", field.isRepeated() );\n\n      }\n      rep.saveStepAttribute( id_transformation, id_step, \"searchScope\", getSearchScopeCode( searchScope ) );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"LDAPInputMeta.Exception.ErrorSavingToRepository\", \"\" + id_step ), e );\n    }\n  }\n\n  @Override\n  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,\n    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,\n    Repository repository, IMetaStore metaStore ) {\n\n    CheckResult cr;\n\n    // Check output fields\n    if ( inputFields.length == 0 ) {\n      cr =\n        new CheckResult( CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(\n          PKG, \"LDAPInputMeta.CheckResult.NoOutputFields\" ), stepMeta );\n    } else {\n      cr =","sourceCodeStart":887,"sourceCodeEnd":923,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPInputMeta.java#L887-L923","documentation":"This KettleException is thrown by LDAPInputMeta.saveRep() when saving any of the LDAP Input step's attributes to the Pentaho repository fails. The repository layer (rep.saveStepAttribute) signals a persistence problem (connection, schema, or constraint issue) and this wraps it with the step id for context. It indicates the transformation could not be persisted, not that the LDAP step itself is misconfigured.","triggerScenarios":"Any Exception from rep.saveStepAttribute(...) while persisting LDAP Input fields: trim type codes, repeat flags, search scope, or connection attributes during saveRep with a repository-backed transformation.","commonSituations":"Repository database is down or connection dropped mid-save; repository schema is outdated (missing kettle attribute tables/columns); repository user lacks INSERT/UPDATE permissions; saving an oversized value exceeding a column length.","solutions":["Check the underlying cause exception (getCause) for the repository/database error and fix that first","Verify the repository database is reachable and credentials/permissions allow writes","Run the repository upgrade scripts so the schema matches the Pentaho version","Save the transformation as a file (.ktr) as a workaround while repairing the repository"],"exampleFix":"// before\ntry { transMeta.saveRep(rep, repoDirectory, transName, desc); } catch (KettleException e) { /* check cause */ }\n// after\ntry {\n  transMeta.saveRep(rep, repoDirectory, transName, desc);\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  log.logError(\"Repository save failed (check DB connectivity/schema): \" + cause, cause);\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// Before saving: verify repository connectivity\nif (rep == null || !rep.isConnected()) { throw new IllegalStateException(\"Repository not connected\"); }","typeGuard":null,"tryCatchPattern":"try {\n  transMeta.saveRep(rep, dir, name, desc);\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  log.error(\"LDAP Input step could not be saved (step id \" + e.getMessage() + \")\", cause);\n  // inspect cause: DB connectivity / schema / permissions\n}","preventionTips":["Keep the repository schema upgraded to match the Pentaho version","Grant the repository user write privileges","Test repository saves with a trivial transformation after DB maintenance"],"tags":["kettle","repository","persistence"],"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"}