prestodb/presto · critical · PrestoException

NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR

NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR

Error message

Failed to start metadata sidecar

What it means

MetadataSidecarProcessFactory.getOrStart() starts the metadata sidecar process and returns its location. If starting the process throws, it closes the partially started process (adding close failures as suppressed exceptions) and rethrows as PrestoException NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR with the message 'Failed to start metadata sidecar'.

Source

Thrown at presto-spark-base/src/main/java/com/facebook/presto/spark/execution/nativeprocess/MetadataSidecarProcessFactory.java:111

                serverInfoCodec,
                config.getStartupTimeout(),
                config.getStorageOncallName(),
                config.getStorageUserName(),
                config.getStorageServiceName());
        try {
            process.start();
        }
        catch (ExecutionException | InterruptedException | java.io.IOException e) {
            if (e instanceof InterruptedException) {
                Thread.currentThread().interrupt();
            }
            try {
                process.close();
            }
            catch (Exception suppressed) {
                e.addSuppressed(suppressed);
            }
            throw new PrestoException(
                    NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR,
                    "Failed to start metadata sidecar",
                    e);
        }
        log.info("Metadata sidecar started at %s", process.getLocation());
        return process.getLocation();
    }

    @PreDestroy
    public synchronized void close()
    {
        executor.shutdownNow();
        scheduledExecutor.shutdownNow();
        if (process != null) {
            try {
                log.info("Stopping metadata sidecar at %s", process.getLocation());
                process.close();
            }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the cause `e` of this exception for the root failure (binary missing, exec denied, timeout)
  2. Ensure the sidecar binary is shipped to Spark workers/drivers and is executable (chmod +x, correct --binary-path config)
  3. Verify the driver's working directory and native temp storage are writable
  4. Check for port conflicts with the sidecar's configured listen port

Example fix

// before
native.binary-path=/wrong/path/presto_native_sidecar
// after
native.binary-path=/opt/presto/native/presto_native_sidecar  # executable and distributed via spark.files
Defensive patterns

Strategy: validation

Validate before calling

Path binary = Paths.get(config.getSidecarBinaryPath());
if (!Files.isRegularFile(binary) || !Files.isExecutable(binary)) {
    throw new IllegalStateException("Sidecar binary not executable: " + binary);
}

Try / catch

try {
    URI location = sidecarProcessFactory.getOrStart();
} catch (PrestoException e) {
    // read e + suppressed exceptions; the cause and suppressed close error both matter
}

Prevention

When it happens

Trigger: getOrStart() invokes the process factory to launch the sidecar and the underlying start fails (IOException from process creation, launch timeout, readiness failure); after process.close() cleanup, this exception is thrown at MetadataSidecarProcessFactory.java:111.

Common situations: Sidecar binary not found in the Spark file distribution (SparkFiles root), binary lacks execute permission, driver temp/working directory is unwritable, port conflicts, or incompatible native binary for the host OS/arch.

Related errors


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