pentaho/pentaho-kettle · error · KettleException

Error retrieving logfile string

Error message

Error retrieving logfile string

What it means

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.

Solutions

  1. Inspect the wrapped cause in the stack trace to identify the actual VFS/IO failure.
  2. Correct the log file path in the step dialog to a plain valid filesystem path.
  3. Ensure any ${VARIABLE} in the log path is defined before execution.
  4. Create the target directory in advance and confirm write permissions for the Pentaho user.
  5. If no error log is needed, clear the log file field so this branch is skipped entirely.

Example fix

// before
Log file: ${LOG_DIR}/fastload.err  // LOG_DIR undefined
// after
Log file: /var/log/pentaho/fastload.err  // or define LOG_DIR via Set Variables/kettle.properties
Defensive patterns

Strategy: validation

Validate before calling

String logPath = meta.getLogFile() == null ? null : meta.getLogFile().getValue();
if (logPath != null && !logPath.trim().isEmpty()) {
  String resolved = transMeta.environmentSubstitute(logPath);
  java.io.File dir = new java.io.File(resolved).getAbsoluteFile().getParentFile();
  if (dir == null || !dir.isDirectory() || !dir.canWrite()) {
    throw new IllegalStateException("Log file directory missing or not writable: " + dir);
  }
}

Try / catch

try {
  trans.execute(null);
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("Error retrieving logfile string")) {
    logError("Fastload log file path could not be resolved; cause: " + e.getCause());
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

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

    try {
      final FileObject fileObject =
        KettleVFS.getInstance( getTransMeta().getBowl() )
          .getFileObject( environmentSubstitute( this.meta.getFastloadPath().getValue() ) );
      final String fastloadExec = KettleVFS.getFilename( fileObject );
      builder.append( fastloadExec );
    } catch ( Exception e ) {
      throw new KettleException( "Error retrieving fastload application string", e );
    }
    // Add log error log, if set.
    if ( StringUtils.isNotBlank( this.meta.getLogFile().getValue() ) ) {
      try {
        FileObject fileObject =
          KettleVFS.getInstance( getTransMeta().getBowl() )
            .getFileObject( environmentSubstitute( this.meta.getLogFile().getValue() ) );
        builder.append( " -e " );
        builder.append( "\"" + KettleVFS.getFilename( fileObject ) + "\"" );
      } catch ( Exception e ) {
        throw new KettleException( "Error retrieving logfile string", e );
      }
    }
    return builder.toString();
  }

  protected void verifyDatabaseConnection() throws KettleException {
    // Confirming Database Connection is defined.
    if ( this.meta.getDbMeta() == null ) {
      throw new KettleException( BaseMessages.getString( PKG, "TeraFastDialog.GetSQL.NoConnectionDefined" ) );
    }
  }

  /**
   * {@inheritDoc}
   *
   * @see org.pentaho.di.trans.step.BaseStep#init(org.pentaho.di.trans.step.StepMetaInterface,
   *      org.pentaho.di.trans.step.StepDataInterface)
   */

View on GitHub (pinned to f3058517a1)