{"record":{"id":"28b61077f4f6c546","repo":"pentaho/pentaho-kettle","slug":"aggregaterowsmeta-exception-unabletosavestepinfo","errorCode":"AggregateRowsMeta.Exception.UnableToSaveStepInfo","errorMessage":"AggregateRowsMeta.Exception.UnableToSaveStepInfo","messagePattern":"AggregateRowsMeta\\.Exception\\.UnableToSaveStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/aggregate-rows/core/src/main/java/org/pentaho/di/trans/steps/aggregaterows/AggregateRowsMeta.java","lineNumber":300,"sourceCode":"        aggregateType[i] = getType( rep.getStepAttributeString( id_step, i, \"field_type\" ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"AggregateRowsMeta.Exception.UnexpectedErrorWhileReadingStepInfo\" ), e );\n    }\n\n  }\n\n  @Override\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_rename\", fieldNewName[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_type\", getTypeDesc( aggregateType[i] ) );\n      }\n    } catch ( KettleException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"AggregateRowsMeta.Exception.UnableToSaveStepInfo\" )\n        + 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    String message = \"\";\n\n    if ( fieldName.length > 0 ) {\n      boolean error_found = false;\n      // See if all fields are available in the input stream...\n      message =\n        BaseMessages.getString( PKG, \"AggregateRowsMeta.CheckResult.FieldsNotFound.DialogMessage\" ) + Const.CR;\n      for ( int i = 0; i < fieldName.length; i++ ) {","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/aggregate-rows/core/src/main/java/org/pentaho/di/trans/steps/aggregaterows/AggregateRowsMeta.java#L282-L318","documentation":"AggregateRowsMeta.saveRep persists the step's fields to a repository and throws KettleException with this localized message (plus the step id appended) when a saveStepAttribute call fails. It means the step's metadata could not be written to the repository.","triggerScenarios":"saveRep is called while the repository connection is broken, the transaction is in a bad state, a saveStepAttribute throws KettleException due to a database constraint, or the transformation/step ids are stale (step deleted concurrently).","commonSituations":"Repository database down or read-only during save; saving after another user deleted the transformation; repository schema version mismatch after upgrade; network drop mid-save.","solutions":["Check repository connectivity and that the database is writable; retry the save.","Reopen the transformation fresh from the repository to get valid ids, then re-save.","Inspect the wrapped cause for the underlying SQL error (constraints, lock timeouts).","Verify the repository schema is migrated to the current PDI version."],"exampleFix":"// before\nstepMeta.saveMeta(rep, transMeta); // fails silently upstream, KettleException here\n// after\ntry {\n  stepMeta.saveMeta(rep, transMeta);\n} catch (KettleException e) {\n  // reload transformation to refresh id_step, ensure repo writable, then retry\n  throw new KettleException(\"Save failed for step \" + e.getMessage() + \"; refresh and retry\", e);\n}","handlingStrategy":"retry","validationCode":"// Ensure ids are fresh before saving\nif (id_step <= 0) throw new IllegalStateException(\"Stale step id; reload transformation from repository first\");","typeGuard":null,"tryCatchPattern":"try {\n  meta.saveRep(rep, ...);\n} catch (KettleException e) {\n  logger.error(\"Repository write failed: \" + e.getCause(), e);\n  // reload transformation to refresh ids and confirm repo is writable, then retry\n}","preventionTips":["Confirm the repository database is writable and not in read-only mode.","Reload the transformation before saving if others may have modified or deleted it.","Watch for network instability during repository saves; retry idempotently."],"tags":["kettle","repository","step-metadata","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"}