apache/seatunnel · warning
Python source stderr: {}
Error message
Python source stderr: {} What it means
PythonSourceReader's stderr pump thread reads the Python process's stderr line by line and logs each line at WARN as 'Python source stderr: {}'. This surfaces error output (tracebacks, library errors) from the embedded Python interpreter so failures are visible in SeaTunnel logs.
Source
Thrown at seatunnel-connectors-v2/connector-python/src/main/java/org/apache/seatunnel/connectors/seatunnel/python/source/PythonSourceReader.java:400
writer.flush();
}
}
private void startStderrPump() {
stderrPumpThread =
new Thread(
() -> {
try (BufferedReader stderrReader =
new BufferedReader(
new InputStreamReader(
process.getErrorStream(),
StandardCharsets.UTF_8))) {
String line;
int loggedLines = 0;
while ((line = stderrReader.readLine()) != null) {
appendStderrLine(line);
if (loggedLines < STDERR_HISTORY_LIMIT) {
LOG.warn("Python source stderr: {}", line);
} else if (loggedLines == STDERR_HISTORY_LIMIT) {
LOG.warn(
"Suppressing further Python source stderr lines for this process");
}
loggedLines++;
}
} catch (IOException e) {
if (!closeRequested && !stderrShutdownRequested) {
stderrPumpFailure = e;
}
}
},
"python-source-stderr-pump");
stderrPumpThread.setDaemon(true);
stderrPumpThread.start();
}
private void startStdoutPump() {View on GitHub (pinned to cf67b549a7)
Solutions
- Read the logged line to identify the Python-side problem — usually an import error or exception traceback from the script.
- Install missing Python dependencies in the environment the process runs in (matching the Python used by the connector).
- Fix the Python source script so it does not write benign output to stderr (use logging to a file or stdout for info).
- Check PYTHONPATH/python interpreter configuration for the connector; ensure the script path and interpreter are correct.
Example fix
// before (Python script)
print('progress 50%', file=sys.stderr)
// after
print('progress 50%') # or use logging to a file, not stderr Defensive patterns
Strategy: try-catch
Prevention
- Test the Python script standalone and confirm it runs without stderr output
- Pre-install all Python dependencies in the execution environment
- Redirect benign script output away from stderr
When it happens
Trigger: open() starts the stderr pump; any line the Python source process writes to stderr triggers the log — e.g. pip/import errors, unhandled Python exceptions, warnings printed to stderr.
Common situations: Missing Python dependencies in the python execution environment; syntax errors in the Python script; Python version mismatch; script writing progress/info messages to stderr (normal practice in Unix tooling).
Related errors
- Failed to start python source process with executable [{}] a
- Timed out after {} seconds while writing python.script.confi
- Python script exited before reading its first stdin line; py
- Python source process exited with code {}{}
- Suppressing further Python source stderr lines for this proc
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/50ba0985d9fa43d5.
Report an issue: GitHub.