{"record":{"id":"a09b473b7eb6cdcb","repo":"pentaho/pentaho-kettle","slug":"error-while-setup-command","errorCode":null,"errorMessage":"Error while setup: ${command}","messagePattern":"Error while setup: (.+?)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"critical","filePath":"plugins/terafast-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/terafastbulkloader/TeraFast.java","lineNumber":348,"sourceCode":"\n  /**\n   * Start fastload command line tool and initialize streams.\n   *\n   * @throws KettleException\n   *           ...\n   */\n  private void startFastLoad() throws KettleException {\n    final String command = this.createCommandLine();\n    this.logBasic( \"About to execute: \" + command );\n    try {\n      this.process = Runtime.getRuntime().exec( command );\n      new Thread( new ConfigurableStreamLogger(\n        getLogChannel(), this.process.getErrorStream(), LogLevel.ERROR, \"ERROR\" ) ).start();\n      new Thread( new ConfigurableStreamLogger(\n        getLogChannel(), this.process.getInputStream(), LogLevel.DETAILED, \"OUTPUT\" ) ).start();\n      this.fastload = this.process.getOutputStream();\n    } catch ( Exception e ) {\n      throw new KettleException( \"Error while setup: \" + command, e );\n    }\n  }\n\n  /**\n   * Invoke loading with control file.\n   *\n   * @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 ) {","sourceCodeStart":330,"sourceCodeEnd":366,"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#L330-L366","documentation":"startFastLoad spawns the external fastload command via Runtime/ProcessBuilder; any Exception thrown while starting the process or wiring its stdin/stdout/stderr streams is wrapped as 'Error while setup: <command>'. The chained cause is the real problem (typically the fastload executable not being found on PATH).","triggerScenarios":"execute() -> startFastLoad(): the fastload binary path is wrong or not on PATH (IOException from Runtime.exec), the SecurityManager denies execution, or an exception occurs acquiring process.getInputStream()/getOutputStream() during stream wiring.","commonSituations":"Teradata Utilities/TTU not installed on the Kettle host; fastload installed but not in PATH of the user running the transformation; wrong absolute path configured; running on a host/OS where the client tools are absent (e.g. Windows vs Linux agent).","solutions":["Install Teradata Tools & Utilities (TTU) or verify the fastload executable exists: which fastload (or full configured path).","Add fastload's directory to PATH for the user running Pentaho/Kettle, or configure the full absolute path to the binary.","Read the chained cause in the KettleException log to confirm the root error (usually 'Cannot run program ...: No such file or directory').","Verify the TeraFast step's fastload client configuration (if a path variable is used, confirm it resolves).","Ensure the Kettle service user has execute permission on the fastload binary."],"exampleFix":"// before\nRuntime.getRuntime().exec( command ); // fails with no diagnostics if fastload is off PATH\n// after\nFile exe = new File( resolveFileName( meta.getFastloadPath() ) );\nif ( !exe.canExecute() ) {\n  throw new KettleException( \"fastload executable not found at: \" + exe.getAbsolutePath() ); // fail early with actionable message\n}\nProcess process = Runtime.getRuntime().exec( command );","handlingStrategy":"validation","validationCode":"// Run before executing the transformation\nString cmd = fastloadCommandOrPath;\nProcess probe = Runtime.getRuntime().exec( new String[]{ \"which\", cmd.contains( \"/\" ) ? new File( cmd ).getName() : cmd } );\nint rc = probe.waitFor();\nif ( rc != 0 || !new File( cmd ).canExecute() && cmd.contains( \"/\" ) ) {\n  throw new IllegalStateException( \"fastload executable not found on PATH or at: \" + cmd\n    + \"; install Teradata TTU or set the full absolute path\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  this.process = Runtime.getRuntime().exec( command );\n} catch ( IOException e ) {\n  throw new KettleException( \"Error while setup: \" + command\n    + \" — verify the fastload executable exists, is on PATH, and is executable by this user\", e );\n}","preventionTips":["Install Teradata Tools & Utilities (fastload) on every host running the transformation.","Configure the absolute path to fastload rather than relying on PATH.","Smoke-test with 'fastload -v' (or 'which fastload') as the Kettle service user before production runs.","Keep the same TTU version across dev/test/prod agents."],"tags":["kettle","pdi","teradata","fastload","process-exec","external-command"],"backgroundTag":"command-not-found","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"}