{"record":{"id":"ecbd0fe911e510d5","repo":"apache/dolphinscheduler","slug":"cancel-application-error-ecbd0f","errorCode":null,"errorMessage":"cancel application error","messagePattern":"cancel application 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":178,"sourceCode":"\n        String command = String.join(\" \", args);\n        log.info(\"hiveCli task command: {}\", command);\n\n        return command;\n\n    }\n\n    @Override\n    public AbstractParameters getParameters() {\n        return hiveCliParameters;\n    }\n\n    @Override\n    public void cancelApplication() throws TaskException {\n        try {\n            shellCommandExecutor.cancelApplication();\n        } catch (Exception e) {\n            throw new TaskException(\"cancel application error\", e);\n        }\n    }\n\n    protected String generateSqlScriptFile(String rawScript) {\n        String scriptFileName = String.format(\"%s/%s_node.sql\", taskRequest.getExecutePath(),\n                taskRequest.getTaskAppId());\n\n        File file = new File(scriptFileName);\n        Path path = file.toPath();\n\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);","sourceCodeStart":160,"sourceCodeEnd":196,"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#L160-L196","documentation":"ShellCommandExecutor.cancelApplication() threw while killing the beeline/hive CLI process during task cancellation — the process may already be dead, the kill signal undeliverable, or the task's execute directory unavailable. A cancellation-path failure only; wrapping in TaskException preserves the underlying cause for the kill audit trail.","triggerScenarios":"Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java:178 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the caused-by exception; already-terminated processes can be treated as best-effort cancellation","Manually kill the lingering beeline process by the PID recorded in the task log","Check worker permissions on the task 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-14T05:17:10.506Z"}