{"record":{"id":"50b2a5b6f1d5cb12","repo":"pentaho/pentaho-kettle","slug":"error-retrieving-logfile-string-terafast","errorCode":null,"errorMessage":"Error retrieving logfile string","messagePattern":"Error retrieving logfile string","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":123,"sourceCode":"    try {\n      final FileObject fileObject =\n        KettleVFS.getInstance( getTransMeta().getBowl() )\n          .getFileObject( environmentSubstitute( this.meta.getFastloadPath().getValue() ) );\n      final String fastloadExec = KettleVFS.getFilename( fileObject );\n      builder.append( fastloadExec );\n    } catch ( Exception e ) {\n      throw new KettleException( \"Error retrieving fastload application string\", e );\n    }\n    // Add log error log, if set.\n    if ( StringUtils.isNotBlank( this.meta.getLogFile().getValue() ) ) {\n      try {\n        FileObject fileObject =\n          KettleVFS.getInstance( getTransMeta().getBowl() )\n            .getFileObject( environmentSubstitute( this.meta.getLogFile().getValue() ) );\n        builder.append( \" -e \" );\n        builder.append( \"\\\"\" + KettleVFS.getFilename( fileObject ) + \"\\\"\" );\n      } catch ( Exception e ) {\n        throw new KettleException( \"Error retrieving logfile string\", e );\n      }\n    }\n    return builder.toString();\n  }\n\n  protected void verifyDatabaseConnection() throws KettleException {\n    // Confirming Database Connection is defined.\n    if ( this.meta.getDbMeta() == null ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"TeraFastDialog.GetSQL.NoConnectionDefined\" ) );\n    }\n  }\n\n  /**\n   * {@inheritDoc}\n   *\n   * @see org.pentaho.di.trans.step.BaseStep#init(org.pentaho.di.trans.step.StepMetaInterface,\n   *      org.pentaho.di.trans.step.StepDataInterface)\n   */","sourceCodeStart":105,"sourceCodeEnd":141,"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#L105-L141","documentation":"When a log file is configured, createCommandLine resolves the log file path through KettleVFS (after environment substitution) to append '-e \"<path>\"' to the fastload command. Any exception during that resolution is wrapped in a KettleException with message 'Error retrieving logfile string' and the original exception as the cause.","triggerScenarios":"meta.getLogFile() is non-blank but KettleVFS.getFileObject(environmentSubstitute(logFilePath)) or KettleVFS.getFilename(fileObject) throws — invalid URI, unresolvable variable, inaccessible path — inside the try block guarded for the log file.","commonSituations":"The error-log file field contains a typo, unsupported protocol, or characters that break VFS parsing; a variable like ${LOG_DIR} is undefined at runtime; the directory is on a detached network share; Windows paths with backslashes pasted as an unescaped VFS URI.","solutions":["Inspect the wrapped cause in the stack trace to identify the actual VFS/IO failure.","Correct the log file path in the step dialog to a plain valid filesystem path.","Ensure any ${VARIABLE} in the log path is defined before execution.","Create the target directory in advance and confirm write permissions for the Pentaho user.","If no error log is needed, clear the log file field so this branch is skipped entirely."],"exampleFix":"// before\nLog file: ${LOG_DIR}/fastload.err  // LOG_DIR undefined\n// after\nLog file: /var/log/pentaho/fastload.err  // or define LOG_DIR via Set Variables/kettle.properties","handlingStrategy":"validation","validationCode":"String logPath = meta.getLogFile() == null ? null : meta.getLogFile().getValue();\nif (logPath != null && !logPath.trim().isEmpty()) {\n  String resolved = transMeta.environmentSubstitute(logPath);\n  java.io.File dir = new java.io.File(resolved).getAbsoluteFile().getParentFile();\n  if (dir == null || !dir.isDirectory() || !dir.canWrite()) {\n    throw new IllegalStateException(\"Log file directory missing or not writable: \" + dir);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Error retrieving logfile string\")) {\n    logError(\"Fastload log file path could not be resolved; cause: \" + e.getCause());\n  } else {\n    throw e;\n  }\n}","preventionTips":["Specify the error-log file as a plain absolute path in a directory that already exists and is writable.","Resolve any variables in the log path (Set Variables step or kettle.properties) before execution.","Prefer forward slashes or properly escaped paths on Windows to avoid VFS URI issues.","Clear the log file field if the error log is not needed, so the branch is skipped."],"tags":["teradata","fastload","vfs","logfile"],"backgroundTag":"file-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"}