{"record":{"id":"8a12d2460b0e7448","repo":"apache/seatunnel","slug":"python-executable-does-not-resolve-to-an-executabl","errorCode":null,"errorMessage":"python.executable does not resolve to an executable file: {}","messagePattern":"python\\.executable does not resolve to an executable file: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-python/src/main/java/org/apache/seatunnel/connectors/seatunnel/python/source/PythonSourceExecutionPolicy.java","lineNumber":121,"sourceCode":"    private static Path resolveConfiguredExecutable(String configuredExecutable)\n            throws IOException {\n        Path configuredPath = Paths.get(configuredExecutable);\n        Path resolvedPath;\n        if (configuredPath.isAbsolute()) {\n            resolvedPath = normalize(configuredPath);\n        } else if (configuredPath.getParent() == null) {\n            resolvedPath = resolveCommandFromPath(configuredExecutable);\n            if (resolvedPath == null) {\n                throw new IOException(\n                        \"Unable to resolve python.executable from PATH: \" + configuredExecutable);\n            }\n        } else {\n            throw new IllegalStateException(\n                    \"python.executable must be an absolute path or a bare command name: \"\n                            + configuredExecutable);\n        }\n        if (!Files.isRegularFile(resolvedPath) || !Files.isExecutable(resolvedPath)) {\n            throw new IOException(\n                    \"python.executable does not resolve to an executable file: \" + resolvedPath);\n        }\n        return resolvedPath;\n    }\n\n    private static Path resolveCommandFromPath(String command) {\n        String pathValue = System.getenv(\"PATH\");\n        if (pathValue == null || pathValue.trim().isEmpty()) {\n            return null;\n        }\n        for (String directory : pathValue.split(Pattern.quote(File.pathSeparator))) {\n            if (directory == null || directory.trim().isEmpty()) {\n                continue;\n            }\n            for (String commandName : expandCommandNames(command)) {\n                Path candidate = Paths.get(directory, commandName);\n                if (Files.isRegularFile(candidate) && Files.isExecutable(candidate)) {\n                    return normalize(candidate);","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-python/src/main/java/org/apache/seatunnel/connectors/seatunnel/python/source/PythonSourceExecutionPolicy.java#L103-L139","documentation":"Thrown after resolving python.executable when the resolved location is not a regular executable file (missing file, directory, broken symlink, or no execute permission). The policy validates before spawning so the failure is reported clearly instead of failing at process start.","triggerScenarios":"Configured path points to a nonexistent file, a directory (e.g. /usr/bin), or a file without +x permission; also reachable after PATH resolution finds a non-executable match.","commonSituations":"Interpreter removed/upgraded after config was written; dangling symlink after venv relocation; running as a user lacking execute permission on the binary.","solutions":["Verify the file exists and is executable: ls -l $(configured-path) and test -x","Reinstall or relink the interpreter (recreate the venv)","Fix permissions: chmod +x /path/to/python, or choose an interpreter the runtime user can execute","Ensure the path is also allowlisted in python.allowed.executables"],"exampleFix":"// before\npythonExecutable = \"/opt/old-venv/bin/python\"  # deleted\n// after\npythonExecutable = \"/usr/bin/python3\"","handlingStrategy":"validation","validationCode":"Path p = Paths.get(config.getPythonExecutable());\nif (!java.nio.file.Files.isRegularFile(p) || !java.nio.file.Files.isExecutable(p))\n    throw new IllegalArgumentException(\"Not an executable file: \" + p);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run test -x on the interpreter path on every worker at deploy time","Watch for venv relocation breaking symlinks","Grant execute permission to the SeaTunnel runtime user"],"tags":["python","filesystem","permissions","configuration"],"backgroundTag":"file-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}