pentaho/pentaho-kettle · error · KettleException
Unable to get zip filename '...' to depth ...
Error message
Unable to get zip filename '...' to depth ...
What it means
JobEntryZipFile.determineZipfilenameForDepth() throws this KettleException when building a zip filename truncated to a requested folder depth fails. Any exception while walking VFS parent folders (e.g. resolving the FileObject or its base name) is wrapped with the filename and requested depth in the message.
Solutions
- Verify the filename resolves in VFS (try KettleVFS.getFileObject(filename) in a test) and exists
- Simplify the path: avoid special characters and confirm the folder depth requested is smaller than the actual path depth
- Check permissions on the file and its parent folders
- Check the cause exception for VFS/scheme-specific errors (e.g. sftp auth failures)
Example fix
// before: file missing at processing time
zipFile.processRowFile( ... "/data/removed-dir/report.zip" ... );
// after: guard existence first
FileObject fo = KettleVFS.getFileObject( filename );
if ( fo == null || !fo.exists() ) { throw new KettleException( "File does not exist: " + filename ); }
zipFile.processRowFile( ... filename ... ); Defensive patterns
Strategy: try-catch
Validate before calling
// check the file resolves and exists before depth-based naming
FileObject fo = KettleVFS.getFileObject( filename );
if ( fo == null || !fo.exists() ) {
throw new KettleException( "Cannot resolve file for depth-naming: " + filename );
} Type guard
boolean resolvable( String filename ) {
try {
FileObject fo = KettleVFS.getFileObject( filename );
return fo != null && fo.exists();
} catch ( Exception e ) { return false; }
} Try / catch
try {
String zipName = determineZipfilenameForDepth( filename, depth );
} catch ( KettleException e ) {
logError( "Could not build zip name for '" + filename + "': " + e.getCause() );
// fall back to a sanitized filename or skip this file
} Prevention
- Resolve files through KettleVFS consistently (same scheme/user settings)
- Ensure the source file still exists at processing time (no external deletion)
- Request depths no larger than the actual path depth
- Check filesystem permissions before zipping
When it happens
Trigger: Calling processRowFile with a filename that cannot be resolved through VFS, or whose parent chain cannot be walked (invalid URI, file missing, unsupported filesystem scheme, permission problem on getParent()).
Common situations: Filenames with special characters or spaces mis-encoded; using an unsupported VFS scheme; the source file/folder deleted between listing and depth computation; network filesystem timeouts (SMB/SFTP).
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
- ZipFile.Error.SourceFileNotExist
- ZipFile.Error.SourceFileNotFile
- ZipFile.Error.TargetParentFolderNotExists
- [ + ArgList[0] + ] is not a folder!
- Can not append to an existing zip file
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/848b0e33df604170.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/job/entries/zipfile/JobEntryZipFile.java:753
return filename;
}
FileObject fileObject = KettleVFS.getInstance( parentJobMeta.getBowl() ).getFileObject( filename, this );
FileObject folder = fileObject.getParent();
String baseName = fileObject.getName().getBaseName();
if ( depth == 1 ) {
return baseName;
}
StringBuilder path = new StringBuilder( baseName );
int d = 1;
while ( d < depth && folder != null ) {
path.insert( 0, '/' );
path.insert( 0, folder.getName().getBaseName() );
folder = folder.getParent();
d++;
}
return path.toString();
} catch ( Exception e ) {
throw new KettleException( "Unable to get zip filename '" + filename + "' to depth " + depth, e );
}
}
private boolean checkContainsFile( String realSourceDirectoryOrFile, FileObject[] filelist, boolean isDirectory ) throws FileSystemException {
boolean retval = false;
for ( int i = 0; i < filelist.length; i++ ) {
FileObject file = filelist[i];
if ( ( file.exists() && file.getType().equals( FileType.FILE ) ) ) {
retval = true;
}
}
return retval;
}
public Result execute( Result previousResult, int nr ) {
Result result = previousResult;
List<RowMetaAndData> rows = result.getRows();
View on GitHub (pinned to f3058517a1)