flowable/flowable-engine · error · FlowableException

Could not completely read inputstream

Error message

Could not completely read inputstream 

What it means

Thrown by InputStreamSource.getBytesFromInputStream when the stream ended before the expected number of bytes was read (offset < bytes.length). This indicates a truncated stream: the byte-count expectation did not match the actual stream content. Note the message has no suffix detail.

Solutions

  1. Verify the source resource is complete and not truncated (re-download/re-upload it)
  2. Check network stability if the stream comes from a remote URL/repository
  3. Compare the resource's declared size with the bytes actually available
  4. Regenerate or redeploy the corrupted artifact
Defensive patterns

Strategy: validation

Validate before calling

long expected = resource.length();
long actual = Files.size(Paths.get(path));
if (expected != actual) throw new IllegalStateException("truncated resource: " + path);

Try / catch

try {
    InputStream is = source.getInputStream();
} catch (FlowableException e) {
    if (e.getMessage().contains("completely read")) {
        throw new IllegalStateException("artifact truncated — re-upload the resource");
    }
}

Prevention

When it happens

Trigger: The wrapped stream reports fewer bytes than the buffer expected — stream truncated at source (partial download, early EOF) or length metadata larger than actual data.

Common situations: Corrupted or partially uploaded deployment artifacts; network interruptions reading remote resources; reading streams whose available length was miscomputed.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/16bfdeab399443a5. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/util/io/InputStreamSource.java:69

    }

    @Override
    public String toString() {
        return "InputStream";
    }

    public byte[] getBytesFromInputStream(InputStream inStream) throws IOException {
        long length = inStream.available();
        byte[] bytes = new byte[(int) length];

        int offset = 0;
        int numRead = 0;
        while (offset < bytes.length && (numRead = inStream.read(bytes, offset, bytes.length - offset)) >= 0) {
            offset += numRead;
        }

        if (offset < bytes.length) {
            throw new FlowableException("Could not completely read inputstream ");
        }

        // Close the input stream and return bytes
        inStream.close();
        return bytes;
    }

}

View on GitHub (pinned to d6d39ce1c6)