flowable/flowable-engine · error · FlowableException
problem reading zip input stream
Error message
problem reading zip input stream
What it means
addZipInputStream wraps any Exception raised while iterating zip entries (getNextEntry, read, close) in a FlowableException with this message, preserving the cause. It signals corrupted or unreadable zip content rather than a programming error.
Source
Thrown at modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDeploymentBuilderImpl.java:128
}
@Override
public AppDeploymentBuilder addZipInputStream(ZipInputStream zipInputStream) {
try {
ZipEntry entry = zipInputStream.getNextEntry();
while (entry != null) {
if (!entry.isDirectory()) {
String entryName = entry.getName();
byte[] bytes = IoUtil.readInputStream(zipInputStream, entryName);
AppResourceEntity resource = resourceEntityManager.create();
resource.setName(entryName);
resource.setBytes(bytes);
deployment.addResource(resource);
}
entry = zipInputStream.getNextEntry();
}
} catch (Exception e) {
throw new FlowableException("problem reading zip input stream", e);
}
return this;
}
@Override
public AppDeploymentBuilder name(String name) {
deployment.setName(name);
return this;
}
@Override
public AppDeploymentBuilder category(String category) {
deployment.setCategory(category);
return this;
}
@Override
public AppDeploymentBuilder key(String key) {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Inspect the wrapped cause (e.getCause()) to find the underlying zip error.
- Verify the file is a valid, complete zip (unzip -t / ZipFile test) before deploying.
- Re-download or re-export the artifact.
- Ensure the stream is fresh and not closed before addZipInputStream runs; keep construction and deployment in the same scope.
Example fix
// before
builder.addZipInputStream(new java.util.zip.ZipInputStream(closedStream));
// after
try (InputStream in = new java.io.FileInputStream(zipFile)) {
builder.addZipInputStream(new java.util.zip.ZipInputStream(in));
} catch (FlowableException e) {
logger.error("bad app zip: {}", e.getCause());
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
// verify the stream is a readable zip before deploying
if (!zipFile.getName().endsWith(".zip") && !zipFile.getName().endsWith(".bar"))
throw new IllegalArgumentException("not a zip artifact: " + zipFile); Try / catch
try {
builder.addZipInputStream(new java.util.zip.ZipInputStream(in));
} catch (org.flowable.common.engine.api.FlowableException e) {
Throwable cause = e.getCause();
logger.error("Zip deploy failed: {}", cause == null ? e : cause);
throw new IllegalStateException("Invalid app zip artifact", e);
} Prevention
- Validate zip integrity (unzip -t) before deploying
- Keep the stream open until the builder finishes consuming it
- Re-download artifacts after failed transfers
- Never pass an already-consumed stream
When it happens
Trigger: Passing a corrupt/truncated zip stream, a stream of wrong format (e.g. gzip), an already-closed stream, or an entry read that throws IOException while deploying an app bar file via addZipInputStream.
Common situations: Incomplete upload of an app .zip/.bar artifact, file renamed to .zip without being a zip, stream closed by a try-with-resources before the builder consumes it, or an interrupted download.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- problem reading zip input stream
- Failed to read resource ${resource}
- text is null
- bytes array is null
- deploymentId is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/b9ea3a39fcc4bcf3.
Report an issue: GitHub.