pentaho/pentaho-kettle · error · KettleException

Unexpected error reading step information from the…

Error message

Unexpected error reading step information from the repository

What it means

TableInputMeta.readRep() loads the step's settings (SQL, lookup key, row metadata cache) from repository step attributes and wraps any failure in a generic KettleException. The message covers XML parsing of the cached row metadata (sRowMeta -> DocumentElement -> new RowMeta(node)) as well as attribute reads and database meta lookup. It means the stored step definition could not be read back from the repository.

Solutions

  1. Inspect the cause chain to see whether the failure is XML parsing or an attribute/DB read
  2. Open the transformation in Spoon and re-save the TableInput step to regenerate the cached row metadata
  3. Verify repository connectivity and that r_step_attribute rows for this id_step are intact
  4. Compare against the same .ktr loaded from file to isolate repository vs metadata corruption

Example fix

// before
cachedRowMeta = new RowMeta( node ); // throws on malformed XML
// after
if ( node != null && node.hasChildNodes() ) {
  cachedRowMeta = new RowMeta( node );
} else {
  logDebug( "No cached row metadata in repository; will recompute at runtime" );
}
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the step attributes decode before full load
String sRowMeta = rep.getStepAttributeString( id_step, "rowMeta" );
if ( sRowMeta != null && !sRowMeta.isEmpty() ) {
  byte[] bytes = Base64.getDecoder().decode( sRowMeta );
  if ( bytes.length == 0 ) throw new IllegalStateException( "Empty cached row meta" );
}

Try / catch

try {
  transMeta.loadTrans( ... );
} catch ( KettleException e ) {
  if ( e.getMessage().contains( "Unexpected error reading step information" ) ) {
    // fall back to loading the .ktr from file, or reload with cached row meta cleared
  } else { throw e; }
}

Prevention

When it happens

Trigger: readRep() is called when a transformation containing a TableInput step is loaded from a repository, and any repository attribute read, Base64/byte decode of sRowMeta, or DOM XML parsing of that cached row metadata throws (corrupt/empty attribute value, malformed XML, wrong node type, missing DB connection).

Common situations: Manually edited or partially migrated repository rows; ktr XML upgraded/downgraded between Pentaho versions leaving an incompatible cached row-meta blob; repository connectivity interruption mid-load; corrupt r_step_attribute values.

Understand the failure class

Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/tableinput/TableInputMeta.java:369

      StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 );
      infoStream.setSubject( lookupFromStepname );

      executeEachInputRow = rep.getStepAttributeBoolean( id_step, "execute_each_row" );
      variableReplacementActive = rep.getStepAttributeBoolean( id_step, "variables_active" );
      lazyConversionActive = rep.getStepAttributeBoolean( id_step, "lazy_conversion_active" );
      cachedRowMetaActive = rep.getStepAttributeBoolean( id_step, "cached_row_meta_active" );

      String sRowMeta = rep.getStepAttributeString( id_step, RowMeta.XML_META_TAG );
      if ( sRowMeta != null ) {
        Node node = XmlParserFactoryProducer.createSecureDocBuilderFactory()
          .newDocumentBuilder()
          .parse( new ByteArrayInputStream( sRowMeta.getBytes() ) )
          .getDocumentElement();
        cachedRowMeta = new RowMeta( node );
      }

    } catch ( Exception e ) {
      throw new KettleException( "Unexpected error reading step information from the repository", e );
    }
  }

  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
    try {
      rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", databaseMeta );
      rep.saveStepAttribute( id_transformation, id_step, "sql", sql );
      rep.saveStepAttribute( id_transformation, id_step, "limit", rowLimit );
      StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 );
      rep.saveStepAttribute( id_transformation, id_step, "lookup", infoStream.getStepname() );
      rep.saveStepAttribute( id_transformation, id_step, "execute_each_row", executeEachInputRow );
      rep.saveStepAttribute( id_transformation, id_step, "variables_active", variableReplacementActive );
      rep.saveStepAttribute( id_transformation, id_step, "lazy_conversion_active", lazyConversionActive );
      rep.saveStepAttribute( id_transformation, id_step, "cached_row_meta_active", cachedRowMetaActive );
      if ( cachedRowMeta != null ) {
        rep.saveStepAttribute( id_transformation, id_step, RowMeta.XML_META_TAG, cachedRowMeta.getMetaXML() );
      }

View on GitHub (pinned to f3058517a1)