apache/seatunnel · error · IllegalStateException

Python source allowlist entry must be an absolute path: {}

Error message

Python source allowlist entry must be an absolute path: {}

What it means

Thrown while parsing the python.allowed.executables allowlist when one comma-separated entry is a relative path (e.g. 'python3' or './venv/bin/python'). The security policy only accepts absolute interpreter paths so that every worker resolves the exact same binary.

Source

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

    }

    private static List<Path> parseAllowedExecutables() {
        String rawAllowlist = System.getProperty(PYTHON_ALLOWED_EXECUTABLES_PROPERTY, "");
        if (rawAllowlist.trim().isEmpty()) {
            throw new IllegalStateException(
                    "Server property "
                            + PYTHON_ALLOWED_EXECUTABLES_PROPERTY
                            + " must contain at least one absolute executable path");
        }
        Set<Path> allowedExecutables = new LinkedHashSet<>();
        for (String rawEntry : rawAllowlist.split(",")) {
            String entry = rawEntry.trim();
            if (entry.isEmpty()) {
                continue;
            }
            Path path = Paths.get(entry);
            if (!path.isAbsolute()) {
                throw new IllegalStateException(
                        "Python source allowlist entry must be an absolute path: " + entry);
            }
            allowedExecutables.add(normalize(path));
        }
        if (allowedExecutables.isEmpty()) {
            throw new IllegalStateException(
                    "Server property "
                            + PYTHON_ALLOWED_EXECUTABLES_PROPERTY
                            + " does not contain a usable absolute path");
        }
        return new ArrayList<>(allowedExecutables);
    }

    private static Path resolveConfiguredExecutable(String configuredExecutable)
            throws IOException {
        Path configuredPath = Paths.get(configuredExecutable);
        Path resolvedPath;
        if (configuredPath.isAbsolute()) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Replace each entry in the allowlist with an absolute path: python3 -> /usr/bin/python3
  2. Resolve ambiguous entries with: which python3 or readlink -f $(which python3)
  3. Expand ~ to the full home directory path; shell expansion does not happen for system properties

Example fix

// before
-Dpython.allowed.executables=python3,/opt/venv/bin/python
// after
-Dpython.allowed.executables=/usr/bin/python3,/opt/venv/bin/python
Defensive patterns

Strategy: validation

Validate before calling

for (String e : System.getProperty("python.allowed.executables","").split(",")) {
    if (!e.trim().isEmpty() && !java.nio.file.Paths.get(e.trim()).isAbsolute())
        throw new IllegalStateException("Not absolute: " + e);
}

Prevention

When it happens

Trigger: Setting the system property to a value containing a relative path segment, e.g. -Dpython.allowed.executables=python3 or /usr/bin/python3,myenv/bin/python

Common situations: Typing a bare command name (python3) into the allowlist; using './...' or '~' paths; an env-var expansion producing a relative value; mixing the allowlist syntax with the python.executable config, which does allow bare commands.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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