{"record":{"id":"32908215bc413aee","repo":"apache/dolphinscheduler","slug":"hivecli-task-params-is-not-valid","errorCode":null,"errorMessage":"hiveCli task params is not valid","messagePattern":"hiveCli task params is not valid","errorType":"validation","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":83,"sourceCode":"\n    public HiveCliTask(TaskExecutionContext taskExecutionContext) {\n        super(taskExecutionContext);\n        this.shellCommandExecutor = new ShellCommandExecutor(taskExecutionContext);\n    }\n\n    @Override\n    public List<String> getApplicationIds() throws TaskException {\n        return Collections.emptyList();\n    }\n\n    @Override\n    public void init() {\n        log.info(\"hiveCli task params {}\", taskRequest.getTaskParams());\n\n        hiveCliParameters = JSONUtils.parseObject(taskRequest.getTaskParams(), HiveCliParameters.class);\n\n        if (!hiveCliParameters.checkParameters()) {\n            throw new TaskException(\"hiveCli task params is not valid\");\n        }\n    }\n\n    // todo split handle to submit and track\n    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        try {\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .appendScript(buildCommand());\n            final TaskResponse taskResponse = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);\n            setExitStatusCode(taskResponse.getExitStatusCode());\n            setAppIds(taskResponse.getAppIds());\n            setProcessId(taskResponse.getProcessId());\n            setTaskOutputParams(shellCommandExecutor.getTaskOutputParams());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            log.error(\"The current HiveCLI Task has been interrupted\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);","sourceCodeStart":65,"sourceCodeEnd":101,"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#L65-L101","documentation":"HiveCliTask.init() deserializes the task's params JSON into HiveCliParameters and calls checkParameters(). If required parameters are missing/blank (per HiveCliParameters.checkParameters, e.g. no SQL script for the chosen execution type), a TaskException('hiveCli task params is not valid') is thrown and the task fails before execution.","triggerScenarios":"Defining a HiveCLI task whose params JSON lacks the fields required by HiveCliParameters.checkParameters() — typically an empty hiveSqlScript when execution type is not TYPE_FILE, or an empty/absent resource list when type is 'FILE' — or params that deserialize to null fields.","commonSituations":"User saved the task definition without entering SQL; the 'FILE' execution type selected but no resource uploaded; workflow parameter substitution replaced the SQL with an empty string; a migration/version upgrade changed the params schema so old definitions no longer pass checkParameters.","solutions":["Open the HiveCLI task definition and fill in the required field: a non-empty hiveSqlScript (for SQL type) or exactly one .sql resource (for FILE type).","Verify the execution type selected matches what you provided (SQL script vs FILE resource).","Check that any workflow/parameter placeholders inside the SQL are not evaluating to empty at save/run time.","If upgrading DolphinScheduler, re-open and re-save the task definition so params are serialized in the current HiveCliParameters schema."],"exampleFix":"// before (task params json)\n{\"hiveCliTaskExecutionType\":\"SQL\",\"hiveSqlScript\":\"\"}\n// after\n{\"hiveCliTaskExecutionType\":\"SQL\",\"hiveSqlScript\":\"SELECT * FROM my_table;\"}","handlingStrategy":"validation","validationCode":"// Caller-side check before the task runs\nHiveCliParameters p = JSONUtils.parseObject(taskParamsJson, HiveCliParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalArgumentException(\n        \"Provide a non-empty hiveSqlScript (SQL type) or one sql resource (FILE type)\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (TaskException e) {\n    if (\"hiveCli task params is not valid\".equals(e.getMessage())) {\n        // surface which params are missing in the UI / fix the task definition\n    }\n}","preventionTips":["Always fill in the SQL script or select exactly one .sql resource when defining the task","Match the execution type (SQL vs FILE) to what you actually provided","Watch for workflow placeholders substituting to empty strings in the SQL","Re-save old task definitions after DolphinScheduler upgrades to refresh the params schema"],"tags":["hivecli","task-params","validation","dolphinscheduler"],"backgroundTag":"missing-required-config-field","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"}