{"record":{"id":"2568884939659fbb","repo":"apache/dolphinscheduler","slug":"resource-not-exist-or-no-permission-256888","errorCode":"RESOURCE_NOT_EXIST_OR_NO_PERMISSION","errorMessage":"Referenced sub workflow is unavailable, userId:{}.","messagePattern":"Referenced sub workflow is unavailable, userId:(.+?)\\.","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/TaskSubWorkflowPermissionChecker.java","lineNumber":78,"sourceCode":"        for (TaskDefinition taskDefinition : taskDefinitions) {\n            if (!TaskTypeUtils.isSubWorkflowTask(taskDefinition.getTaskType())) {\n                continue;\n            }\n            SubWorkflowParameters subWorkflowParameters =\n                    JSONUtils.parseObject(taskDefinition.getTaskParams(), SubWorkflowParameters.class);\n            if (subWorkflowParameters.getWorkflowDefinitionCode() > 0) {\n                subWorkflowDefinitionCodes.add(subWorkflowParameters.getWorkflowDefinitionCode());\n            }\n        }\n\n        if (subWorkflowDefinitionCodes.isEmpty()) {\n            return;\n        }\n\n        List<WorkflowDefinition> subWorkflowDefinitions =\n                workflowDefinitionDao.queryByCodes(subWorkflowDefinitionCodes);\n        if (subWorkflowDefinitions == null) {\n            log.warn(\"Referenced sub workflow is unavailable, userId:{}.\", loginUser.getId());\n            throw new ServiceException(Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION);\n        }\n        Set<Long> existingSubWorkflowDefinitionCodes =\n                subWorkflowDefinitions.stream().map(WorkflowDefinition::getCode).collect(Collectors.toSet());\n        if (!existingSubWorkflowDefinitionCodes.containsAll(subWorkflowDefinitionCodes)) {\n            log.warn(\"Referenced sub workflow is unavailable, userId:{}.\", loginUser.getId());\n            throw new ServiceException(Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION);\n        }\n\n        Set<Long> subWorkflowProjectCodes = subWorkflowDefinitions.stream()\n                .map(WorkflowDefinition::getProjectCode)\n                .collect(Collectors.toSet());\n        try {\n            for (Long projectCode : subWorkflowProjectCodes) {\n                projectService.checkHasProjectWritePermissionThrowException(loginUser, projectCode);\n            }\n        } catch (ServiceException ex) {\n            log.warn(\"Referenced sub workflow is unavailable, userId:{}.\", loginUser.getId());","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/TaskSubWorkflowPermissionChecker.java#L60-L96","documentation":"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.","triggerScenarios":"Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/TaskSubWorkflowPermissionChecker.java:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}