apache/dolphinscheduler · warning · ServiceException
10001
10001
Error message
request parameter {0} is not valid What it means
Thrown when releasing (online/offline) a task definition and the releaseState parameter is null. ReleaseTaskDefinition requires an explicit ReleaseState (ONLINE or OFFLINE); a missing state cannot be mapped to a valid transition, so the request is rejected before any lookup.
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java:343
return taskCodes;
}
/**
* release task definition
*
* @param loginUser login user
* @param projectCode project code
* @param code task definition code
* @param releaseState releaseState
*/
@Transactional
@Override
public void releaseTaskDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) {
Project project = projectDao.queryByCode(projectCode);
projectService.checkHasProjectWritePermissionThrowException(loginUser, project);
if (null == releaseState) {
throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, Constants.RELEASE_STATE);
}
TaskDefinition taskDefinition = taskDefinitionDao.queryByCode(code);
if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) {
throw new ServiceException(Status.TASK_DEFINE_NOT_EXIST, String.valueOf(code));
}
TaskDefinitionLog taskDefinitionLog =
taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(code, taskDefinition.getVersion());
if (taskDefinitionLog == null) {
log.error("Task definition does not exist, taskDefinitionCode:{}.", code);
throw new ServiceException(Status.TASK_DEFINE_NOT_EXIST, String.valueOf(code));
}
switch (releaseState) {
case OFFLINE:
taskDefinition.setFlag(Flag.NO);
taskDefinitionLog.setFlag(Flag.NO);
break;
case ONLINE:
taskDatasourcePermissionChecker.checkPermission(loginUser,View on GitHub (pinned to 02eac45a1b)
Solutions
- Always pass releaseState explicitly as ONLINE or OFFLINE (exact enum spelling).
- Validate the value against ReleaseState.values() client-side before sending the request.
- Catch ServiceException code 10001 and log which parameter was invalid (the message includes the parameter name RELEASE_STATE).
Example fix
// before client.releaseTaskDefinition(loginUser, projectCode, code, null); // 10001 // after ReleaseState state = ReleaseState.OFFLINE; client.releaseTaskDefinition(loginUser, projectCode, code, state);
Defensive patterns
Strategy: validation
Validate before calling
boolean valid = Arrays.stream(ReleaseState.values())
.anyMatch(s -> s.name().equals(releaseState));
if (!valid) { throw new IllegalArgumentException("releaseState must be ONLINE or OFFLINE"); } Type guard
ReleaseState parseReleaseState(String s) {
return s == null ? null : Arrays.stream(ReleaseState.values())
.filter(v -> v.name().equalsIgnoreCase(s)).findFirst().orElse(null);
} Try / catch
try {
taskDefinitionService.releaseTaskDefinition(loginUser, projectCode, code, state);
} catch (ServiceException e) {
if (e.getCode() == 10001) { /* invalid RELEASE_STATE: fix client payload */ }
throw e;
} Prevention
- Use the typed ReleaseState enum in clients instead of raw strings so nulls are caught at compile time.
- Ensure the request body/query includes the releaseState field with exact enum casing.
- Add a contract test asserting release requests always carry a non-null releaseState.
When it happens
Trigger: POST .../task-definition/{code}/release without the releaseState body/query parameter, or passing JSON that deserializes releaseState to null (wrong field name, invalid enum string silently coerced).
Common situations: API clients forgetting the releaseState field; sending "Online"/"online" casing or misspelled enum values that fail to bind; copy-pasted requests missing the body.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- ENVIRONMENT_NAME_IS_NULL
- The workflowDefinition should be online
- receivers must not be null
- url can not be null
- 10001
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/123099c68aa9c8aa.
Report an issue: GitHub.