pentaho/pentaho-kettle · error · KettleException

JobWriteToFile.Error.CheckingParentFolder

Error message

JobWriteToFile.Error.CheckingParentFolder

What it means

KettleException with message key JobWriteToFile.Error.CheckingParentFolder thrown by JobEntryWriteToFile.createParentFolder as a catch-all wrapper: any exception raised while checking or creating the file's parent folder (including the ParentFoldetNotExist throw) is re-wrapped with the target filename and chained as the cause. It signals the entry could not verify/prepare the output directory.

Solutions

  1. Read the chained cause to find the root failure (missing folder vs IO/permission)
  2. Fix the filename/path and ensure the parent directory exists or 'create parent folder' is enabled
  3. Verify the OS user can write to the target directory
  4. Test the path in Spoon locally before running on a server

Example fix

// before
String filename = "sftp://badhost/data/out.txt"; // unresolvable path -> throws
// after
String filename = "/data/out/out.txt"; // valid local path, parent exists
new File("/data/out").mkdirs();
Defensive patterns

Strategy: try-catch

Validate before calling

// verify path resolvable and parent writable before execute
File out = new File(filename);
if (!out.getAbsoluteFile().getParentFile().canWrite()) {
  throw new IllegalStateException("Output directory not writable: " + out.getParent());
}

Try / catch

try {
  entry.execute(prev, nr);
} catch (KettleException e) {
  Throwable root = e;
  while (root.getCause() != null) root = root.getCause();
  logError("Checking parent folder failed for " + filename + ": " + root.getMessage(), e);
}

Prevention

When it happens

Trigger: Executing the entry when parent folder existence check or creation throws any Exception — e.g. KettleFileException from resolve of an invalid VFS path, security/IO errors, or the inner ParentFoldetNotExist error.

Common situations: Invalid or unreachable file paths (bad VFS scheme like sftp:// misconfigured); permission errors on the directory; missing parent folders; OS-specific path errors.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/writetofile/JobEntryWriteToFile.java:261

      parent = KettleVFS.getInstance( parentJobMeta.getBowl() ).getFileObject( realFilename, this ).getParent();
      if ( !parent.exists() ) {
        if ( isCreateParentFolder() ) {
          if ( isDetailed() ) {
            logDetailed( BaseMessages.getString( PKG, "JobWriteToFile.Log.ParentFoldetNotExist", parent
              .getName().toString() ) );
          }
          parent.createFolder();
          if ( isDetailed() ) {
            logDetailed( BaseMessages.getString( PKG, "JobWriteToFile.Log.ParentFolderCreated", parent
              .getName().toString() ) );
          }
        } else {
          throw new KettleException( BaseMessages.getString(
            PKG, "JobWriteToFile.Log.ParentFoldetNotExist", parent.getName().toString() ) );
        }
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "JobWriteToFile.Error.CheckingParentFolder", realFilename ), e );
    } finally {
      if ( parent != null ) {
        try {
          parent.close();
        } catch ( Exception e ) { /* Ignore */
        }
      }
    }
  }

  public boolean evaluates() {
    return true;
  }

  public boolean isAppendFile() {
    return appendFile;
  }

View on GitHub (pinned to f3058517a1)