{"record":{"id":"78d068a15a6b2599","repo":"apache/dolphinscheduler","slug":"data-is-not-valid","errorCode":"DATA_IS_NOT_VALID","errorMessage":"DATA_IS_NOT_VALID: data {0} is not valid","messagePattern":"DATA_IS_NOT_VALID: data (.+?) is not valid","errorType":"validation","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java","lineNumber":939,"sourceCode":"                log.warn(\"No workflow lineage to delete, workflowDefinitionCode: {}\", code);\n            }\n        }\n        log.info(\"Success delete workflow definition workflowDefinitionCode: {}\", code);\n    }\n\n    /**\n     * check the workflow task relation json\n     *\n     * @param workflowTaskRelationJson workflow task relation json\n     * @return check result code\n     */\n    @Override\n    public void checkWorkflowNodeList(String workflowTaskRelationJson,\n                                      List<TaskDefinitionLog> taskDefinitionLogsList) {\n        try {\n            if (workflowTaskRelationJson == null) {\n                log.error(\"workflow task relation data is null.\");\n                throw new ServiceException(Status.DATA_IS_NOT_VALID, \"null\");\n            }\n\n            List<WorkflowTaskRelation> taskRelationList =\n                    JSONUtils.toList(workflowTaskRelationJson, WorkflowTaskRelation.class);\n            // Check whether the task node is normal\n            List<TaskNode> taskNodes = processService.transformTask(taskRelationList, taskDefinitionLogsList);\n\n            if (CollectionUtils.isEmpty(taskNodes)) {\n                log.error(\"Task node data is empty.\");\n                throw new ServiceException(Status.WORKFLOW_DAG_IS_EMPTY);\n            }\n\n            // check has cycle\n            if (graphHasCycle(taskNodes)) {\n                log.error(\"workflow DAG has cycle.\");\n                throw new ServiceException(Status.WORKFLOW_NODE_HAS_CYCLE);\n            }\n","sourceCodeStart":921,"sourceCodeEnd":957,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java#L921-L957","documentation":"Thrown by checkWorkflowNodeList when the workflow task relation JSON is invalid: null JSON, unparseable JSON, or a task node list that fails processService.transformTask validation. The offending data description is passed as the {0} parameter.","triggerScenarios":"Saving/updating a workflow with workflowTaskRelationJson = null; malformed JSON strings; relations referencing task definitions that are missing or inconsistent (e.g. no pre/post tasks resolved).","commonSituations":"Hand-crafted API payloads with wrong relation JSON; frontend sending empty relation arrays paired with task definitions; version upgrades where the relation schema changed; import of corrupted workflow JSON exports.","solutions":["Ensure workflowTaskRelationJson is valid JSON per WorkflowTaskRelation (preTasks, postTasks, taskCode fields).","Verify every relation's taskCode matches a task definition in taskDefinitionLogsList.","Validate the payload with the workflow validation endpoint or JSONUtils round-trip before calling save/import."],"exampleFix":"// before\nString relations = null;\nservice.checkWorkflowNodeList(relations, taskDefs); // DATA_IS_NOT_VALID\n// after\nif (relations == null || relations.isEmpty()) {\n    relations = \"[]\"; // valid empty relation list\n}\nservice.checkWorkflowNodeList(relations, taskDefs);","handlingStrategy":"validation","validationCode":"if (workflowTaskRelationJson == null || workflowTaskRelationJson.isEmpty()) {\n    throw new IllegalArgumentException(\"workflowTaskRelationJson is required\");\n}\nList<WorkflowTaskRelation> rels = JSONUtils.toList(workflowTaskRelationJson, WorkflowTaskRelation.class);\nif (rels == null) throw new IllegalArgumentException(\"relation JSON is not parseable\");","typeGuard":"boolean isValidRelationJson(String json) {\n    if (json == null || json.isEmpty()) return false;\n    List<WorkflowTaskRelation> l = JSONUtils.toList(json, WorkflowTaskRelation.class);\n    return l != null;\n}","tryCatchPattern":"try { service.checkWorkflowNodeList(relations, taskDefs); }\ncatch (ServiceException e) { /* e.getArgs()[0] names the invalid data; fix payload */ }","preventionTips":["Generate relation JSON from typed objects, never raw strings","Ensure every relation's taskCode exists in taskDefinitionLogsList","Validate imported workflow JSON before save"],"tags":["validation","json","workflow-relation","input-validation"],"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"}