{"record":{"id":"d9e01d6cdc2d0970","repo":"pentaho/pentaho-kettle","slug":"unable-to-write-value-timestamp-data-to-output-stream","errorCode":null,"errorMessage":" : Unable to write value timestamp data to output stream","messagePattern":" : Unable to write value timestamp data to output stream","errorType":"exception","errorClass":"KettleFileException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaTimestamp.java","lineNumber":614,"sourceCode":"            // at all.\n            //\n            writeBinaryString( outputStream, (byte[]) object );\n            break;\n\n          case STORAGE_TYPE_INDEXED:\n            writeInteger( outputStream, (Integer) object ); // just an index\n            break;\n\n          default:\n            throw new KettleFileException( toString() + \" : Unknown storage type \" + getStorageType() );\n        }\n      }\n    } catch ( ClassCastException e ) {\n      throw new RuntimeException( toString() + \" : There was a data type error: the data type of \"\n        + object.getClass().getName() + \" object [\" + object + \"] does not correspond to value meta [\"\n        + toStringMeta() + \"]\" );\n    } catch ( IOException e ) {\n      throw new KettleFileException( toString() + \" : Unable to write value timestamp data to output stream\", e );\n    } catch ( KettleValueException e ) {\n      throw new RuntimeException( toString() + \" : There was a data type error: the data type of \"\n        + object.getClass().getName() + \" object [\" + object + \"] does not correspond to value meta [\"\n        + toStringMeta() + \"]\" );\n    }\n  }\n\n  @Override\n  public Object readData( DataInputStream inputStream ) throws KettleFileException, KettleEOFException,\n    SocketTimeoutException {\n    try {\n      // Is the value NULL?\n      if ( inputStream.readBoolean() ) {\n        return null; // done\n      }\n\n      switch ( storageType ) {\n        case STORAGE_TYPE_NORMAL:","sourceCodeStart":596,"sourceCodeEnd":632,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaTimestamp.java#L596-L632","documentation":"Serialization failure in ValueMetaTimestamp.writeData(): writing the timestamp value to the output data stream failed (e.g. an I/O error or null stream while writing millis/nanos or a binary-string/indexed representation). Prefixed with this value's toString(); related ClassCastException and EOF paths are handled by adjacent catch blocks.","triggerScenarios":"Writing binary row data to a file/socket stream that is closed, full disk, broken pipe on a clustered slave connection, or permission loss mid-write.","commonSituations":"Disk full on large table-output-to-file jobs, network drops during clustered streaming, writing to removable media that disconnected.","solutions":["Check the chained IOException cause (disk full, broken pipe, permission)","Verify free disk space and that the output file/stream is writable","Reopen the output stream and retry the batch","For network streams, add retry/restart logic on the step"],"exampleFix":"// before\nDataOutputStream out = new DataOutputStream(new FileOutputStream(file));\nmeta.writeData(out, object); // fails if disk full / stream closed\n// after\ntry (DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file, true)))) {\n  meta.writeData(out, object);\n  out.flush();\n} catch (KettleFileException e) {\n  checkDiskSpaceAndRetry(file, object);\n}","handlingStrategy":"retry","validationCode":"File f = new File(path);\nif (f.getUsableSpace() < minRequiredBytes) throw new IOException(\"Insufficient disk space for row output\");\nif (!f.canWrite()) throw new IOException(\"Output file not writable: \" + path);","typeGuard":null,"tryCatchPattern":"try {\n  meta.writeData(outputStream, object);\n} catch (KettleFileException e) {\n  if (e.getCause() instanceof IOException) {\n    reopenStream();\n    meta.writeData(outputStream, object); // retry once\n  } else throw e;\n}","preventionTips":["Monitor free disk space on output targets","Use buffered streams and flush/verify after batches","Handle broken pipes on clustered slave connections with reconnect logic","Keep output directories writable by the executing user"],"tags":["pdi","file-io","io","serialization"],"backgroundTag":"file-write-failed","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"}