prestodb/presto · critical · IllegalArgumentException

spill path %s is not writable; adjust experimental.spiller-s

Error message

spill path %s is not writable; adjust experimental.spiller-spill-path config property or filesystem permissions

What it means

FileSingleStreamSpillerFactory validates at construction that every configured spill path exists and is writable via File.canWrite(). If a configured spill directory is not writable by the Presto process user, it throws IllegalArgumentException immediately rather than failing later mid-query. This fails fast so misconfigured spill storage is detected before any spilling workload runs.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/spiller/FileSingleStreamSpillerFactory.java:110

            double maxUsedSpaceThreshold,
            CompressionCodec spillCompressionCodec,
            boolean spillEncryptionEnabled)
    {
        this.serdeFactory = new PagesSerdeFactory(requireNonNull(blockEncodingSerde, "blockEncodingSerde is null"), spillCompressionCodec);
        this.executor = requireNonNull(executor, "executor is null");
        this.spillerStats = requireNonNull(spillerStats, "spillerStats can not be null");
        requireNonNull(spillPaths, "spillPaths is null");
        this.spillPaths = ImmutableList.copyOf(spillPaths);
        spillPaths.forEach(path -> {
            try {
                createDirectories(path);
            }
            catch (IOException e) {
                throw new IllegalArgumentException(
                        format("could not create spill path %s; adjust experimental.spiller-spill-path config property or filesystem permissions", path), e);
            }
            if (!path.toFile().canWrite()) {
                throw new IllegalArgumentException(
                        format("spill path %s is not writable; adjust experimental.spiller-spill-path config property or filesystem permissions", path));
            }
        });
        this.maxUsedSpaceThreshold = maxUsedSpaceThreshold;
        this.spillEncryptionEnabled = spillEncryptionEnabled;
        this.roundRobinIndex = 0;
    }

    @PostConstruct
    public void cleanupOldSpillFiles()
    {
        spillPaths.forEach(FileSingleStreamSpillerFactory::cleanupOldSpillFiles);
    }

    @PreDestroy
    public void destroy()
    {
        executor.shutdownNow();

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check and fix filesystem permissions: chown -R presto:presto <spill-path> or chmod to allow write for the Presto process user.
  2. Verify the configured path is correct: set experimental.spiller-spill-path in config.properties to an existing, writable directory (e.g. /var/presto/temp).
  3. If running in a container/Kubernetes, ensure the volume mounted at the spill path is read-write and the container runs as a user with write access.
  4. Confirm the disk backing the spill path is not mounted read-only (mount | grep <path>) and remount rw if needed.

Example fix

// before (config.properties)
experimental.spiller-spill-path=/mnt/ro-disk/spill

// after
experimental.spiller-spill-path=/var/spill  # mkdir -p /var/spill && chown presto:presto /var/spill
Defensive patterns

Strategy: validation

Validate before calling

// before constructing the spiller factory / starting the server
for (Path p : spillPaths) {
    java.io.File f = p.toFile();
    if (!f.exists() || !f.isDirectory() || !f.canWrite()) {
        throw new IllegalStateException("Spill path not writable: " + p);
    }
}

Prevention

When it happens

Trigger: Creating a FileSingleStreamSpillerFactory (e.g. during LocalTempStorage/SpillerFactory initialization) when a path listed in experimental.spiller-spill-path (or spiller-spill-path in newer configs) points to a directory the OS user running Presto cannot write to, or to a path whose parent is not accessible.

Common situations: Spill directory owned by root while Presto runs as 'presto' user; directory permissions changed by security tooling; container image with read-only or non-created spill mount; spilling path on a read-only NFS mount; leftover wrong path in etc/properties after migrating nodes.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/5665a8cc8632f3d4. Report an issue: GitHub.