apache/seatunnel · error · IllegalArgumentException

python.script.path does not point to a readable file: {}

Error message

python.script.path does not point to a readable file: {}

What it means

Thrown by PythonSourceReader.validateScriptPath() when the configured python.script.path does not point to an existing regular file. The reader refuses to start a python process for a script it cannot read.

Source

Thrown at seatunnel-connectors-v2/connector-python/src/main/java/org/apache/seatunnel/connectors/seatunnel/python/source/PythonSourceReader.java:297

                lifecycleLock.notifyAll();
            }
        }

        if (interrupted) {
            Thread.currentThread().interrupt();
            if (closeException == null) {
                closeException = new IOException("Interrupted while closing python source reader");
            }
        }
        if (closeException != null) {
            throw closeException;
        }
    }

    private Path validateScriptPath() {
        Path scriptPath = Paths.get(sourceConfig.getPythonScriptPath());
        if (!Files.isRegularFile(scriptPath)) {
            throw new IllegalArgumentException(
                    "python.script.path does not point to a readable file: " + scriptPath);
        }
        return scriptPath;
    }

    private void configureWorkingDirectory(ProcessBuilder processBuilder, Path scriptPath) {
        String workingDirectory = sourceConfig.getPythonWorkingDirectory();
        Path processDirectory;
        if (workingDirectory != null && !workingDirectory.trim().isEmpty()) {
            processDirectory = Paths.get(workingDirectory);
            if (!Files.isDirectory(processDirectory)) {
                throw new IllegalArgumentException(
                        "python.working.directory is not a directory: " + processDirectory);
            }
        } else {
            processDirectory = scriptPath.toAbsolutePath().getParent();
        }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Deploy the script to the exact absolute path on every worker node
  2. Use an absolute path in python.script.path
  3. Verify with: test -f /path/to/script.py on each worker
  4. Package the script with the job or place it in a shared mount

Example fix

// before
python.script.path = "scripts/job.py"
// after
python.script.path = "/opt/seatunnel/scripts/job.py"  # present on all workers
Defensive patterns

Strategy: validation

Validate before calling

Path sp = Paths.get(config.getPythonScriptPath());
if (!java.nio.file.Files.isRegularFile(sp))
    throw new IllegalArgumentException("python.script.path missing or not a file: " + sp);

Prevention

When it happens

Trigger: sourceConfig.getPythonScriptPath() points to a nonexistent path, a directory, or a broken symlink when open() -> validateScriptPath() runs on a worker node.

Common situations: Script present on the client machine but not shipped to every worker node; typo in the configured path; path relative to a different working directory; script mounted after job start.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/c2b0839e0f57a002. Report an issue: GitHub.