pentaho/pentaho-kettle · error · KettleException

MemoryGroupByMeta.Exception.UnableToSaveStepInfoToRepository

MemoryGroupByMeta.Exception.UnableToSaveStepInfoToRepository

Error message

MemoryGroupByMeta.Exception.UnableToSaveStepInfoToRepository

What it means

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.

Solutions

  1. Inspect the cause for the database error (connection, permissions, constraints) and fix it.
  2. Reconnect to the repository and retry the save.
  3. Verify the repository account has write rights on R_STEP_ATTRIBUTE.
  4. Save the transformation to a local .ktr file if the target repository is read-only, and coordinate a proper DBA-assisted save later.

Example fix

// before
meta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());

// after: retry once after reconnect
try {
  meta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());
} catch (KettleException e) {
  repository.disconnect();
  repository.connect(user, password);
  meta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (repository.isReadOnly()) {
  throw new IllegalStateException("Repository read-only; MemoryGroupBy step cannot be saved");
}
if (!repository.isConnected()) {
  repository.connect(user, password);
}

Type guard

boolean canPersist(Repository rep) {
  return rep != null && rep.isConnected() && !rep.isReadOnly();
}

Try / catch

try {
  meta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());
} catch (KettleException e) {
  logError("MemoryGroupBy save failed: " + e.getCause(), e);
  // fallback: export to local file
  transMeta.exportToFile(Paths.get("fallback.ktr"));
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/080938d12aa4cc4b. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/memgroupby/MemoryGroupByMeta.java:512

  }

  @Override
  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
    try {
      rep.saveStepAttribute( id_transformation, id_step, "give_back_row", alwaysGivingBackOneRow );

      for ( int i = 0; i < groupField.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "group_name", groupField[i] );
      }

      for ( int i = 0; i < subjectField.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "aggregate_name", aggregateField[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "aggregate_subject", subjectField[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "aggregate_type", getTypeDesc( aggregateType[i] ) );
        rep.saveStepAttribute( id_transformation, id_step, i, "aggregate_value_field", valueField[i] );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "MemoryGroupByMeta.Exception.UnableToSaveStepInfoToRepository" )
        + id_step, e );
    }
  }

  @Override
  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ) {
    CheckResult cr;

    if ( input.length > 0 ) {
      cr =
        new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(
          PKG, "MemoryGroupByMeta.CheckResult.ReceivingInfoOK" ), stepMeta );
      remarks.add( cr );
    } else {
      cr =

View on GitHub (pinned to f3058517a1)