pentaho/pentaho-kettle · error · KettleStepException

JsonOutput.Error.Writing

JsonOutput.Error.Writing

Error message

JsonOutput.Error.Writing

What it means

JsonOutput.outPutRow wraps data.writer.write(value) in a try/catch; any exception while writing the JSON string to the open file is rethrown as JsonOutput.Error.Writing. This indicates the file was opened but the write operation itself failed (disk full, stream closed, IO error).

Solutions

  1. Check free disk space and quotas on the target filesystem.
  2. Verify the output location is a stable, writable local or mounted path; avoid flaky network shares for output.
  3. Check OS-level logs for IO errors and any antivirus/backup interference with the output file.
  4. Re-run the transformation; if transient, add retry logic at the job level.
  5. Confirm the file encoding selected in the step is supported by the JVM/platform.
Defensive patterns

Strategy: try-catch

Try / catch

try { transformation.execute(...); } catch (KettleStepException e) {
  if (e.getMessage().contains("JsonOutput.Error.Writing")) {
    log.error("Write failed: check disk space and target volume health", e);
  }
  throw e;
}

Prevention

When it happens

Trigger: data.writer.write(value) throws — e.g. IOException from a full disk, detached network drive, stream already closed, or character encoding problems — inside outPutRow after openNewFile() succeeded.

Common situations: Disk quota exceeded on the output volume; writing to a network share that dropped mid-run; antivirus or backup software locking the file during the write; container filesystem turned read-only.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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

Appendix: source

Thrown at plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsonoutput/JsonOutput.java:251


    if ( data.outputValue && data.outputRowMeta != null ) {
      Object[] outputRowData = RowDataUtil.addValueData( rowData, data.inputRowMetaSize, value );
      incrementLinesOutput();
      putRow( data.outputRowMeta, outputRowData );
    }

    if ( data.writeToFile && !data.ja.isEmpty() ) {
      // Open a file
      if ( !openNewFile() ) {
        throw new KettleStepException( BaseMessages.getString(
          PKG, "JsonOutput.Error.OpenNewFile", buildFilename() ) );
      }
      // Write data to file
      try {
        data.writer.write( value );
      } catch ( Exception e ) {
        throw new KettleStepException( BaseMessages.getString( PKG, "JsonOutput.Error.Writing" ), e );
      }
      // Close file
      closeFile();
    }
    // Data are safe
    data.rowsAreSafe = true;
    data.ja = new JSONArray();
  }

  public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
    meta = (JsonOutputMeta) smi;
    data = (JsonOutputData) sdi;
    if ( super.init( smi, sdi ) ) {

      data.writeToFile = ( meta.getOperationType() != JsonOutputMeta.OPERATION_TYPE_OUTPUT_VALUE );
      data.outputValue = ( meta.getOperationType() != JsonOutputMeta.OPERATION_TYPE_WRITE_TO_FILE );

      if ( data.outputValue ) {

View on GitHub (pinned to f3058517a1)