{"record":{"id":"05a29255a38a91fc","repo":"apache/dolphinscheduler","slug":"generate-hivecli-sql-script-error","errorCode":null,"errorMessage":"generate hivecli sql script error","messagePattern":"generate hivecli sql script error","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java","lineNumber":206,"sourceCode":"\n        if (!Files.exists(path)) {\n            String script = rawScript.replaceAll(\"\\\\r\\\\n\", \"\\n\");\n\n            Set<PosixFilePermission> perms = PosixFilePermissions.fromString(RWXR_XR_X);\n            FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions.asFileAttribute(perms);\n            try {\n                if (OSUtils.isWindows()) {\n                    Files.createFile(path);\n                } else {\n                    if (!file.getParentFile().exists()) {\n                        file.getParentFile().mkdirs();\n                    }\n                    Files.createFile(path, attr);\n                }\n                Files.write(path, script.getBytes(), StandardOpenOption.APPEND);\n            } catch (IOException e) {\n                log.error(\"generate hivecli sql script error\", e);\n                throw new TaskException(\"generate hivecli sql script error\", e);\n            }\n        }\n        return scriptFileName;\n    }\n\n}\n","sourceCodeStart":188,"sourceCodeEnd":213,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java#L188-L213","documentation":"generateSqlScriptFile failed to create the local .sql script file that beeline will execute — Files.createFile threw because the file already exists (e.g. task retry with a stale work dir), the parent directory could not be created, or the worker lacks write permission. The offending input is the script path under the task execute directory; this is a worker-side filesystem failure before the CLI runs.","triggerScenarios":"Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java:206 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the execute directory for a stale script from a previous attempt and clean it on retry","Verify the worker user has write permission on the task execute path","Ensure disk space is available in the execute directory"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}