flowable/flowable-engine · error · FlowableException

Error converting resource stream

Error message

Error converting resource stream

What it means

Once the resource is confirmed present, the method streams it via dmnRepositoryService.getResourceAsStream and converts it with IOUtils.toByteArray; any exception in that read/convert path is wrapped in a generic FlowableException("Error converting resource stream", e). It signals an I/O or engine-level failure while reading resource bytes, not a missing resource.

Source

Thrown at modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/BaseDecisionResource.java:99

        DmnDeployment deployment = deploymentQuery.singleResult();
        if (deployment == null) {
            throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessDeploymentById(deployment);
        }

        List<String> resourceList = dmnRepositoryService.getDeploymentResourceNames(deploymentId);

        if (resourceList.contains(resourceId)) {
            String contentType = contentTypeResolver.resolveContentType(resourceId);
            response.setContentType(contentType);
            try (final InputStream resourceStream = dmnRepositoryService.getResourceAsStream(deploymentId, resourceId)) {
                return IOUtils.toByteArray(resourceStream);
                
            } catch (Exception e) {
                throw new FlowableException("Error converting resource stream", e);
            }
        } else {
            // Resource not found in deployment
            throw new FlowableObjectNotFoundException("Could not find a resource with id '" + resourceId + "' in deployment '" + deploymentId);
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Inspect the wrapped cause (getCause()) — the real failure (SQL error, IO error) is chained and logged.
  2. Verify database health and connection-pool settings; retry the request once connectivity is restored.
  3. Check the ACT_GEBYTEARRAY row for the resource; if corrupted, redeploy the deployment.
  4. For large resources, increase JDBC/network timeouts and heap used by the REST app.

Example fix

// before
byte[] data = resource.getDeploymentResourceData(deploymentId, resourceId, response); // wrapped FlowableException
// after
try {
    byte[] data = resource.getDeploymentResourceData(deploymentId, resourceId, response);
} catch (FlowableException e) {
    logger.error("Resource read failed; cause:", e.getCause());
    retryWithBackoff(() -> resource.getDeploymentResourceData(deploymentId, resourceId, response));
}
Defensive patterns

Strategy: retry

Try / catch

try {
    byte[] data = client.getDeploymentResourceData(deploymentId, resourceId);
} catch (FlowableException e) {
    Throwable cause = e.getCause(); // inspect real IO/SQL failure
    if (isTransient(cause)) retryWithBackoff(...); else throw e;
}

Prevention

When it happens

Trigger: dmnRepositoryService.getResourceAsStream(deploymentId, resourceId) throws or the stream read fails: database blob read error, connection loss mid-read, underlying FlowableException from the repository service for an unreadable resource row, or IOUtils.toByteArray IOException.

Common situations: Database connectivity problems or timeouts while fetching the GEBYTEARRAY blob row; corrupted byte-array rows after a partial deploy or DB migration; connection-pool exhaustion; large resources hitting stream/socket timeouts.

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/ad42615cfdb130e3. Report an issue: GitHub.