pentaho/pentaho-kettle · error · KettleException
ZipFile.ErrorCreatingZip
Error message
ZipFile.ErrorCreatingZip
What it means
The ZipFile step wraps any Exception raised while streaming a source file into the zip output as this KettleException, from the read/write loop in zipFile(). It indicates the zip archive could not be created or completed — usually an unreadable source file, a missing parent directory for the target zip, or an I/O failure mid-write.
Solutions
- Read the chained cause 'e' — it names the actual I/O problem (FileNotFoundException, disk full, etc.).
- Verify the output zip's parent directory exists and is writable before running the step.
- Verify all source files listed are readable at the moment the step runs (permissions, not locked/deleted).
- Check free disk space on the volume holding the target zip.
- Avoid concurrent steps writing to the same zip file.
Example fix
// before: output dir does not exist -> out.write fails
String zipFile = "/data/out/archive.zip";
// after: ensure parent dir first
Files.createDirectories(Paths.get("/data/out"));
String zipFile = "/data/out/archive.zip"; Defensive patterns
Strategy: try-catch
Validate before calling
File out = new File(zipPath);
if (!out.getParentFile().canWrite()) throw new IllegalStateException("Cannot write to " + out.getParent());
if (!new File(sourcePath).canRead()) throw new IllegalStateException("Cannot read source " + sourcePath); Try / catch
try {
runTransformation(zipFileTrans);
} catch (KettleException e) {
Throwable cause = e.getCause(); // inspect real I/O cause
log.error("Zip creation failed: {}", cause != null ? cause.getMessage() : e.getMessage(), e);
throw e;
} Prevention
- Monitor free disk space on the output volume.
- Pre-create and verify writability of the output directory.
- Avoid concurrent jobs writing the same target zip.
- Check source files are readable (not locked by other processes) before zipping.
When it happens
Trigger: zipFile() throws while in.read fails (source file unreadable/deleted), out.write fails (disk full, target zip path in non-existent directory, permissions), or the ZipOutputStream itself errors during create/close.
Common situations: Source file removed by another process between listing and zipping; output folder deleted at runtime; insufficient disk space; permission denied on the target zip path; concurrent runs writing the same zip file.
Understand the failure class
Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.
Related errors
- ' ' is not a directory
- Error opening new file
- ex.getMessage()
- GPG.ErrorCreatingTempFile
- GPG.ErrorWritingTempFile
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/cf11e27cf1ec4e04.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java:435
// Get full filename
relativeName = KettleVFS.getFilename( data.sourceFile );
if ( data.baseFolder != null ) {
// Remove base folder
data.baseFolder += Const.FILE_SEPARATOR;
relativeName = relativeName.replace( data.baseFolder, "" );
}
}
if ( !fileSet.contains( relativeName ) ) {
out.putNextEntry( new ZipEntry( relativeName ) );
int len;
while ( ( len = in.read( buffer ) ) > 0 ) {
out.write( buffer, 0, len );
}
}
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG, "ZipFile.ErrorCreatingZip" ), e );
} finally {
try {
if ( in != null ) {
// Close the current file input stream
in.close();
}
if ( out != null ) {
// Close the ZipOutPutStream
out.flush();
out.closeEntry();
out.close();
}
if ( buff != null ) {
buff.close();
}
if ( dest != null ) {
dest.close();
}View on GitHub (pinned to f3058517a1)