apache/dolphinscheduler · error · ServiceException
RESOURCE_NOT_EXIST_OR_NO_PERMISSION
RESOURCE_NOT_EXIST_OR_NO_PERMISSION
Error message
Referenced sub workflow is unavailable, userId:{}. What it means
A permission-check guard in TaskSubWorkflowPermissionChecker: after collecting the sub-workflow definition codes referenced by sub-workflow tasks, the referenced workflow definition was found deleted, not accessible to the author, or otherwise unresolvable — so the permission check for the referencing task cannot proceed. The faulty state is the referenced sub-workflow (code in SubWorkflowParameters); the message interpolates the operating userId.
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/TaskSubWorkflowPermissionChecker.java:78
for (TaskDefinition taskDefinition : taskDefinitions) {
if (!TaskTypeUtils.isSubWorkflowTask(taskDefinition.getTaskType())) {
continue;
}
SubWorkflowParameters subWorkflowParameters =
JSONUtils.parseObject(taskDefinition.getTaskParams(), SubWorkflowParameters.class);
if (subWorkflowParameters.getWorkflowDefinitionCode() > 0) {
subWorkflowDefinitionCodes.add(subWorkflowParameters.getWorkflowDefinitionCode());
}
}
if (subWorkflowDefinitionCodes.isEmpty()) {
return;
}
List<WorkflowDefinition> subWorkflowDefinitions =
workflowDefinitionDao.queryByCodes(subWorkflowDefinitionCodes);
if (subWorkflowDefinitions == null) {
log.warn("Referenced sub workflow is unavailable, userId:{}.", loginUser.getId());
throw new ServiceException(Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION);
}
Set<Long> existingSubWorkflowDefinitionCodes =
subWorkflowDefinitions.stream().map(WorkflowDefinition::getCode).collect(Collectors.toSet());
if (!existingSubWorkflowDefinitionCodes.containsAll(subWorkflowDefinitionCodes)) {
log.warn("Referenced sub workflow is unavailable, userId:{}.", loginUser.getId());
throw new ServiceException(Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION);
}
Set<Long> subWorkflowProjectCodes = subWorkflowDefinitions.stream()
.map(WorkflowDefinition::getProjectCode)
.collect(Collectors.toSet());
try {
for (Long projectCode : subWorkflowProjectCodes) {
projectService.checkHasProjectWritePermissionThrowException(loginUser, projectCode);
}
} catch (ServiceException ex) {
log.warn("Referenced sub workflow is unavailable, userId:{}.", loginUser.getId());View on GitHub (pinned to 02eac45a1b)
Solutions
- Verify the referenced sub-workflow still exists and is authorized to the author
- Update the sub-workflow task definition to reference a valid workflow definition code
- Grant the author the required permissions on the sub-workflow project
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/TaskSubWorkflowPermissionChecker.java:78 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/2568884939659fbb.
Report an issue: GitHub.