apache/seatunnel · error · IllegalArgumentException

python.script.path must not be blank

Error message

python.script.path must not be blank

What it means

PythonSourceConfig.validate() throws this IllegalArgumentException when python.script.path is null, empty, or blank. The Python source must know which script file to run, so a missing script path is a fatal config validation error.

Source

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

    public String getFileFormatType() {
        return fileFormatType;
    }

    public String getFieldDelimiter() {
        return fieldDelimiter;
    }

    /**
     * Phase 1 keeps the stdout contract intentionally narrow so the first implementation can stay
     * compatible with the existing text deserializer.
     */
    private void validate() {
        if (StringUtils.isBlank(pythonExecutable)) {
            throw new IllegalArgumentException("python.executable must not be blank");
        }
        if (StringUtils.isBlank(pythonScriptPath)) {
            throw new IllegalArgumentException("python.script.path must not be blank");
        }
        if (!SUPPORTED_FILE_FORMAT.equalsIgnoreCase(fileFormatType)) {
            throw new IllegalArgumentException(
                    "Unsupported file_format_type: "
                            + fileFormatType
                            + ". Phase 1 supports only text");
        }
        if (fieldDelimiter == null) {
            throw new IllegalArgumentException("field_delimiter must not be null");
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set python.script.path to the absolute path of the Python script, e.g. "/opt/jobs/transform.py".
  2. Confirm the option key spelling matches the connector's documented Option name.
  3. Ensure the script file exists and is readable on all worker nodes.
  4. Check for empty-string values produced by variable interpolation in generated configs.

Example fix

// before
Python {
  python.script.path = ""
}
// after
Python {
  python.script.path = "/opt/jobs/transform.py"
}
Defensive patterns

Strategy: validation

Validate before calling

// Java: check script path before building config
String script = configMap.get("python.script.path");
if (script == null || script.trim().isEmpty()) {
    throw new IllegalArgumentException("python.script.path is required and must not be blank");
}
if (!java.nio.file.Files.isReadable(java.nio.file.Path.of(script))) {
    throw new IllegalArgumentException("python.script.path not readable on this node: " + script);
}

Try / catch

try { cfg = new PythonSourceConfig(configMap); } catch (IllegalArgumentException e) { LOG.error("Invalid python source config: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Constructing PythonSourceConfig where the python.script.path option is absent or set to blank; validate() is invoked during config creation before any data flow starts.

Common situations: Config template placeholders left unfilled; script path expected to be inherited from another config section but is not; typo in option name so the real value is never read.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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