flowable/flowable-engine · error · FlowableException

Error converting resource stream

Error message

Error converting resource stream

What it means

FlowableException wrapping any exception raised while reading the deployment resource stream and converting it to a byte array with IOUtils.toByteArray. It signals an I/O or engine-level failure while streaming the resource, not a missing resource (that has its own error). The original exception is attached as the cause.

Source

Thrown at modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDeploymentResourceDataResource.java:89

        // Check if deployment exists
        AppDeployment deployment = appRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
        if (deployment == null) {
            throw new FlowableObjectNotFoundException("Could not find an app deployment with id '" + deploymentId);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessDeploymentById(deployment);
        }

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

        if (resourceList.contains(resourceName)) {
            response.setContentType("application/json");
            try (final InputStream resourceStream = appRepositoryService.getResourceAsStream(deploymentId, resourceName)) {
                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 name '" + resourceName + "' in deployment '" + deploymentId);
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Inspect the wrapped cause exception in the stack trace
  2. Verify database connectivity and integrity of the resource blobs
  3. Re-deploy the app to recreate the resource entry
  4. Retry the request if it was a transient connection failure

Example fix

// server log shows cause: 'Could not get JDBC Connection'
// fix: restore DB connectivity / pool, then retry
// before
GET /app-repository/app-deployments/123/resources/app.json  -> 500
// after (DB healthy)
200 OK with JSON body
Defensive patterns

Strategy: try-catch

Validate before calling

if (appRepositoryService.getDeploymentResourceNames(deploymentId).contains(resourceName)) { /* safe to fetch */ }

Try / catch

try { byte[] data = /* REST call */; } catch (FlowableException e) { Throwable cause = e.getCause(); log.error("Resource stream failed", cause); }

Prevention

When it happens

Trigger: GET .../resources/{resourceName} when appRepositoryService.getResourceAsStream(deploymentId, resourceName) throws (e.g. database blob read failure) or the InputStream cannot be read fully.

Common situations: Database connectivity drops mid-read, corrupted blob data in ACT_GE_BYTEARRAY, missing JDBC driver class in older setups.

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