apache/dolphinscheduler · critical · ServiceException

INTERNAL_SERVER_ERROR_ARGS

INTERNAL_SERVER_ERROR_ARGS

Error message

INTERNAL_SERVER_ERROR_ARGS: internal server error: {0}

What it means

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.

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java:971

            if (graphHasCycle(taskNodes)) {
                log.error("workflow DAG has cycle.");
                throw new ServiceException(Status.WORKFLOW_NODE_HAS_CYCLE);
            }

            // check whether the workflow definition json is normal
            for (TaskNode taskNode : taskNodes) {
                if (!checkTaskParameters(taskNode.getType(), taskNode.getParams())) {
                    throw new ServiceException(Status.WORKFLOW_NODE_S_PARAMETER_INVALID, taskNode.getName());
                }

                // check extra params
                CheckUtils.checkOtherParams(taskNode.getExtras());
            }
        } catch (ServiceException e) {
            throw e;
        } catch (Exception e) {
            log.error(Status.INTERNAL_SERVER_ERROR_ARGS.getMsg(), e);
            throw new ServiceException(Status.INTERNAL_SERVER_ERROR_ARGS, e.getMessage());
        }
    }

    /**
     * get task node details based on workflow definition
     *
     * @param loginUser   loginUser
     * @param projectCode project code
     * @param code        workflow definition code
     * @return task node list
     */
    @Override
    public List<TaskDefinition> getTaskNodeListByDefinitionCode(User loginUser, long projectCode, long code) {
        Project project = projectDao.queryByCode(projectCode);
        // check user access for project
        projectService.checkProjectAndAuthThrowException(loginUser, project, null);

        WorkflowDefinition workflowDefinition = workflowDefinitionDao.queryByCode(code).orElse(null);

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Read the wrapped {0} message in the response/log stack trace to identify the root exception.
  2. Validate workflowJson with a JSON parser before calling the API to rule out syntax errors.
  3. Compare your JSON against a working workflow exported via the query API and align its structure.
  4. If the input is valid JSON but the error persists, check server logs for a bug and upgrade DolphinScheduler.

Example fix

// before
createWorkflow(user, projectCode, name, "not-json{{{", ...); // -> INTERNAL_SERVER_ERROR_ARGS
// after
ObjectMapper om = new ObjectMapper();
om.readTree("{\"tasks\":[...]}"); // validate first
createWorkflow(user, projectCode, name, validJson, ...);
Defensive patterns

Strategy: try-catch

Validate before calling

try { new ObjectMapper().readTree(workflowJson); } catch (JsonProcessingException e) {
    throw new IllegalArgumentException("workflowJson is not valid JSON", e);
}

Try / catch

try {
    saveWorkflow(json);
} catch (ServiceException e) {
    if (e.getCode() == Status.INTERNAL_SERVER_ERROR_ARGS.getCode()) {
        log.error("validation crashed: {}", e.getMessage()); // inspect root cause
    } else throw e;
}

Prevention

When it happens

Trigger: Malformed workflowJson that makes JSONUtils.toList/transformTask throw (bad JSON syntax, unexpected structure), or any runtime exception (NPE, ClassCastException) inside the check routine.

Common situations: 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.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/8be683ba76d65fe4. Report an issue: GitHub.