apache/dolphinscheduler · error · ServiceException
DATA_IS_NOT_VALID
DATA_IS_NOT_VALID
Error message
DATA_IS_NOT_VALID: data {0} is not valid What it means
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.
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java:939
log.warn("No workflow lineage to delete, workflowDefinitionCode: {}", code);
}
}
log.info("Success delete workflow definition workflowDefinitionCode: {}", code);
}
/**
* check the workflow task relation json
*
* @param workflowTaskRelationJson workflow task relation json
* @return check result code
*/
@Override
public void checkWorkflowNodeList(String workflowTaskRelationJson,
List<TaskDefinitionLog> taskDefinitionLogsList) {
try {
if (workflowTaskRelationJson == null) {
log.error("workflow task relation data is null.");
throw new ServiceException(Status.DATA_IS_NOT_VALID, "null");
}
List<WorkflowTaskRelation> taskRelationList =
JSONUtils.toList(workflowTaskRelationJson, WorkflowTaskRelation.class);
// Check whether the task node is normal
List<TaskNode> taskNodes = processService.transformTask(taskRelationList, taskDefinitionLogsList);
if (CollectionUtils.isEmpty(taskNodes)) {
log.error("Task node data is empty.");
throw new ServiceException(Status.WORKFLOW_DAG_IS_EMPTY);
}
// check has cycle
if (graphHasCycle(taskNodes)) {
log.error("workflow DAG has cycle.");
throw new ServiceException(Status.WORKFLOW_NODE_HAS_CYCLE);
}
View on GitHub (pinned to 02eac45a1b)
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.
Example fix
// before
String relations = null;
service.checkWorkflowNodeList(relations, taskDefs); // DATA_IS_NOT_VALID
// after
if (relations == null || relations.isEmpty()) {
relations = "[]"; // valid empty relation list
}
service.checkWorkflowNodeList(relations, taskDefs); Defensive patterns
Strategy: validation
Validate before calling
if (workflowTaskRelationJson == null || workflowTaskRelationJson.isEmpty()) {
throw new IllegalArgumentException("workflowTaskRelationJson is required");
}
List<WorkflowTaskRelation> rels = JSONUtils.toList(workflowTaskRelationJson, WorkflowTaskRelation.class);
if (rels == null) throw new IllegalArgumentException("relation JSON is not parseable"); Type guard
boolean isValidRelationJson(String json) {
if (json == null || json.isEmpty()) return false;
List<WorkflowTaskRelation> l = JSONUtils.toList(json, WorkflowTaskRelation.class);
return l != null;
} Try / catch
try { service.checkWorkflowNodeList(relations, taskDefs); }
catch (ServiceException e) { /* e.getArgs()[0] names the invalid data; fix payload */ } Prevention
- Generate relation JSON from typed objects, never raw strings
- Ensure every relation's taskCode exists in taskDefinitionLogsList
- Validate imported workflow JSON before save
When it happens
Trigger: 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).
Common situations: 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.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- 50017
- cannot merge json message to protobuf definition type <messa
- itemsList is null
- url can not be null
- headerParams is not a valid json
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/78d068a15a6b2599.
Report an issue: GitHub.