{"record":{"id":"8be683ba76d65fe4","repo":"apache/dolphinscheduler","slug":"internal-server-error-args","errorCode":"INTERNAL_SERVER_ERROR_ARGS","errorMessage":"INTERNAL_SERVER_ERROR_ARGS: internal server error: {0}","messagePattern":"INTERNAL_SERVER_ERROR_ARGS: internal server error: (.+?)","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"critical","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java","lineNumber":971,"sourceCode":"            if (graphHasCycle(taskNodes)) {\n                log.error(\"workflow DAG has cycle.\");\n                throw new ServiceException(Status.WORKFLOW_NODE_HAS_CYCLE);\n            }\n\n            // check whether the workflow definition json is normal\n            for (TaskNode taskNode : taskNodes) {\n                if (!checkTaskParameters(taskNode.getType(), taskNode.getParams())) {\n                    throw new ServiceException(Status.WORKFLOW_NODE_S_PARAMETER_INVALID, taskNode.getName());\n                }\n\n                // check extra params\n                CheckUtils.checkOtherParams(taskNode.getExtras());\n            }\n        } catch (ServiceException e) {\n            throw e;\n        } catch (Exception e) {\n            log.error(Status.INTERNAL_SERVER_ERROR_ARGS.getMsg(), e);\n            throw new ServiceException(Status.INTERNAL_SERVER_ERROR_ARGS, e.getMessage());\n        }\n    }\n\n    /**\n     * get task node details based on workflow definition\n     *\n     * @param loginUser   loginUser\n     * @param projectCode project code\n     * @param code        workflow definition code\n     * @return task node list\n     */\n    @Override\n    public List<TaskDefinition> getTaskNodeListByDefinitionCode(User loginUser, long projectCode, long code) {\n        Project project = projectDao.queryByCode(projectCode);\n        // check user access for project\n        projectService.checkProjectAndAuthThrowException(loginUser, project, null);\n\n        WorkflowDefinition workflowDefinition = workflowDefinitionDao.queryByCode(code).orElse(null);","sourceCodeStart":953,"sourceCodeEnd":989,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java#L953-L989","documentation":"Generic catch-all in checkWorkflowJsonValidation: any non-ServiceException exception during workflow JSON parsing/validation is wrapped as INTERNAL_SERVER_ERROR_ARGS with the underlying exception message as {0}. It signals an unexpected failure (NPE, ClassCastException, JSON decode error) inside the validation routine rather than a known validation rejection.","triggerScenarios":"Malformed workflowJson that makes JSONUtils.toList/transformTask throw (bad JSON syntax, unexpected structure), or any runtime exception (NPE, ClassCastException) inside the check routine.","commonSituations":"Passing non-JSON or truncated strings to the create/update workflow API; JSON with wrong nesting that causes casts to fail; server-side bugs; corrupted import files.","solutions":["Read the wrapped {0} message in the response/log stack trace to identify the root exception.","Validate workflowJson with a JSON parser before calling the API to rule out syntax errors.","Compare your JSON against a working workflow exported via the query API and align its structure.","If the input is valid JSON but the error persists, check server logs for a bug and upgrade DolphinScheduler."],"exampleFix":"// before\ncreateWorkflow(user, projectCode, name, \"not-json{{{\", ...); // -> INTERNAL_SERVER_ERROR_ARGS\n// after\nObjectMapper om = new ObjectMapper();\nom.readTree(\"{\\\"tasks\\\":[...]}\"); // validate first\ncreateWorkflow(user, projectCode, name, validJson, ...);","handlingStrategy":"try-catch","validationCode":"try { new ObjectMapper().readTree(workflowJson); } catch (JsonProcessingException e) {\n    throw new IllegalArgumentException(\"workflowJson is not valid JSON\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    saveWorkflow(json);\n} catch (ServiceException e) {\n    if (e.getCode() == Status.INTERNAL_SERVER_ERROR_ARGS.getCode()) {\n        log.error(\"validation crashed: {}\", e.getMessage()); // inspect root cause\n    } else throw e;\n}","preventionTips":["Always send well-formed, complete workflow JSON (round-trip an exported definition as template)","Catch and log the wrapped cause server-side to find the real exception","Upgrade if stack traces show an internal bug in transformTask/checkTaskParameters"],"tags":["internal-error","json","unexpected-exception"],"backgroundTag":"internal-invariant-violation","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"}