{"record":{"id":"f0942b6bd9d7ba59","repo":"apache/dolphinscheduler","slug":"linkis-task-params-is-not-valid","errorCode":null,"errorMessage":"Linkis task params is not valid","messagePattern":"Linkis task params is not valid","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java","lineNumber":75,"sourceCode":"    protected static final Pattern LINKIS_STATUS_REGEX = Pattern.compile(Constants.LINKIS_STATUS_REGEX);\n\n    public LinkisTask(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        linkisParameters = JSONUtils.parseObject(taskRequest.getTaskParams(), LinkisParameters.class);\n        log.info(\"Initialize Linkis task params {}\", JSONUtils.toPrettyJsonString(linkisParameters));\n\n        if (!linkisParameters.checkParameters()) {\n            throw new RuntimeException(\"Linkis task params is not valid\");\n        }\n    }\n\n    @Override\n    public void submitApplication() throws TaskException {\n        try {\n            // construct process\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .properties(ParameterUtils.convert(taskRequest.getPrepareParamsMap()))\n                    .appendScript(buildCommand());\n            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, null);\n            setExitStatusCode(commandExecuteResult.getExitStatusCode());\n            setAppIds(findTaskId(commandExecuteResult.getResultString()));\n            setProcessId(commandExecuteResult.getProcessId());\n            linkisParameters.dealOutParam(shellCommandExecutor.getTaskOutputParams());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            log.error(\"The current Linkis task has been interrupted\", e);","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java#L57-L93","documentation":"LinkisTask.init() parses the task's JSON params into LinkisParameters and validates them via checkParameters(). When required fields are absent or inconsistent, it throws this RuntimeException to abort task initialization before any process is launched. It signals a task-definition problem, not a runtime/infra failure.","triggerScenarios":"LinkisParameters.checkParameters() returns false because required fields in the Linkis task definition JSON are empty or missing (e.g. no params content), or taskRequest.getTaskParams() contains JSON that parses but fails validation.","commonSituations":"Users create a Linkis task node in the DolphinScheduler UI but leave required fields blank; task JSON generated by automation/API lacks mandatory keys; workflow import produces params that no longer satisfy checkParameters().","solutions":["Open the task definition in the DolphinScheduler UI and fill in all required Linkis parameters.","Validate the task JSON stored in the DB / passed via API contains a non-empty, correct params payload for LinkisParameters.","Read LinkisParameters.checkParameters() to see exactly which fields it requires and ensure they are set.","Re-save the workflow so updated params are serialized into taskRequest.taskParams, then rerun."],"exampleFix":"// before (task params JSON)\n{\"localParams\":[],\"resourceList\":[]}\n// after\n{\"localParams\":[],\"resourceList\":[],\"params\":\"<required linkis params>\"}","handlingStrategy":"validation","validationCode":"LinkisParameters p = JSONUtils.parseObject(taskParams, LinkisParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalArgumentException(\"Linkis task params invalid: fill required fields before submitting\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (RuntimeException e) {\n    log.error(\"Linkis params rejected: {}\", e.getMessage());\n    // surface param-validation failure to the user instead of retrying\n}","preventionTips":["Always complete all required fields in the Linkis task UI form before saving.","Validate task params in a test workflow before production.","Keep param JSON in sync with LinkisParameters after upgrades.","Log and review the pretty-printed params to confirm required keys."],"tags":["linkis","task-params","validation","dolphinscheduler"],"backgroundTag":"schema-validation-failed","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"}