{"record":{"id":"2e8a8f5da851747a","repo":"pentaho/pentaho-kettle","slug":"detectlastrowmeta-exception-unabletosavestepinfo","errorCode":"DetectLastRowMeta.Exception.UnableToSaveStepInfo","errorMessage":"DetectLastRowMeta.Exception.UnableToSaveStepInfo","messagePattern":"DetectLastRowMeta\\.Exception\\.UnableToSaveStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/detectlastrow/DetectLastRowMeta.java","lineNumber":125,"sourceCode":"      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"DetectLastRowMeta.Exception.UnableToReadStepInfo\" ), e );\n    }\n  }\n\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {\n    try {\n      resultfieldname = rep.getStepAttributeString( id_step, \"resultfieldname\" );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"DetectLastRowMeta.Exception.UnexpectedErrorReadingStepInfo\" ), e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, \"resultfieldname\", resultfieldname );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"DetectLastRowMeta.Exception.UnableToSaveStepInfo\" )\n        + id_step, e );\n    }\n  }\n\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    CheckResult cr;\n    String error_message = \"\";\n\n    if ( Utils.isEmpty( resultfieldname ) ) {\n      error_message = BaseMessages.getString( PKG, \"DetectLastRowMeta.CheckResult.ResultFieldMissing\" );\n      cr = new CheckResult( CheckResult.TYPE_RESULT_ERROR, error_message, stepMeta );\n      remarks.add( cr );\n    } else {\n      error_message = BaseMessages.getString( PKG, \"DetectLastRowMeta.CheckResult.ResultFieldOK\" );\n      cr = new CheckResult( CheckResult.TYPE_RESULT_OK, error_message, stepMeta );\n      remarks.add( cr );","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/detectlastrow/DetectLastRowMeta.java#L107-L143","documentation":"DetectLastRowMeta.saveRep wraps any exception while saving the step's attributes to a Kettle repository into a KettleException with this localized message plus the step id. The underlying repository write failure is chained as the cause.","triggerScenarios":"Saving a transformation containing a DetectLastRow step when rep.saveStepAttribute throws: repository connection lost, read-only database, constraint violation, or oversized attribute value.","commonSituations":"Repository database read-only or out of disk space; network interruption during save; saving across incompatible Pentaho versions; invalid result field name values hitting database constraints.","solutions":["Inspect the chained cause for the underlying database/repository error","Verify the repository is writable and has free space","Re-save after reconnecting to the repository","Shorten or sanitize the result field name if a database constraint is the cause"],"exampleFix":"// before\n} catch ( Exception e ) {\n  throw new KettleException( BaseMessages.getString( PKG, \"DetectLastRowMeta.Exception.UnableToSaveStepInfo\" ) + id_step, e );\n}\n// after: log full cause before rethrowing\n} catch ( Exception e ) {\n  logError( \"Unable to save DetectLastRow step \" + id_step, e );\n  throw new KettleException( BaseMessages.getString( PKG, \"DetectLastRowMeta.Exception.UnableToSaveStepInfo\" ) + id_step, e );\n}","handlingStrategy":"try-catch","validationCode":"// before saving, verify repository is connected and writable\nif ( repository == null || !repository.isConnected() ) {\n  throw new KettleException(\"Repository not connected; cannot save transformation\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  repository.save(transMeta, versionComment, null, metaStore);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"UnableToSaveStepInfo\")) {\n    log.error(\"Save failed for DetectLastRow step; cause: \" + e.getCause(), e);\n  }\n  throw e;\n}","preventionTips":["Ensure repository database is writable with sufficient space","Avoid invalid characters in result field names","Save regularly so a failure isolates recent changes","Log the chained cause, not just the wrapper message"],"tags":["kettle","repository","persistence","step-metadata"],"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"}