{"record":{"id":"61344457a9f1fcdb","repo":"apache/dolphinscheduler","slug":"submit-dinkytask-failed-result-get-api-result-ms","errorCode":null,"errorMessage":"Submit dinkyTask failed:${result.get(API_RESULT_MSG)}","messagePattern":"Submit dinkyTask failed:(.+?)","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-dinky/src/main/java/org/apache/dolphinscheduler/plugin/task/dinky/DinkyTask.java","lineNumber":165,"sourceCode":"            String address = this.dinkyParameters.getAddress();\n            String taskId = this.dinkyParameters.getTaskId();\n            boolean isOnline = this.dinkyParameters.isOnline();\n            JsonNode result;\n            String apiResultDataKey = DinkyTaskConstants.API_RESULT_DATA;\n            // Submit dinky-1.0.0 task\n            result = submitTaskV1(address, taskId, isOnline, generateVariables());\n            if (checkResultV1(result)) {\n                status = result.get(DinkyTaskConstants.API_RESULT_SUCCESS).asBoolean();\n                if (result.get(apiResultDataKey).has(DinkyTaskConstants.API_RESULT_JOB_INSTANCE_ID)\n                        && !(result.get(apiResultDataKey)\n                                .get(DinkyTaskConstants.API_RESULT_JOB_INSTANCE_ID) instanceof NullNode)) {\n                    jobInstanceId =\n                            result.get(apiResultDataKey).get(DinkyTaskConstants.API_RESULT_JOB_INSTANCE_ID).asText();\n                }\n            } else {\n                log.error(DinkyTaskConstants.SUBMIT_FAILED_MSG + \"{}\", result.get(DinkyTaskConstants.API_RESULT_MSG));\n                setExitStatusCode(EXIT_CODE_FAILURE);\n                throw new TaskException(\n                        DinkyTaskConstants.SUBMIT_FAILED_MSG + result.get(DinkyTaskConstants.API_RESULT_MSG));\n            }\n        } catch (Exception ex) {\n            Thread.currentThread().interrupt();\n            log.error(DinkyTaskConstants.SUBMIT_FAILED_MSG, ex);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(DinkyTaskConstants.SUBMIT_FAILED_MSG, ex);\n        }\n    }\n\n    public void trackApplicationStatusV0() throws TaskException {\n        try {\n            String address = this.dinkyParameters.getAddress();\n            String taskId = this.dinkyParameters.getTaskId();\n            if (status && jobInstanceId == null) {\n                // Use address-taskId as app id\n                setAppIds(String.format(DinkyTaskConstants.APPIDS_FORMAT, address, taskId));\n                setExitStatusCode(mapStatusToExitCode(true));","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-dinky/src/main/java/org/apache/dolphinscheduler/plugin/task/dinky/DinkyTask.java#L147-L183","documentation":"In DinkyTask.submitApplicationV1(), the Dinky API responded but with a non-success result: the response's msg field (API_RESULT_MSG) is logged and appended to 'Submit dinkyTask failed:' and thrown as TaskException. Unlike 783, the HTTP call itself succeeded — Dinky rejected the submission and returned an error payload.","triggerScenarios":"The Dinky V1 API returns a JSON body whose success flag is false; the API result msg (e.g. authentication failure, unknown task id, Dinky-side compile error) is included in the thrown message.","commonSituations":"Wrong Dinky task id or task deleted in Dinky; invalid Dinky token/credentials; the referenced Dinky job fails on save/submit server-side (e.g. Flink SQL error).","solutions":["Read the appended API result message in the exception/log — it states Dinky's own rejection reason.","Verify the taskId exists in Dinky and the caller has permission to submit it.","Check Dinky authentication config (token/user) used by the task.","Open the job in the Dinky UI and fix any server-side job errors, then rerun."],"exampleFix":"// before: nonexistent task id\n{\"address\":\"http://dinky:8888\",\"taskId\":99999}\n// after\n{\"address\":\"http://dinky:8888\",\"taskId\":12}","handlingStrategy":"try-catch","validationCode":"// pre-check that the dinky task id exists\n// GET {address}/dinky-task/{taskId} expecting success=true","typeGuard":null,"tryCatchPattern":"try {\n    task.submitApplication();\n} catch (TaskException e) {\n    log.error(\"Dinky rejected submit: {}\", e.getMessage()); // message carries API_RESULT_MSG\n}","preventionTips":["Verify the Dinky task id exists before scheduling the workflow.","Keep Dinky auth tokens valid and rotated.","Fix job compile errors in the Dinky UI before automation runs."],"tags":["dinky","api-error","http-response"],"backgroundTag":"http-error-response","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"}