{"record":{"id":"130583a06c72a6f6","repo":"pentaho/pentaho-kettle","slug":"cannot-pipe-content-of-control-file-to-fastload-path","errorCode":null,"errorMessage":"Cannot pipe content of control file to fastload [path=${controlFile}]","messagePattern":"Cannot pipe content of control file to fastload \\[path=(.+?)\\]","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/terafast-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/terafastbulkloader/TeraFast.java","lineNumber":373,"sourceCode":"   * @throws KettleException\n   *           ...\n   */\n  private void invokeLoadingControlFile() throws KettleException {\n    File controlFile = null;\n    final InputStream control;\n    final String controlContent;\n    try {\n      controlFile = new File( resolveFileName( this.meta.getControlFile().getValue() ) );\n      control = FileUtils.openInputStream( controlFile );\n      controlContent = environmentSubstitute( FileUtils.readFileToString( controlFile ) );\n    } catch ( IOException e ) {\n      throw new KettleException( \"Cannot open control file [path=\" + controlFile + \"]\", e );\n    }\n    try {\n      IOUtils.write( controlContent, this.fastload );\n      this.fastload.flush();\n    } catch ( IOException e ) {\n      throw new KettleException( \"Cannot pipe content of control file to fastload [path=\" + controlFile + \"]\", e );\n    } finally {\n      IOUtils.closeQuietly( control );\n      IOUtils.closeQuietly( this.fastload );\n    }\n  }\n\n  /**\n   * Invoke loading with loading commands.\n   *\n   * @throws KettleException\n   *           ...\n   */\n  private void invokeLoadingCommand() throws KettleException {\n    final FastloadControlBuilder builder = new FastloadControlBuilder();\n    builder.setSessions( this.meta.getSessions().getValue() );\n    builder.setErrorLimit( this.meta.getErrorLimit().getValue() );\n    builder.logon( this.meta.getDbMeta().getHostname(), this.meta.getDbMeta().getUsername(), this.meta\n      .getDbMeta().getPassword() );","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/terafast-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/terafastbulkloader/TeraFast.java#L355-L391","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the transformation log for fastload ERROR/OUTPUT lines (ConfigurableStreamLogger output) — the child's own error explains why it exited.","Validate the control file script: correct LOGON tdpid/user/password, correct target table, valid DEFINE/INSERT statements.","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.","Verify Teradata connectivity (tdpid reachable, credentials valid) before starting the load.","Rerun; if transient (process killed, OOM), ensure the host has resources and the fastload process is not being terminated by the environment."],"exampleFix":"// before\nIOUtils.write( controlContent, this.fastload );\nthis.fastload.flush();\n// after\ntry {\n  IOUtils.write( controlContent, this.fastload );\n  this.fastload.flush();\n} catch ( IOException e ) {\n  throw new KettleException( \"Cannot pipe control file to fastload; the fastload process likely exited early.\"\n    + \" Check fastload ERROR output above and validate the control file script: \" + controlFile, e );\n}","handlingStrategy":"try-catch","validationCode":"// Verify the fastload child is still alive before piping the script\nif ( this.process == null || !this.process.isAlive() ) {\n  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\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  IOUtils.write( controlContent, this.fastload );\n  this.fastload.flush();\n} catch ( IOException e ) {\n  int exitCode = -1;\n  try { exitCode = this.process.exitValue(); } catch ( IllegalThreadStateException alive ) { /* still running */ }\n  throw new KettleException( \"Cannot pipe control file to fastload [path=\" + controlFile\n    + \"]; fastload exitCode=\" + exitCode + \" — inspect fastload ERROR output and validate LOGON/table script\", e );\n}","preventionTips":["Check fastload's ERROR/OUTPUT log lines immediately after this exception — the child's stderr names the real cause.","Validate the control file script (LOGON credentials, tdpid, target table, DEFINE/INSERT) before running.","Clean up Teradata error tables / stalled FastLoad state after any previous failed load.","Confirm Teradata connectivity from the host before starting bulk loads."],"tags":["kettle","pdi","teradata","fastload","broken-pipe","child-process"],"backgroundTag":"broken-pipe","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"}