{"record":{"id":"a976b30b9963f6dd","repo":"apache/dolphinscheduler","slug":"10203","errorCode":"10203","errorMessage":"schedule {0} does not exist","messagePattern":"schedule (.+?) does not exist","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java","lineNumber":528,"sourceCode":"            return;\n        }\n        schedule.setUpdateTime(new Date());\n        schedule.setReleaseState(ReleaseState.OFFLINE);\n        scheduleDao.updateById(schedule);\n        WorkflowDefinition workflowDefinition =\n                workflowDefinitionDao.queryByCode(schedule.getWorkflowDefinitionCode()).orElse(null);\n        Project project = projectDao.queryByCode(workflowDefinition.getProjectCode());\n        schedulerApi.deleteScheduleTask(project.getId(), schedule.getId());\n    }\n\n    private void checkScheduleBelongsToProject(Schedule schedule, long projectCode) {\n        if (schedule == null) {\n            return;\n        }\n        WorkflowDefinition workflowDefinition =\n                workflowDefinitionDao.queryByCode(schedule.getWorkflowDefinitionCode()).orElse(null);\n        if (workflowDefinition == null || workflowDefinition.getProjectCode() != projectCode) {\n            throw new ServiceException(Status.SCHEDULE_NOT_EXISTS, schedule.getId());\n        }\n    }\n\n    private Schedule updateSchedule(Schedule schedule, WorkflowDefinition workflowDefinition,\n                                    String scheduleExpression, WarningType warningType, int warningGroupId,\n                                    FailureStrategy failureStrategy, Priority workflowInstancePriority,\n                                    String workerGroup, String tenantCode, long environmentCode) {\n        if (schedule.getReleaseState() == ReleaseState.ONLINE) {\n            log.warn(\"Schedule can not be updated due to schedule is {}, scheduleId:{}.\",\n                    ReleaseState.ONLINE.getDescp(), schedule.getId());\n            throw new ServiceException(Status.SCHEDULE_CRON_ONLINE_FORBID_UPDATE);\n        }\n\n        Date now = new Date();\n\n        tenantExistValidator.validate(tenantCode);\n        schedule.setTenantCode(tenantCode);\n","sourceCodeStart":510,"sourceCodeEnd":546,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java#L510-L546","documentation":"checkScheduleBelongsToProject validates that the given schedule's owning workflow definition exists and that its projectCode equals the project being operated on. When the workflow definition is missing or belongs to a different project, SCHEDULE_NOT_EXISTS is thrown with the schedule id — the schedule is effectively not addressable within that project.","triggerScenarios":"Calling onlineScheduler or offlineScheduler with a scheduleId whose workflow definition does not exist, or whose projectCode differs from the projectCode parameter.","commonSituations":"Using a scheduleId copied from another project/environment; schedule left orphaned after its workflow definition was deleted; mixed-up project codes in scripts or UI state.","solutions":["Confirm the scheduleId belongs to the project you are calling with; list schedules via the project's schedule API.","Pass the correct projectCode for the project that owns the schedule's workflow.","Re-create the workflow definition and schedule if the definition was deleted (orphaned schedule).","Check tenant scoping — ensure the login user has access to the owning project."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Schedule schedule = scheduleMapper.selectById(scheduleId);\nWorkflowDefinition wd = workflowDefinitionDao.queryByCode(schedule.getWorkflowDefinitionCode()).orElse(null);\nif (wd == null || wd.getProjectCode() != projectCode) {\n    throw new IllegalStateException(\"Schedule \" + scheduleId + \" not in project \" + projectCode);\n}","typeGuard":null,"tryCatchPattern":"try {\n    schedulerService.onlineScheduler(loginUser, projectCode, scheduleId);\n} catch (ServiceException e) {\n    if (e.getCode() == Status.SCHEDULE_NOT_EXISTS.getCode()) {\n        // re-list schedules for the project to find the correct id\n    }\n}","preventionTips":["Always fetch schedule ids from the owning project's schedule list API","Verify projectCode consistency across environments before deploying scripts","Clean up orphaned schedules when workflows are deleted","Don't hardcode schedule ids in cross-environment tooling"],"tags":["scheduler","resource-not-found","project-ownership"],"backgroundTag":"record-not-found","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"}