{"record":{"id":"7632d782aab26d74","repo":"flowable/flowable-engine","slug":"failed-to-read-resource-resource-7632d7","errorCode":null,"errorMessage":"Failed to read resource <resource>","messagePattern":"Failed to read resource <resource>","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/autodeployment/AbstractEventAutoDeploymentStrategy.java","lineNumber":53,"sourceCode":"    public AbstractEventAutoDeploymentStrategy(CommonAutoDeploymentProperties deploymentProperties) {\n        super(deploymentProperties);\n    }\n\n    @Override\n    protected LockManager getLockManager(EventRegistryEngine engine, String deploymentNameHint) {\n        return engine.getEventRegistryEngineConfiguration().getLockManager(determineLockName(deploymentNameHint));\n    }\n\n    protected void addResource(Resource resource, EventDeploymentBuilder deploymentBuilder) {\n        String resourceName = determineResourceName(resource);\n        addResource(resource, resourceName, deploymentBuilder);\n    }\n\n    protected void addResource(Resource resource, String resourceName, EventDeploymentBuilder deploymentBuilder) {\n        try (InputStream inputStream = resource.getInputStream()) {\n            deploymentBuilder.addInputStream(resourceName, inputStream);\n        } catch (IOException ex) {\n            throw new UncheckedIOException(\"Failed to read resource \" + resource, ex);\n        }\n    }\n\n}\n","sourceCodeStart":35,"sourceCodeEnd":58,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/autodeployment/AbstractEventAutoDeploymentStrategy.java#L35-L58","documentation":"AbstractEventAutoDeploymentStrategy.addResource reads a Spring Resource's InputStream to add it to an event deployment. If resource.getInputStream() throws IOException (resource missing, unreadable, or closed), it wraps it in an UncheckedIOException with this message. It indicates the auto-deployment found a resource it could not actually read.","triggerScenarios":"Auto-deployment of event deployments (spring.auto-deploy) scanning a location whose matched Resource cannot be opened: file deleted between scan and read, unreadable permissions, broken classpath resource, or unreadable JAR entry.","commonSituations":"flowable.event-registry auto-deploy folder configured to a non-existent or permission-restricted directory; resources inside a nested/fat jar accessed as File; container mount issues in Docker/Kubernetes.","solutions":["Check the resource path exists and is readable by the process (ls / permissions).","Fix the auto-deploy location property so it points to a valid directory/classpath location.","If resources are inside a jar, ensure they are loaded as classpath resources, not file paths.","In containerized environments, verify the volume mount containing the deployment resources is present and readable."],"exampleFix":"# before: folder missing/unreadable\nflowable.event-registry.deployment-resource-location=classpath:/event-deployments/\n\n# after: resource exists on the classpath and is packaged\nsrc/main/resources/event-deployments/my-events.channel  # file actually present","handlingStrategy":"validation","validationCode":"Resource r = new FileSystemResource(path);\nif (!r.exists() || !r.isReadable()) {\n    throw new IllegalStateException(\"Auto-deploy resource missing/unreadable: \" + path);\n}","typeGuard":null,"tryCatchPattern":"try {\n    strategy.deployResources(deploymentName, resources);\n} catch (UncheckedIOException e) {\n    log.error(\"Unreadable deployment resource: {}\", e.getMessage(), e);\n}","preventionTips":["Verify auto-deploy directories exist and are readable at application startup.","Use classpath resources instead of file paths when packaged in jars.","Check volume mounts in containerized deployments."],"tags":["io","resource","auto-deployment","file-read"],"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-14T05:17:10.506Z"}