{"record":{"id":"5f84de52208eaa5d","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-step-information-to-the-repository-for-id-5f84de","errorCode":null,"errorMessage":"Unable to save step information to the repository for id_step=\" + id_step","messagePattern":"Unable to save step information to the repository for id_step=\" \\+ id_step","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/sortedmerge/SortedMergeMeta.java","lineNumber":155,"sourceCode":"      allocate( nrfields );\n\n      for ( int i = 0; i < nrfields; i++ ) {\n        fieldName[i] = rep.getStepAttributeString( id_step, i, \"field_name\" );\n        ascending[i] = rep.getStepAttributeBoolean( id_step, i, \"field_ascending\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unexpected error reading step information from the repository\", e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      for ( int i = 0; i < fieldName.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_name\", fieldName[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_ascending\", ascending[i] );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to save step information to the repository for id_step=\" + id_step, e );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,\n    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    // Set the sorted properties: ascending/descending\n    for ( int i = 0; i < fieldName.length; i++ ) {\n      int idx = inputRowMeta.indexOfValue( fieldName[i] );\n      if ( idx >= 0 ) {\n        ValueMetaInterface valueMeta = inputRowMeta.getValueMeta( idx );\n        valueMeta.setSortedDescending( !ascending[i] );\n\n        // TODO: add case insensivity\n      }\n    }\n\n  }","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/sortedmerge/SortedMergeMeta.java#L137-L173","documentation":"Thrown by SortedMergeMeta.saveRep when persisting this step's repository attributes (per-row field_name and field_ascending) fails. Kettle wraps any exception from Repository.saveStepAttribute into a KettleException carrying the step id, so transformation saves abort with a single root-caused message. It indicates a repository connectivity, schema, or data problem rather than a step-configuration problem.","triggerScenarios":"Calling TransMeta/StepMeta saveRep against a repository where the underlying database insert into Kettle's attribute tables fails — e.g. repository DB connection dropped mid-save, R_ATTRIBUTE table missing/locked, or fieldName/ascending arrays containing values that violate DB constraints (NULL in a NOT NULL column, string too long).","commonSituations":"Saving a transformation over a flaky VPN connection to the repository database; repository schema out of date after a Pentaho upgrade; Oracle 'value too large for column' on long field names; concurrent edits locking repository rows.","solutions":["Check the wrapped cause 'e' in the KettleException stack trace for the repository database error","Verify the repository database connection is alive (test in the repository connection dialog / ping the DB)","Repair or upgrade the repository schema (repository upgrade / SQL scripts for your PDI version)","Shorten field names or fix array data that violates DB column constraints","Retry the save after network issues are resolved"],"exampleFix":"// before\ntransMeta.saveRep(rep, metaStore, id_transformation);\n// throws KettleException 'Unable to save step information...'\n// after\ntry {\n  transMeta.saveRep(rep, metaStore, id_transformation);\n} catch (KettleException e) {\n  logError(\"Repository save failed: \" + e.getCause());\n  // reconnect repository, then retry\n  if (!rep.connect()) { rep.connect(); }\n  transMeta.saveRep(rep, metaStore, id_transformation);\n}","handlingStrategy":"try-catch","validationCode":"// before saving\nif (rep == null || !rep.isConnected()) throw new IllegalStateException(\"Repository not connected\");\nfor (String f : meta.getFieldName()) {\n  if (f == null || f.isEmpty()) throw new IllegalStateException(\"Empty field name in SortedMerge step\");\n}","typeGuard":null,"tryCatchPattern":"try { transMeta.saveRep(rep, metaStore, id_transformation); } catch (KettleException e) { Throwable cause = e.getCause(); logError(\"Repository save failed: \" + (cause != null ? cause.getMessage() : e.getMessage())); /* reconnect + retry */ }","preventionTips":["Keep the repository connection alive; reconnect before long save operations","Run repository schema upgrades after PDI version changes","Limit field name lengths to repository column sizes","Save a local .ktr copy before repository saves"],"tags":["repository","persistence","kettle"],"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"}