prestodb/presto · critical · PrestoException

OUT_OF_SPILL_SPACE

OUT_OF_SPILL_SPACE

Error message

No spill paths configured

What it means

getNextSpillPath() round-robins over configured spill paths, picking the first one with enough free disk space. When the configured spillPaths list is completely empty there is nothing to select, so it throws PrestoException with code OUT_OF_SPILL_SPACE and message 'No spill paths configured'. This is a configuration error surfaced as a spill-space failure.

Source

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

            spillCipher = Optional.of(new AesSpillCipher());
        }
        PagesSerde serde = serdeFactory.createPagesSerdeForSpill(spillCipher);
        return new FileSingleStreamSpiller(serde, executor, getNextSpillPath(), spillerStats, spillContext, memoryContext, spillCipher);
    }

    private synchronized Path getNextSpillPath()
    {
        int spillPathsCount = spillPaths.size();
        for (int i = 0; i < spillPathsCount; ++i) {
            int pathIndex = (roundRobinIndex + i) % spillPathsCount;
            Path path = spillPaths.get(pathIndex);
            if (hasEnoughDiskSpace(path)) {
                roundRobinIndex = (roundRobinIndex + i + 1) % spillPathsCount;
                return path;
            }
        }
        if (spillPaths.isEmpty()) {
            throw new PrestoException(OUT_OF_SPILL_SPACE, "No spill paths configured");
        }
        throw new PrestoException(OUT_OF_SPILL_SPACE, "No free space available for spill");
    }

    private boolean hasEnoughDiskSpace(Path path)
    {
        try {
            FileStore fileStore = getFileStore(path);
            return fileStore.getUsableSpace() > fileStore.getTotalSpace() * (1.0 - maxUsedSpaceThreshold);
        }
        catch (IOException e) {
            throw new PrestoException(OUT_OF_SPILL_SPACE, "Cannot determine free space for spill", e);
        }
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Configure at least one spill directory: add experimental.spiller-spill-path=<dir> (comma-separated for multiple) to config.properties and restart the coordinator/worker.
  2. If spill is not wanted, disable it (experimental.spill-enabled=false) instead of leaving spill enabled with no paths.
  3. Inspect how the config is loaded (SpillerConfig) to confirm the property key name matches your Presto version — property names changed across releases.
  4. Verify with jmx/CLI that each worker got the updated config; spill paths are per-node, so a worker with empty paths fails only its own queries.

Example fix

// before (config.properties, spill enabled but no path)
experimental.spill-enabled=true

// after
experimental.spill-enabled=true
experimental.spiller-spill-path=/var/spill,/mnt/spill2
Defensive patterns

Strategy: validation

Validate before calling

// at config load time
List<Path> paths = spillerConfig.getSpillPaths();
if (spillerConfig.isSpillEnabled() && (paths == null || paths.isEmpty())) {
    throw new IllegalStateException("spill enabled but no experimental.spiller-spill-path configured");
}

Try / catch

try {
    spillerFactory.create(sources, operatorContext);
} catch (PrestoException e) {
    if (e.getErrorCode().getCode() == OUT_OF_SPILL_SPACE.toErrorCode().getCode()) {
        // fail query with clear config guidance
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling FileSingleStreamSpillerFactory.create() (which invokes getNextSpillPath) when the spiller was built with an empty spill-paths collection — i.e. no spill directories were configured at all.

Common situations: etc/spiller.properties or config.properties missing spiller-spill-path entry while spill-enabled=true; config loader trimming/ignoring an empty value; building the factory programmatically with an empty list; dependency-injection wiring that supplied a default empty set.

Related errors


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