pentaho/pentaho-kettle · error · KettleException

ScriptValuesMetaMod.Exception.UnexpectedErrorInReadingStepIn…

Error message

ScriptValuesMetaMod.Exception.UnexpectedErrorInReadingStepInfo

What it means

Kettle wraps any unexpected exception thrown while reading this ScriptValuesMod step's configuration back from the repository (readRep) into a KettleException with this message. It means the step metadata could not be loaded from the repository database, so the transformation cannot be initialized. The original cause is attached as the nested exception.

Solutions

  1. Check the nested cause (getCause()) in the log to see the real repository or parsing error
  2. Verify the Kettle repository database is reachable and credentials/connection settings are valid
  3. Inspect the r_step_attribute rows for this step id and fix/clean corrupted 'field_type'/'field_length'/'field_precision' values
  4. Re-export/recreate the step metadata; reopen the transformation in Spoon to re-save it
  5. Upgrade/align engine and repository plugin versions so stored value-type names match ValueMetaFactory

Example fix

// before: unknown stored type breaks readRep
rep.getStepAttributeString(id_step, i, "field_type") -> "StringX"
// after: sanitize the stored value before saving, or fix the row
UPDATE r_step_attribute SET VALUE_STR='String' WHERE ID_STEP=? AND CODE='field_type' AND VALUE_STR='StringX';
Defensive patterns

Strategy: try-catch

Validate before calling

// before loadTransformation: verify repository connectivity
if (repository == null || !repository.isConnected()) {
  repository.connect(repoMeta.getUsername(), repoMeta.getPassword());
}

Try / catch

try {
  transMeta = new TransMeta(repository, transName, directory, metaStore);
} catch (KettleException e) {
  if (e.getMessage().contains("UnexpectedErrorInReadingStepInfo")) {
    logError("Repository read failed for step metadata: " + e.getCause(), e);
    // fail fast or fall back to loading from XML export
  } else throw e;
}

Prevention

When it happens

Trigger: Repository.getStepAttributeString/getStepAttributeInteger/getStepAttributeBoolean throw (repository connection lost, database error, invalid id_step/ObjectId) or ValueMetaFactory.getIdForValueMeta encounters an unknown 'field_type' string stored in the repository.

Common situations: Repository database briefly unavailable or connection dropped while opening a transformation; corrupted or hand-edited r_step_attribute rows (e.g. a non-numeric field_type); restoring a transformation from an export with incompatible field type names; id_step pointing at a deleted step.

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/843a82988b19cf00. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesMetaMod.java:515

            (int) rep.getStepAttributeInteger( id_step, i, JSSCRIPT_TAG_TYPE ),
            rep.getStepAttributeString( id_step, i, JSSCRIPT_TAG_NAME ),
            rep.getStepAttributeString( id_step, i, JSSCRIPT_TAG_SCRIPT ) );
        }
      }

      int nrfields = rep.countNrStepAttributes( id_step, "field_name" );
      allocate( nrfields );

      for ( int i = 0; i < nrfields; i++ ) {
        fieldname[i] = rep.getStepAttributeString( id_step, i, "field_name" );
        rename[i] = rep.getStepAttributeString( id_step, i, "field_rename" );
        type[i] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "field_type" ) );
        length[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_length" );
        precision[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_precision" );
        replace[i] = rep.getStepAttributeBoolean( id_step, i, "field_replace" );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "ScriptValuesMetaMod.Exception.UnexpectedErrorInReadingStepInfo" ), e );
    }
  }

  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
    try {
      rep.saveStepAttribute( id_transformation, id_step, 0, "compatible", compatible );
      rep.saveStepAttribute( id_transformation, id_step, 0, "optimizationLevel", optimizationLevel );

      for ( int i = 0; i < jsScripts.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, JSSCRIPT_TAG_NAME, jsScripts[i].getScriptName() );
        rep.saveStepAttribute( id_transformation, id_step, i, JSSCRIPT_TAG_SCRIPT, jsScripts[i].getScript() );
        rep.saveStepAttribute( id_transformation, id_step, i, JSSCRIPT_TAG_TYPE, jsScripts[i].getScriptType() );
      }

      for ( int i = 0; i < fieldname.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "field_name", fieldname[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_rename", rename[i] );

View on GitHub (pinned to f3058517a1)