pentaho/pentaho-kettle · error · KettleException

AnalyticQueryMeta.Exception.UnexpectedErrorInReadingStepInfo…

Error message

AnalyticQueryMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository

What it means

Generic KettleException thrown by AnalyticQueryMeta.readRep() when any exception occurs while loading the Analytic Query step's attributes from a repository (per-aggregate 'aggregate_name', 'aggregate_subject', 'aggregate_type', 'aggregate_value_field' attributes). It is a catch-all wrapper: the real problem is the chained cause.

Solutions

  1. Check the chained cause and the repository's connectivity (database up, credentials valid, network reachable)
  2. Verify the step's attribute rows exist in the repository tables (KETTLE_STEP_ATTRIBUTE for the given id_step)
  3. Open and re-save the step in Spoon against the same repository to rewrite its attributes
  4. Migrate/re-export the transformation if it was saved with an incompatible Kettle version
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight repository access before loading the transformation
Repository rep = connectToRepository();
if (!rep.isConnected()) { throw new IllegalStateException("Repository unreachable"); }
// Optionally verify the step attribute rows exist for the expected id_step

Try / catch

try {
  transMeta.loadTransformation(rep, transObjectId, metaStore, true, null);
} catch (KettleException e) {
  log.error("Repository read failed: " + e.getMessage(), e.getCause());
  // check cause: connectivity vs missing attributes, then retry or fail over to file-based .ktr
}

Prevention

When it happens

Trigger: loadXML counterpart for the repository: rep.getStepAttributeString/getStepAttributeInteger calls throw (repository connection failure, missing id_step record, invalid stored attribute values) while looping over aggregates.

Common situations: Repository database down or connection dropped mid-load; step metadata rows deleted or partially migrated in KETTLE_STEP_ATTRIBUTES; loading a transformation saved by a different Kettle version with different attribute names.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


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

Appendix: source

Thrown at plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/analyticquery/AnalyticQueryMeta.java:343

      int groupsize = rep.countNrStepAttributes( id_step, "group_name" );
      int nrvalues = rep.countNrStepAttributes( id_step, "aggregate_name" );

      allocate( groupsize, nrvalues );

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

      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" ) );
        valueField[i] = (int) rep.getStepAttributeInteger( id_step, i, "aggregate_value_field" );
      }

    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "AnalyticQueryMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository" ), e );
    }
  }

  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
    try {

      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 ) {

View on GitHub (pinned to f3058517a1)