pentaho/pentaho-kettle · error · KettleException

MemoryGroupByMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository

MemoryGroupByMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository

Error message

MemoryGroupByMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository

What it means

MemoryGroupByMeta.readRep() loads the step's configuration from repository attributes (group fields, aggregate fields, types, value fields, give_back_row). Any exception during these repository reads is wrapped in a KettleException with this message key, indicating the stored step metadata could not be read. The underlying repository/database error is preserved as the cause.

Solutions

  1. Verify repository connectivity and reconnect, then retry loading the transformation.
  2. Examine the cause exception for the database-level error and address it (missing rows, bad data, permissions).
  3. Confirm the step's rows in R_STEP_ATTRIBUTE exist and are consistent; re-create the step in Spoon and re-save if corrupt.
  4. If the transformation came from a different Pentaho/plugin version, migrate it and re-save before loading in production.

Example fix

// before
meta.readRep(repository, metastore, transObjectId, stepObjectId);

// after: guard against stale connections and log the root cause
try {
  meta.readRep(repository, metastore, transObjectId, stepObjectId);
} catch (KettleException e) {
  logError("Reading MemoryGroupBy metadata failed: " + e.getCause(), e);
  repository.disconnect();
  repository.connect(user, password);
  meta.readRep(repository, metastore, transObjectId, stepObjectId);
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (repository == null || !repository.isConnected()) {
  repository.connect(user, password);
}
// verify the step metadata rows exist
if (!repository.stepExists(stepName)) {
  throw new IllegalStateException("Step not found in repository: " + stepName);
}

Type guard

boolean canReadStep(Repository rep, ObjectId idStep) {
  return rep != null && rep.isConnected() && idStep != null && !idStep.isEmpty();
}

Try / catch

try {
  meta.readRep(repository, metastore, transObjectId, stepObjectId);
} catch (KettleException e) {
  logError("MemoryGroupBy repository read failed: " + e.getCause(), e);
  throw e;
}

Prevention

When it happens

Trigger: Calling readRep() when Repository.getStepAttributeString/Boolean/Integer throws — lost repository connection, id_step referencing a nonexistent or partially deleted step, or attribute values that fail type conversion (e.g. non-numeric stored where an int is expected).

Common situations: Repository database restarted or network blip during transformation load; steps deleted directly in the DB; corrupted R_STEP_ATTRIBUTE rows from a failed save; loading transformations saved by an incompatible plugin version.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

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

        groupField[i] = rep.getStepAttributeString( id_step, i, "group_name" );
      }

      boolean hasNumberOfValues = false;
      for ( int i = 0; i < nrvalues; i++ ) {
        aggregateField[i] = rep.getStepAttributeString( id_step, i, "aggregate_name" );
        subjectField[i] = rep.getStepAttributeString( id_step, i, "aggregate_subject" );
        aggregateType[i] = getType( rep.getStepAttributeString( id_step, i, "aggregate_type" ) );

        if ( aggregateType[i] == TYPE_GROUP_COUNT_ALL
          || aggregateType[i] == TYPE_GROUP_COUNT_DISTINCT || aggregateType[i] == TYPE_GROUP_COUNT_ANY ) {
          hasNumberOfValues = true;
        }
        valueField[i] = rep.getStepAttributeString( id_step, i, "aggregate_value_field" );
      }

      alwaysGivingBackOneRow = rep.getStepAttributeBoolean( id_step, 0, "give_back_row", hasNumberOfValues );
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "MemoryGroupByMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository" ), e );
    }
  }

  @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] );

View on GitHub (pinned to f3058517a1)