{"record":{"id":"080938d12aa4cc4b","repo":"pentaho/pentaho-kettle","slug":"memorygroupbymeta-exception-unabletosavestepinfotorepository","errorCode":"MemoryGroupByMeta.Exception.UnableToSaveStepInfoToRepository","errorMessage":"MemoryGroupByMeta.Exception.UnableToSaveStepInfoToRepository","messagePattern":"MemoryGroupByMeta\\.Exception\\.UnableToSaveStepInfoToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/memgroupby/MemoryGroupByMeta.java","lineNumber":512,"sourceCode":"  }\n\n  @Override\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, \"give_back_row\", alwaysGivingBackOneRow );\n\n      for ( int i = 0; i < groupField.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"group_name\", groupField[i] );\n      }\n\n      for ( int i = 0; i < subjectField.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"aggregate_name\", aggregateField[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"aggregate_subject\", subjectField[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"aggregate_type\", getTypeDesc( aggregateType[i] ) );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"aggregate_value_field\", valueField[i] );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"MemoryGroupByMeta.Exception.UnableToSaveStepInfoToRepository\" )\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    CheckResult cr;\n\n    if ( input.length > 0 ) {\n      cr =\n        new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(\n          PKG, \"MemoryGroupByMeta.CheckResult.ReceivingInfoOK\" ), stepMeta );\n      remarks.add( cr );\n    } else {\n      cr =","sourceCodeStart":494,"sourceCodeEnd":530,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/memgroupby/MemoryGroupByMeta.java#L494-L530","documentation":"MemoryGroupByMeta.saveRep() persists the step's grouping and aggregation definitions as repository step attributes. If any saveStepAttribute call throws, the exception is wrapped in a KettleException with this message key, meaning the step's configuration was not saved and the repository copy of the transformation is stale. The root database error is chained as the cause.","triggerScenarios":"Calling saveRep() when writing aggregate_name/aggregate_subject/aggregate_type/aggregate_value_field attributes fails — repository connection lost, read-only database, constraint violation, or oversized/invalid attribute values.","commonSituations":"Saving while the repository DB is down or the session timed out; DB user lacking INSERT/UPDATE on R_STEP_ATTRIBUTE; shared read-only production repositories; large field lists hitting column size limits.","solutions":["Inspect the cause for the database error (connection, permissions, constraints) and fix it.","Reconnect to the repository and retry the save.","Verify the repository account has write rights on R_STEP_ATTRIBUTE.","Save the transformation to a local .ktr file if the target repository is read-only, and coordinate a proper DBA-assisted save later."],"exampleFix":"// before\nmeta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());\n\n// after: retry once after reconnect\ntry {\n  meta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());\n} catch (KettleException e) {\n  repository.disconnect();\n  repository.connect(user, password);\n  meta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());\n}","handlingStrategy":"try-catch","validationCode":"if (repository.isReadOnly()) {\n  throw new IllegalStateException(\"Repository read-only; MemoryGroupBy step cannot be saved\");\n}\nif (!repository.isConnected()) {\n  repository.connect(user, password);\n}","typeGuard":"boolean canPersist(Repository rep) {\n  return rep != null && rep.isConnected() && !rep.isReadOnly();\n}","tryCatchPattern":"try {\n  meta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());\n} catch (KettleException e) {\n  logError(\"MemoryGroupBy save failed: \" + e.getCause(), e);\n  // fallback: export to local file\n  transMeta.exportToFile(Paths.get(\"fallback.ktr\"));\n  throw e;\n}","preventionTips":["Verify DB write permissions for the repository user.","Retry saves after transient connection drops.","Don't exceed attribute column size limits with huge field lists.","Fall back to local .ktr export when the repository is unavailable."],"tags":["kettle","repository","step-metadata","persistence"],"backgroundTag":"file-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"}