{"record":{"id":"2f3452c25848d0cb","repo":"apache/dolphinscheduler","slug":"unsupported-task-depend-type-taskdependtype","errorCode":null,"errorMessage":"\"Unsupported task depend type: \" + taskDependType","messagePattern":"\"Unsupported task depend type: \" \\+ taskDependType","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/graph/WorkflowGraphTopologyLogicalVisitor.java","lineNumber":74,"sourceCode":"    }\n\n    public static WorkflowGraphBfsVisitorBuilder builder() {\n        return new WorkflowGraphBfsVisitorBuilder();\n    }\n\n    public void visit() {\n        switch (taskDependType) {\n            case TASK_ONLY:\n                visitStartNodesOnly();\n                break;\n            case TASK_PRE:\n                visitToStartNodes();\n                break;\n            case TASK_POST:\n                visitFromStartNodes();\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unsupported task depend type: \" + taskDependType);\n        }\n    }\n\n    /**\n     * Visit start nodes only.\n     */\n    private void visitStartNodesOnly() {\n        doVisitationInSubGraph(Sets.newHashSet(startNodes));\n    }\n\n    /**\n     * Find the graph nodes that can be reached to the start nodes, and then do visitation with topology logical.\n     */\n    private void visitToStartNodes() {\n        final LinkedList<String> bootstrapTaskCodes = new LinkedList<>(startNodes);\n        final Set<String> subGraphNodes = new HashSet<>();\n        while (!bootstrapTaskCodes.isEmpty()) {\n            String taskName = bootstrapTaskCodes.removeFirst();","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/graph/WorkflowGraphTopologyLogicalVisitor.java#L56-L92","documentation":"WorkflowGraphTopologyLogicalVisitor visits a workflow DAG filtered by TaskDependType (TASK_PRE, TASK_POST, etc.). The visitor's visit() switch has no branch for the given taskDependType, so the default arm throws this IllegalArgumentException. It means the depend type is not one of the supported enum values for topology visiting.","triggerScenarios":"Calling visit() with a TaskDependType value outside TASK_PRE/TASK_POST — either a null/unknown enum value or a newly added enum constant that the visitor has not been updated to handle (e.g. ALL_TASKS / CONDITION branches not implemented here).","commonSituations":"Adding a new TaskDependType enum constant without updating this visitor's switch; deserializing a depend type from an older/newer version's data that maps to an unhandled constant; passing a raw/default enum value by mistake in custom master-engine extensions.","solutions":["Only call visit() with TaskDependType.TASK_PRE or TaskDependType.TASK_POST","Add a case for the missing TaskDependType in WorkflowGraphTopologyLogicalVisitor.visit() if the new type should be supported","Verify the enum value's origin (API payload, DB column) — map legacy/unknown values to a supported type before visiting","Catch IllegalArgumentException and skip/log unsupported depend types when scanning mixed-version data"],"exampleFix":"// before\nswitch (taskDependType) {\n    case TASK_PRE: visitToStartNodes(); break;\n    case TASK_POST: visitFromStartNodes(); break;\n    default: throw new IllegalArgumentException(...);\n}\n// after\nswitch (taskDependType) {\n    case TASK_PRE: visitToStartNodes(); break;\n    case TASK_POST: visitFromStartNodes(); break;\n    case ALL_TASKS: visitToStartNodes(); visitFromStartNodes(); break;\n    default: throw new IllegalArgumentException(\"Unsupported task depend type: \" + taskDependType);\n}","handlingStrategy":"validation","validationCode":"if (taskDependType != TaskDependType.TASK_PRE && taskDependType != TaskDependType.TASK_POST) {\n    throw new IllegalStateException(\"Depend type not supported by topology visitor: \" + taskDependType);\n}","typeGuard":"boolean isVisitable(TaskDependType t) {\n    return t == TaskDependType.TASK_PRE || t == TaskDependType.TASK_POST;\n}","tryCatchPattern":"try {\n    visitor.visit();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported task depend type\")) {\n        log.warn(\"Skipping unsupported depend type\", e);\n        return;\n    }\n    throw e;\n}","preventionTips":["When adding a TaskDependType constant, update every switch over it (search for 'taskDependType')","Sanitize depend-type values deserialized from external/legacy data","Write a unit test per enum constant exercising the visitor switch","Enable exhaustive-switch warnings/linting so a new constant fails compilation instead of runtime"],"tags":["workflow-graph","enum","task-depend-type"],"backgroundTag":"invalid-enum-value","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"}