{"record":{"id":"dfeb632a6a338f2f","repo":"pentaho/pentaho-kettle","slug":"tostring-unable-to-read-row-metadata-from-input-stream","errorCode":null,"errorMessage":"${toString()} : Unable to read row metadata from input stream","messagePattern":"(.+?) : Unable to read row metadata from input stream","errorType":"exception","errorClass":"org.pentaho.di.core.exception.KettleFileException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/RowMeta.java","lineNumber":742,"sourceCode":"    } catch ( SocketTimeoutException e ) {\n      throw e;\n    } catch ( EOFException e ) {\n      throw new KettleEOFException(\n        \"End of file while reading the number of metadata values in the row metadata\", e );\n    } catch ( IOException e ) {\n      throw new KettleFileException( \"Unable to read nr of metadata values: \" + e.toString(), e );\n    }\n\n    for ( int i = 0; i < nr; i++ ) {\n      try {\n        int type = inputStream.readInt();\n        ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( type );\n        valueMeta.readMetaData( inputStream );\n        addValueMeta( valueMeta );\n      } catch ( EOFException e ) {\n        throw new KettleEOFException( e );\n      } catch ( Exception e ) {\n        throw new KettleFileException( toString() + \" : Unable to read row metadata from input stream\", e );\n      }\n\n    }\n  }\n\n  @Override\n  public Object[] readData( DataInputStream inputStream ) throws KettleFileException, SocketTimeoutException {\n    lock.readLock().lock();\n    try {\n      Object[] data = new Object[ size() ];\n      for ( int i = 0; i < size(); i++ ) {\n        data[ i ] = getValueMeta( i ).readData( inputStream );\n      }\n      if ( size() == 0 ) {\n        try {\n          inputStream.readBoolean();\n        } catch ( EOFException e ) {\n          throw new KettleEOFException( e );","sourceCodeStart":724,"sourceCodeEnd":760,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/RowMeta.java#L724-L760","documentation":"In the RowMeta(InputStream) constructor loop, any non-EOF exception while reading a field type, creating the value meta, or reading its metadata is wrapped in KettleFileException \"<rowMeta.toString()> : Unable to read row metadata from input stream\". This covers both I/O faults and value-meta creation failures (e.g. unknown value type id) during field deserialization.","triggerScenarios":"new RowMeta(inputStream) where ValueMetaFactory.createValueMeta(type) fails on an unknown/unsupported type id, readMetaData throws, or a non-EOF IOException occurs while reading a field.","commonSituations":"Reading metadata serialized by a newer PDI version with value types the current version does not know; corrupted stream bytes shifting type ids; missing value-type plugin jars.","solutions":["Enable a debug log on the stream to dump raw bytes and confirm byte alignment/format of the metadata.","Align PDI versions between sender and receiver so all value type ids are supported.","Ensure all value-type plugins are installed so createValueMeta can resolve every type id.","Re-transmit the metadata if the stream is corrupted."],"exampleFix":"// before\nRowMeta rowMeta = new RowMeta(inputStream);\n// after\ntry {\n  RowMeta rowMeta = new RowMeta(inputStream);\n} catch (KettleFileException e) {\n  log.error(\"Row metadata read failed: \" + e.getMessage(), e);\n  verifySenderVersionMatches();\n  inputStream = reconnect();\n  RowMeta rowMeta = new RowMeta(inputStream);\n}","handlingStrategy":"validation","validationCode":"byte[] raw = readAllBytes(inputStream);\n// verify declared field count matches parseable content before constructing RowMeta\nRowMeta rowMeta = new RowMeta(new ByteArrayInputStream(raw));","typeGuard":null,"tryCatchPattern":"try {\n  RowMeta rowMeta = new RowMeta(inputStream);\n} catch (KettleFileException e) {\n  log.error(\"Field-level metadata read failed: \" + e.getMessage(), e);\n  verifySenderPdiVersion();\n  ensureValueMetaPluginsInstalled();\n}","preventionTips":["Install all value-type plugins so unknown type ids never reach createValueMeta.","Match sender/receiver PDI versions.","Buffer and validate raw bytes before parsing to isolate corruption."],"tags":["io","deserialization","row-metadata","value-type"],"backgroundTag":"unsupported-enum-value","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"}