pentaho/pentaho-kettle · error · KettleException

Cannot pipe content of control file to fastload

Error message

Cannot pipe content of control file to fastload [path=${controlFile}]

What it means

After reading the control file, invokeLoadingControlFile writes its content to the fastload process's stdin (this.fastload) and flushes; an IOException there is wrapped as 'Cannot pipe content of control file to fastload [path=...]'. This usually means the fastload process has died or closed its stdin by the time the script is written — a broken pipe to the child process.

Solutions

  1. Check the transformation log for fastload ERROR/OUTPUT lines (ConfigurableStreamLogger output) — the child's own error explains why it exited.
  2. Validate the control file script: correct LOGON tdpid/user/password, correct target table, valid DEFINE/INSERT statements.
  3. Clean up a stalled Teradata table left in FastLoad pause state by running the MultiLoad/FastLoad 'BEGIN/END LOADING' recovery or dropping/recreating the error tables.
  4. Verify Teradata connectivity (tdpid reachable, credentials valid) before starting the load.
  5. Rerun; if transient (process killed, OOM), ensure the host has resources and the fastload process is not being terminated by the environment.

Example fix

// before
IOUtils.write( controlContent, this.fastload );
this.fastload.flush();
// after
try {
  IOUtils.write( controlContent, this.fastload );
  this.fastload.flush();
} catch ( IOException e ) {
  throw new KettleException( "Cannot pipe control file to fastload; the fastload process likely exited early."
    + " Check fastload ERROR output above and validate the control file script: " + controlFile, e );
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the fastload child is still alive before piping the script
if ( this.process == null || !this.process.isAlive() ) {
  throw new IllegalStateException( "fastload process exited before the control file could be written; check its ERROR/OUTPUT log lines and validate the control file script" );
}

Try / catch

try {
  IOUtils.write( controlContent, this.fastload );
  this.fastload.flush();
} catch ( IOException e ) {
  int exitCode = -1;
  try { exitCode = this.process.exitValue(); } catch ( IllegalThreadStateException alive ) { /* still running */ }
  throw new KettleException( "Cannot pipe control file to fastload [path=" + controlFile
    + "]; fastload exitCode=" + exitCode + " — inspect fastload ERROR output and validate LOGON/table script", e );
}

Prevention

When it happens

Trigger: execute() -> invokeLoadingControlFile(): fastload exited immediately after start (bad control file, license/auth failure) so its stdin stream is broken when IOUtils.write runs; OS pipe buffer/stream errors; fastload was killed before the write.

Common situations: fastload crashed on startup because the control file content is invalid (wrong table, bad LOGON credentials in script); earlier load left the table in a failed/paused FastLoad state requiring 'end loading' cleanup; environment issues (TERADATA connection refused) causing fastload to abort before reading stdin.

Related errors


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

Appendix: source

Thrown at plugins/terafast-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/terafastbulkloader/TeraFast.java:373

   * @throws KettleException
   *           ...
   */
  private void invokeLoadingControlFile() throws KettleException {
    File controlFile = null;
    final InputStream control;
    final String controlContent;
    try {
      controlFile = new File( resolveFileName( this.meta.getControlFile().getValue() ) );
      control = FileUtils.openInputStream( controlFile );
      controlContent = environmentSubstitute( FileUtils.readFileToString( controlFile ) );
    } catch ( IOException e ) {
      throw new KettleException( "Cannot open control file [path=" + controlFile + "]", e );
    }
    try {
      IOUtils.write( controlContent, this.fastload );
      this.fastload.flush();
    } catch ( IOException e ) {
      throw new KettleException( "Cannot pipe content of control file to fastload [path=" + controlFile + "]", e );
    } finally {
      IOUtils.closeQuietly( control );
      IOUtils.closeQuietly( this.fastload );
    }
  }

  /**
   * Invoke loading with loading commands.
   *
   * @throws KettleException
   *           ...
   */
  private void invokeLoadingCommand() throws KettleException {
    final FastloadControlBuilder builder = new FastloadControlBuilder();
    builder.setSessions( this.meta.getSessions().getValue() );
    builder.setErrorLimit( this.meta.getErrorLimit().getValue() );
    builder.logon( this.meta.getDbMeta().getHostname(), this.meta.getDbMeta().getUsername(), this.meta
      .getDbMeta().getPassword() );

View on GitHub (pinned to f3058517a1)