{"record":{"id":"689d25e9296e2822","repo":"pentaho/pentaho-kettle","slug":"unexpected-error-reading-step-information-from-the-689d25","errorCode":null,"errorMessage":"Unexpected error reading step information from the repository","messagePattern":"Unexpected error reading step information from the repository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tableinput/TableInputMeta.java","lineNumber":369,"sourceCode":"      StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 );\n      infoStream.setSubject( lookupFromStepname );\n\n      executeEachInputRow = rep.getStepAttributeBoolean( id_step, \"execute_each_row\" );\n      variableReplacementActive = rep.getStepAttributeBoolean( id_step, \"variables_active\" );\n      lazyConversionActive = rep.getStepAttributeBoolean( id_step, \"lazy_conversion_active\" );\n      cachedRowMetaActive = rep.getStepAttributeBoolean( id_step, \"cached_row_meta_active\" );\n\n      String sRowMeta = rep.getStepAttributeString( id_step, RowMeta.XML_META_TAG );\n      if ( sRowMeta != null ) {\n        Node node = XmlParserFactoryProducer.createSecureDocBuilderFactory()\n          .newDocumentBuilder()\n          .parse( new ByteArrayInputStream( sRowMeta.getBytes() ) )\n          .getDocumentElement();\n        cachedRowMeta = new RowMeta( node );\n      }\n\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unexpected error reading step information from the repository\", e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, \"id_connection\", databaseMeta );\n      rep.saveStepAttribute( id_transformation, id_step, \"sql\", sql );\n      rep.saveStepAttribute( id_transformation, id_step, \"limit\", rowLimit );\n      StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 );\n      rep.saveStepAttribute( id_transformation, id_step, \"lookup\", infoStream.getStepname() );\n      rep.saveStepAttribute( id_transformation, id_step, \"execute_each_row\", executeEachInputRow );\n      rep.saveStepAttribute( id_transformation, id_step, \"variables_active\", variableReplacementActive );\n      rep.saveStepAttribute( id_transformation, id_step, \"lazy_conversion_active\", lazyConversionActive );\n      rep.saveStepAttribute( id_transformation, id_step, \"cached_row_meta_active\", cachedRowMetaActive );\n      if ( cachedRowMeta != null ) {\n        rep.saveStepAttribute( id_transformation, id_step, RowMeta.XML_META_TAG, cachedRowMeta.getMetaXML() );\n      }\n","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tableinput/TableInputMeta.java#L351-L387","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Inspect the cause chain to see whether the failure is XML parsing or an attribute/DB read","Open the transformation in Spoon and re-save the TableInput step to regenerate the cached row metadata","Verify repository connectivity and that r_step_attribute rows for this id_step are intact","Compare against the same .ktr loaded from file to isolate repository vs metadata corruption"],"exampleFix":"// before\ncachedRowMeta = new RowMeta( node ); // throws on malformed XML\n// after\nif ( node != null && node.hasChildNodes() ) {\n  cachedRowMeta = new RowMeta( node );\n} else {\n  logDebug( \"No cached row metadata in repository; will recompute at runtime\" );\n}","handlingStrategy":"try-catch","validationCode":"// verify the step attributes decode before full load\nString sRowMeta = rep.getStepAttributeString( id_step, \"rowMeta\" );\nif ( sRowMeta != null && !sRowMeta.isEmpty() ) {\n  byte[] bytes = Base64.getDecoder().decode( sRowMeta );\n  if ( bytes.length == 0 ) throw new IllegalStateException( \"Empty cached row meta\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta.loadTrans( ... );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"Unexpected error reading step information\" ) ) {\n    // fall back to loading the .ktr from file, or reload with cached row meta cleared\n  } else { throw e; }\n}","preventionTips":["Do not manually edit repository attribute tables","Back up r_step_attribute rows before migrations","Test-load transformations after Pentaho version upgrades","Keep a file (.ktr) copy as recovery source"],"tags":["kettle","repository","xml","deserialization"],"backgroundTag":"json-parse-error","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}