quarkusio/quarkus · error · ConfigurationException

Unable to read the <path> file

Error message

Unable to read the <path> file

What it means

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.

Source

Thrown at extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/RedisDataLoader.java:26

import org.jboss.logging.Logger;

import io.quarkus.runtime.configuration.ConfigurationException;
import io.vertx.core.buffer.Buffer;
import io.vertx.mutiny.core.Vertx;
import io.vertx.mutiny.redis.client.Redis;
import io.vertx.redis.client.Command;
import io.vertx.redis.client.Request;

public class RedisDataLoader {

    static final Logger LOGGER = Logger.getLogger("RedisDataLoader");

    static void load(Vertx vertx, Redis redis, String path) {
        LOGGER.infof("Importing Redis data from %s", path);

        Buffer buffer = vertx.fileSystem().readFileBlocking(path);
        if (buffer == null) {
            throw new ConfigurationException("Unable to read the " + path + " file");
        }
        List<Request> batch = read(buffer.toString().lines().collect(Collectors.toList()));
        redis.batch(batch).await().atMost(Duration.ofMinutes(1));
    }

    private enum State {
        COMMAND,
        ARGUMENTS,
        PARAM,
        PARAM_IN_QUOTES,
        PARAM_IN_DOUBLE_QUOTES
    }

    private static boolean isComment(String line) {
        return line.startsWith("--") || line.startsWith("#");
    }

    private static List<Request> read(List<String> lines) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Verify the file exists at the configured path (absolute path is safest) and fix the configuration value
  2. If the file should ship with the app, place it under src/main/resources and reference the classpath-resolved location included in the artifact
  3. Check the container image / build config includes the import file
  4. Run from the working directory where the relative path resolves, or switch to an absolute path

Example fix

// before (config)
quarkus.redis.load-script=redis/import.redis // file not on disk
// after
quarkus.redis.load-script=/opt/app/config/import.redis // absolute, existing path
Defensive patterns

Strategy: validation

Validate before calling

java.nio.file.Path p = java.nio.file.Path.of(path);
if (!java.nio.file.Files.isRegularFile(p)) {
    throw new IllegalStateException("Redis import script missing: " + p.toAbsolutePath());
}

Try / catch

try {
    RedisDataLoader.load(vertx, redis, path);
} catch (ConfigurationException e) {
    log.error("Cannot read Redis import file " + path, e);
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/0f490daa9800ca1b. Report an issue: GitHub.