{"record":{"id":"61d97e2a78e14616","repo":"flowable/flowable-engine","slug":"error-converting-resource-stream-61d97e","errorCode":null,"errorMessage":"Error converting resource stream","messagePattern":"Error converting resource stream","errorType":"http","errorClass":"FlowableException","httpStatus":500,"severity":"error","filePath":"modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/BaseDmnDeploymentResourceDataResource.java","lineNumber":75,"sourceCode":"        DmnDeployment deployment = deploymentQuery.singleResult();\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a DMN deployment with id '\" + deploymentId);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessDeploymentById(deployment);\n        }\n\n        List<String> resourceList = dmnRepositoryService.getDeploymentResourceNames(deploymentId);\n\n        if (resourceList.contains(resourceName)) {\n            String contentType = contentTypeResolver.resolveContentType(resourceName);\n            response.setContentType(contentType);\n            try (final InputStream resourceStream = dmnRepositoryService.getResourceAsStream(deploymentId, resourceName)) {\n                return IOUtils.toByteArray(resourceStream);\n                \n            } catch (Exception e) {\n                throw new FlowableException(\"Error converting resource stream\", e);\n            }\n            \n        } else {\n            // Resource not found in deployment\n            throw new FlowableObjectNotFoundException(\"Could not find a resource with name '\" + resourceName + \"' in deployment '\" + deploymentId);\n        }\n    }\n}\n","sourceCodeStart":57,"sourceCodeEnd":84,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/BaseDmnDeploymentResourceDataResource.java#L57-L84","documentation":"When the named resource exists, getDmnDeploymentResourceData streams it via dmnRepositoryService.getResourceAsStream(deploymentId, resourceName) and converts with IOUtils.toByteArray; any failure is wrapped as FlowableException(\"Error converting resource stream\", e). This is an I/O or engine-level failure while reading the resource bytes, not a lookup miss.","triggerScenarios":"getResourceAsStream succeeds in lookup but the read/convert fails: DB blob (ACT_GEBYTEARRAY) read error, connection drop mid-stream, IOException from IOUtils.toByteArray, or a FlowableException from the repository service.","commonSituations":"Transient database outages or pool exhaustion; corrupted byte-array rows after failed/partial deploys or migrations; very large DMN resources hitting read timeouts; network instability between app and DB.","solutions":["Inspect and log the chained cause (e.getCause()) to find the underlying SQL/IO failure.","Retry the request after verifying database and connection-pool health.","If the stored byte array is corrupted, redeploy the DMN deployment to regenerate it.","Raise JDBC/network read timeouts for large resources."],"exampleFix":"// before\nbyte[] data = resourceData.getDmnDeploymentResourceData(deploymentId, name, response); // throws\n// after\ntry {\n    byte[] data = resourceData.getDmnDeploymentResourceData(deploymentId, name, response);\n} catch (FlowableException e) {\n    logger.warn(\"Stream read failed, cause:\", e.getCause());\n    data = retry(() -> resourceData.getDmnDeploymentResourceData(deploymentId, name, response), 2);\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return client.getDmnDeploymentResourceData(deploymentId, resourceName);\n} catch (FlowableException e) {\n    logger.warn(\"cause:\", e.getCause());\n    return retryWithBackoff(() -> client.getDmnDeploymentResourceData(deploymentId, resourceName), 2);\n}","preventionTips":["Inspect e.getCause() to diagnose the underlying IO/SQL error","Keep DB connection pools healthy; alert on saturation","Redeploy deployments whose blob rows are suspected corrupt"],"tags":["io","stream","database"],"backgroundTag":"file-read-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}