{"record":{"id":"0f490daa9800ca1b","repo":"quarkusio/quarkus","slug":"unable-to-read-the-path-file","errorCode":null,"errorMessage":"Unable to read the <path> file","messagePattern":"Unable to read the <path> file","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/RedisDataLoader.java","lineNumber":26,"sourceCode":"import org.jboss.logging.Logger;\n\nimport io.quarkus.runtime.configuration.ConfigurationException;\nimport io.vertx.core.buffer.Buffer;\nimport io.vertx.mutiny.core.Vertx;\nimport io.vertx.mutiny.redis.client.Redis;\nimport io.vertx.redis.client.Command;\nimport io.vertx.redis.client.Request;\n\npublic class RedisDataLoader {\n\n    static final Logger LOGGER = Logger.getLogger(\"RedisDataLoader\");\n\n    static void load(Vertx vertx, Redis redis, String path) {\n        LOGGER.infof(\"Importing Redis data from %s\", path);\n\n        Buffer buffer = vertx.fileSystem().readFileBlocking(path);\n        if (buffer == null) {\n            throw new ConfigurationException(\"Unable to read the \" + path + \" file\");\n        }\n        List<Request> batch = read(buffer.toString().lines().collect(Collectors.toList()));\n        redis.batch(batch).await().atMost(Duration.ofMinutes(1));\n    }\n\n    private enum State {\n        COMMAND,\n        ARGUMENTS,\n        PARAM,\n        PARAM_IN_QUOTES,\n        PARAM_IN_DOUBLE_QUOTES\n    }\n\n    private static boolean isComment(String line) {\n        return line.startsWith(\"--\") || line.startsWith(\"#\");\n    }\n\n    private static List<Request> read(List<String> lines) {","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/RedisDataLoader.java#L8-L44","documentation":"RedisDataLoader.load reads the configured import script file synchronously via Vert.x filesystem and throws ConfigurationException if the read returns null. This means the file at the given path could not be read — usually because it does not exist or is not accessible from the application's working directory.","triggerScenarios":"quarkus.redis.load-script (or equivalent) points to a path that does not exist on disk; relative path resolved against a different working directory than expected; file excluded from the packaged application (e.g. not under src/main/resources, filtered out by build tooling).","commonSituations":"Running the packaged jar where a dev-only import file is missing from the classpath; container images that do not COPY the import file; path typo or OS path separator issues; running from a different working directory in IDE vs CLI.","solutions":["Verify the file exists at the configured path (absolute path is safest) and fix the configuration value","If the file should ship with the app, place it under src/main/resources and reference the classpath-resolved location included in the artifact","Check the container image / build config includes the import file","Run from the working directory where the relative path resolves, or switch to an absolute path"],"exampleFix":"// before (config)\nquarkus.redis.load-script=redis/import.redis // file not on disk\n// after\nquarkus.redis.load-script=/opt/app/config/import.redis // absolute, existing path","handlingStrategy":"validation","validationCode":"java.nio.file.Path p = java.nio.file.Path.of(path);\nif (!java.nio.file.Files.isRegularFile(p)) {\n    throw new IllegalStateException(\"Redis import script missing: \" + p.toAbsolutePath());\n}","typeGuard":null,"tryCatchPattern":"try {\n    RedisDataLoader.load(vertx, redis, path);\n} catch (ConfigurationException e) {\n    log.error(\"Cannot read Redis import file \" + path, e);\n}","preventionTips":["Use absolute paths for import scripts in containers and CI","Place bundled scripts under src/main/resources so they are packaged in the jar","Verify the working directory your app runs from resolves relative paths correctly"],"tags":["redis","file-io","configuration","missing-file"],"backgroundTag":"missing-file","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}