apache/dolphinscheduler · error · TaskException

generate hivecli sql script error

Error message

generate hivecli sql script error

What it means

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.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java:206

        if (!Files.exists(path)) {
            String script = rawScript.replaceAll("\\r\\n", "\n");

            Set<PosixFilePermission> perms = PosixFilePermissions.fromString(RWXR_XR_X);
            FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions.asFileAttribute(perms);
            try {
                if (OSUtils.isWindows()) {
                    Files.createFile(path);
                } else {
                    if (!file.getParentFile().exists()) {
                        file.getParentFile().mkdirs();
                    }
                    Files.createFile(path, attr);
                }
                Files.write(path, script.getBytes(), StandardOpenOption.APPEND);
            } catch (IOException e) {
                log.error("generate hivecli sql script error", e);
                throw new TaskException("generate hivecli sql script error", e);
            }
        }
        return scriptFileName;
    }

}

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Check the execute directory for a stale script from a previous attempt and clean it on retry
  2. Verify the worker user has write permission on the task execute path
  3. Ensure disk space is available in the execute directory
Defensive patterns

Strategy: try-catch

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/05a29255a38a91fc. Report an issue: GitHub.