{"record":{"id":"f595e66027146eea","repo":"pentaho/pentaho-kettle","slug":"stepmeta-exception-unabletosavestepinfo","errorCode":"StepMeta.Exception.UnableToSaveStepInfo","errorMessage":"Unable to save step info to the repository for id_transformation={0}","messagePattern":"Unable to save step info to the repository for id_transformation=(.+?)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryStepDelegate.java","lineNumber":257,"sourceCode":"      compatibleSaveRep( stepMeta.getStepMetaInterface(), repository, transformationId, stepMeta.getObjectId() );\n      stepMeta.getStepMetaInterface().saveRep(\n        repository, repository.metaStore, transformationId, stepMeta.getObjectId() );\n\n      // Save the name of the clustering schema that was chosen.\n      //\n      repository.saveStepAttribute( transformationId, stepMeta.getObjectId(), \"cluster_schema\", stepMeta\n        .getClusterSchema() == null ? \"\" : stepMeta.getClusterSchema().getName() );\n\n      // Save the row distribution code (plugin ID)\n      //\n      repository.saveStepAttribute( transformationId, stepMeta.getObjectId(), \"row_distribution_code\", stepMeta\n        .getRowDistribution() == null ? null : stepMeta.getRowDistribution().getCode() );\n\n      // Save the attribute groups map\n      //\n      saveAttributesMap( transformationId, stepMeta.getObjectId(), stepMeta.getAttributesMap() );\n    } catch ( KettleException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"StepMeta.Exception.UnableToSaveStepInfo\", String\n        .valueOf( transformationId ) ), e );\n    }\n  }\n\n  @SuppressWarnings( \"deprecation\" )\n  private void compatibleSaveRep( StepMetaInterface stepMetaInterface, KettleDatabaseRepository repository,\n    ObjectId id_transformation, ObjectId objectId ) throws KettleException {\n    stepMetaInterface.saveRep( repository, id_transformation, objectId );\n  }\n\n  public void saveStepErrorMeta( StepErrorMeta meta, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    repository.saveStepAttribute( id_transformation, id_step, \"step_error_handling_source_step\", meta\n      .getSourceStep() != null ? meta.getSourceStep().getName() : \"\" );\n    repository.saveStepAttribute( id_transformation, id_step, \"step_error_handling_target_step\", meta\n      .getTargetStep() != null ? meta.getTargetStep().getName() : \"\" );\n    repository.saveStepAttribute( id_transformation, id_step, \"step_error_handling_is_enabled\", meta.isEnabled() );\n    repository.saveStepAttribute( id_transformation, id_step, \"step_error_handling_nr_valuename\", meta\n      .getNrErrorsValuename() );","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryStepDelegate.java#L239-L275","documentation":"saveStepMeta() wraps any KettleException raised while writing a step's fields and attributes into a KettleException 'Unable to save step info to the repository for id_transformation={0}', keeping the original as cause. It indicates the step metadata could not be persisted during transformation save.","triggerScenarios":"repository.stepDelegate.saveStepMeta(stepMeta, transformationId) fails on any of its database inserts/updates (step row insert, deprecated-plugin compatible save, row distribution code, attributes map save) — e.g. constraint violation, duplicate step name in the transformation, or DB write failure.","commonSituations":"Saving a transformation with two steps sharing the same name; repository table column too small for a plugin attribute; database read-only or disk full; concurrent saves of the same transformation.","solutions":["Check e.getCause() for the underlying SQL error (constraint, duplicate key, size limit) and correct the step metadata accordingly.","Ensure all step names within the transformation are unique before saving.","Verify the repository database is writable and the user has INSERT/UPDATE rights on R_STEP and attribute tables.","Re-save after fixing; if a partial save occurred, delete the half-saved transformation and re-save cleanly."],"exampleFix":"// before\nrepository.stepDelegate.saveStepMeta(stepMeta, transId);\n// after\nif (transMeta.findStep(stepMeta.getName()) != stepMeta) {\n  throw new KettleException(\"Duplicate step name: \" + stepMeta.getName());\n}\nrepository.stepDelegate.saveStepMeta(stepMeta, transId);","handlingStrategy":"validation","validationCode":"Set<String> names = new HashSet<>();\nfor (StepMeta s : transMeta.getSteps()) {\n  if (!names.add(s.getName())) throw new KettleException(\"Duplicate step name: \" + s.getName());\n}","typeGuard":null,"tryCatchPattern":"try {\n  repository.stepDelegate.saveStepMeta(stepMeta, transId);\n} catch (KettleException e) {\n  throw new KettleException(\"Step save failed: \" + e.getCause().getMessage(), e);\n}","preventionTips":["Enforce unique step names per transformation","Verify repository DB is writable and has sufficient column sizes","Avoid concurrent saves of the same transformation"],"tags":["database","repository","pentaho-kettle","database-write"],"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"}