pentaho/pentaho-kettle · error · KettleException

JoinRows.Log.ErrorCreatingTemporaryFiles

JoinRows.Log.ErrorCreatingTemporaryFiles

Error message

JoinRows.Log.ErrorCreatingTemporaryFiles

What it means

JoinRows.initialize() throws this KettleException when creating or opening the temporary files/buffers the Join Rows step needs to cache incoming row streams fails. The step spools all rows except the main stream to temp files so it can cross-join them; any I/O exception while creating those files or streams is wrapped in this error. The transformation cannot proceed because the step's data buffers are unusable.

Solutions

  1. Check java.io.tmpdir (or KETTLE_TEMP_DIR) points to an existing, writable directory for the user running the transformation.
  2. Free disk space or point the temp dir to a volume with capacity for the full row spool.
  3. Fix directory permissions (chmod/chown) on the temp directory.
  4. Re-run the transformation; temp file creation is transient-environment dependent, not data dependent.

Example fix

// before
export KETTLE_TEMP_DIR=/mnt/ro-tmp
./kitchen.sh -file job.kjb

// after
export KETTLE_TEMP_DIR=/var/tmp/pdi   # must exist and be writable
mkdir -p $KETTLE_TEMP_DIR
./kitchen.sh -file job.kjb
Defensive patterns

Strategy: validation

Validate before calling

File tmp = new File( System.getProperty( "java.io.tmpdir" ) );
if ( !tmp.isDirectory() || !tmp.canWrite() || tmp.getUsableSpace() < 64L * 1024 * 1024 ) {
  throw new IllegalStateException( "Temp dir unusable for JoinRows spooling: " + tmp );
}

Try / catch

try {
  trans.execute( null );
} catch ( KettleException e ) {
  if ( e.getMessage() != null && e.getMessage().contains( "ErrorCreatingTemporaryFiles" ) ) {
    System.setProperty( "java.io.tmpdir", "/var/tmp/pdi" ); // or export KETTLE_TEMP_DIR
    throw new IllegalStateException( "Fix temp dir and re-run", e );
  }
  throw e;
}

Prevention

When it happens

Trigger: processRow calls initialize() which invokes data.getBuffer() / file creation logic for the join; this throws when java.io.File.createTempFile or FileOutputStream creation fails in data.dir/tempFilePrefix configuration.

Common situations: KETTLE_TEMP_DIR / java.io.tmpdir points to a read-only or non-existent directory; disk is full on the execution host; the OS temp dir has wrong permissions for the runtime user; very restrictive security managers or containers with read-only /tmp.

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/321a75ef0d78340b. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/joinrows/JoinRows.java:116

        if ( directoryName != null ) {
          file = new File( directoryName );
        }
        data.file[i] = File.createTempFile( meta.getPrefix(), ".tmp", file );

        data.size[i] = 0;
        data.rs[i] = inputRowSets.get( i );
        data.cache[i] = null;
        // data.row[i] = null;
        data.position[i] = 0;

        data.dataInputStream[i] = null;
        data.dataOutputStream[i] = null;

        data.joinrow[i] = null;
        data.restart[i] = false;
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "JoinRows.Log.ErrorCreatingTemporaryFiles" ), e );
    }
  }

  /**
   * Get a row of data from the indicated rowset or buffer (memory/disk)
   *
   * @param filenr
   *          The rowset or buffer to read a row from
   * @return a row of data
   * @throws KettleException
   *           in case something goes wrong
   */
  public Object[] getRowData( int filenr ) throws KettleException {
    data.restart[filenr] = false;

    Object[] rowData = null;

    // Do we read from the first rowset or a file?

View on GitHub (pinned to f3058517a1)