pentaho/pentaho-kettle · error · KettleStepException

JsonOutput.Error.ErrorCreatingParentFolder

JsonOutput.Error.ErrorCreatingParentFolder

Error message

JsonOutput.Error.ErrorCreatingParentFolder

What it means

JsonOutput.createParentFolder attempts to create the output file's parent directory (parentfolder.createFolder()) and wraps any failure in KettleStepException with JsonOutput.Error.ErrorCreatingParentFolder. It fires when the directory cannot be created or even probed due to permissions, invalid paths, or filesystem errors.

Solutions

  1. Pre-create the parent directory manually or via a job 'Create a folder' entry before the transformation runs.
  2. Grant the process user write/create permissions on the parent directory.
  3. Log the resolved filename to verify the path is valid; fix any environment variables that don't resolve.
  4. Choose a different, writable output directory.

Example fix

// before
<filename>/app/read-only/out.json</filename>
// after
<filename>${Internal.Job.Filename.Directory}/output/out.json</filename>
Defensive patterns

Strategy: validation

Validate before calling

// Job entry script before transformation
Path parent = Paths.get(outputFile).getParent();
if (parent != null && !Files.exists(parent)) {
  Files.createDirectories(parent); // fails early with a clear OS error if not permitted
}

Prevention

When it happens

Trigger: createParentFolder (called from openNewFile) hits an Exception while checking/creating the parent directory of the output filename — e.g. mkdir fails due to permissions, path component is a file, or invalid characters in the path.

Common situations: Output path's parent directory doesn't exist and the user lacks create permission; path contains illegal characters on Windows; output points inside a read-only container layer; filename variable resolves to an empty/garbage path.

Understand the failure class

Background: mkdir permission denied (EACCES): failed to create directory errors explained — this error's family across 32 libraries.

Related errors


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

Appendix: source

Thrown at plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsonoutput/JsonOutput.java:338

      return;
    }
    // Check for parent folder
    FileObject parentfolder = null;
    try {
      // Get parent folder
      parentfolder = KettleVFS.getInstance( getTransMeta().getBowl() )
        .getFileObject( filename, getTransMeta() ).getParent();
      if ( !parentfolder.exists() ) {
        if ( log.isDebug() ) {
          logDebug( BaseMessages.getString( PKG, "JsonOutput.Error.ParentFolderNotExist", parentfolder.getName() ) );
        }
        parentfolder.createFolder();
        if ( log.isDebug() ) {
          logDebug( BaseMessages.getString( PKG, "JsonOutput.Log.ParentFolderCreated" ) );
        }
      }
    } catch ( Exception e ) {
      throw new KettleStepException( BaseMessages.getString(
        PKG, "JsonOutput.Error.ErrorCreatingParentFolder", parentfolder.getName() ) );
    } finally {
      if ( parentfolder != null ) {
        try {
          parentfolder.close();
        } catch ( Exception ex ) { /* Ignore */
        }
      }
    }
  }

  public boolean openNewFile() {
    if ( data.writer != null ) {
      return true;
    }
    boolean retval = false;

    try {

View on GitHub (pinned to f3058517a1)