pentaho/pentaho-kettle · error · KettleException
ZipFile.Error.TargetParentFolderNotExists
Error message
ZipFile.Error.TargetParentFolderNotExists
What it means
The zip target file's parent folder does not exist and the 'create parent folder' option is disabled, so the step fails instead of silently creating directories. This protects users from accidentally creating unintended directory trees when the target path is wrong.
Solutions
- Enable 'Create parent folder' in the ZipFile step settings so missing directories are created automatically.
- Create the target directory in advance with a 'Create a folder' step or shell script.
- Verify the target filename/path is correct if the missing folder is unexpected.
- Check filesystem permissions if folder creation is expected to have happened.
Example fix
// before meta.setCreateParentFolder(false); // after meta.setCreateParentFolder(true);
Defensive patterns
Strategy: validation
Validate before calling
// Before execution, ensure the target directory exists or auto-create is enabled
if (!zipFileMeta.isCreateParentFolder()) {
File parent = new File(targetFilename).getParentFile();
if (parent != null && !parent.exists()) {
parent.mkdirs(); // or fail fast with a clear message
}
} Try / catch
try {
transformation.execute();
} catch (KettleException e) {
if (e.getMessage() != null && e.getMessage().contains("TargetParentFolderNotExists")) {
log.error("ZipFile target parent folder missing: enable 'create parent folder' or mkdir first", e);
} else { throw e; }
} Prevention
- Enable 'Create parent folder' when writing to dynamic/nested output paths.
- Provision output directory trees in environment setup scripts.
- Verify permissions allow folder creation on the target filesystem.
- Sanity-check target paths with date-based subfolders before production runs.
When it happens
Trigger: data.zipFile.getParent().exists() is false and meta.isCreateParentFolder() is false at ZipFile.java:203; thrown before writing the archive.
Common situations: Target path includes a new subdirectory that was never created (e.g., per-date folders like /out/2026/09/); typo in the target path so an unintended nonexistent folder is referenced; running on a fresh environment where the output tree was not provisioned; permissions prevented an earlier mkdir.
Related errors
- ZipFile.Error.SourceFileNotExist
- ZipFile.Error.SourceFileNotFile
- Can not append to an existing zip file
- GetSubFolders.Exception.MissingFiles
- GetSubFolders.Exception.NoAccessibleFiles
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/a3a22eeb67069d32.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java:203
if ( Utils.isEmpty( targetFilename ) ) {
log.logError( toString(), BaseMessages.getString( PKG, "ZipFile.Error.TargetFileEmpty" ) );
throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Error.TargetFileEmpty" ) );
}
data.zipFile = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( targetFilename, this );
if ( data.zipFile.exists() ) {
if ( log.isDetailed() ) {
log.logDetailed( toString(), BaseMessages.getString(
PKG, "ZipFile.Log.TargetFileExists", targetFilename ) );
}
} else {
// let's check parent folder
FileObject parentFolder = data.zipFile.getParent();
if ( !parentFolder.exists() ) {
if ( !meta.isCreateParentFolder() ) {
// Parent folder not exist
// So we will fail
throw new KettleException( BaseMessages.getString(
PKG, "ZipFile.Error.TargetParentFolderNotExists", parentFolder.toString() ) );
} else {
// Create parent folder
parentFolder.createFolder();
}
}
if ( parentFolder != null ) {
parentFolder.close();
}
}
// Let's zip
zipFile();
// file was zipped, let's see if we need to move or delete it
processFile( moveToFolder );
// add filename to result filenames?View on GitHub (pinned to f3058517a1)