{"record":{"id":"c88254d47e5fa69f","repo":"apache/dolphinscheduler","slug":"schedule-not-exists","errorCode":"SCHEDULE_NOT_EXISTS","errorMessage":"SCHEDULE_NOT_EXISTS: schedule {scheduleId} does not exist","messagePattern":"SCHEDULE_NOT_EXISTS: 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":247,"sourceCode":"                                   String scheduleExpression,\n                                   WarningType warningType,\n                                   int warningGroupId,\n                                   FailureStrategy failureStrategy,\n                                   Priority workflowInstancePriority,\n                                   String workerGroup,\n                                   String tenantCode,\n                                   Long environmentCode) {\n\n        Project project = projectDao.queryByCode(projectCode);\n\n        projectService.checkHasProjectWritePermissionThrowException(loginUser, project);\n\n        // check schedule exists\n        Schedule schedule = scheduleDao.queryById(id);\n\n        if (schedule == null) {\n            log.error(\"Schedule does not exist, scheduleId:{}.\", id);\n            throw new ServiceException(Status.SCHEDULE_NOT_EXISTS, id);\n        }\n\n        WorkflowDefinition workflowDefinition =\n                workflowDefinitionDao.queryByCode(schedule.getWorkflowDefinitionCode()).orElse(null);\n        if (workflowDefinition == null || projectCode != workflowDefinition.getProjectCode()) {\n            log.error(\"workflow definition does not exist, workflowDefinitionCode:{}.\",\n                    schedule.getWorkflowDefinitionCode());\n            throw new ServiceException(Status.WORKFLOW_DEFINITION_NOT_EXIST,\n                    String.valueOf(schedule.getWorkflowDefinitionCode()));\n        }\n\n        return updateSchedule(schedule, workflowDefinition, scheduleExpression, warningType, warningGroupId,\n                failureStrategy, workflowInstancePriority, workerGroup, tenantCode, environmentCode);\n    }\n\n    /**\n     * query schedule\n     *","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java#L229-L265","documentation":"SCHEDULE_NOT_EXISTS is thrown by updateSchedule when scheduleDao.queryById(id) returns null, i.e. no schedule row exists for the supplied schedule id. The update is rejected before any workflow/project permission checks. The message interpolates the requested scheduleId.","triggerScenarios":"PUT /projects/{projectCode}/schedules/{id} with an id that was already deleted, an id from a different environment/database, or a typo (e.g. passing a workflow code instead of a schedule id).","commonSituations":"Scripts caching schedule ids that were later cleaned up; running the same cleanup twice; pointing at a dev database id while the API serves a prod database; id auto-increment mismatch after a DB restore.","solutions":["List existing schedules (GET /projects/{projectCode}/schedules) and use a valid id.","Re-create the schedule if it was deleted (POST /projects/{projectCode}/schedule) and use the returned id.","Verify you are calling the correct environment/project; ids are not portable across databases."],"exampleFix":"// before\nPUT /projects/1/schedules/9999   // id never existed\n// after\nPUT /projects/1/schedules/42     // id verified via GET /projects/1/schedules","handlingStrategy":"validation","validationCode":"Schedule existing = scheduleDao.queryById(scheduleId);\nif (existing == null) {\n    throw new IllegalStateException(\"Schedule \" + scheduleId + \" not found; refresh id list before updating\");\n}","typeGuard":null,"tryCatchPattern":"try { schedulerService.updateSchedule(...); } catch (ServiceException e) { if (e.getCode() == Status.SCHEDULE_NOT_EXISTS) { /* recreate schedule or refresh ids */ } }","preventionTips":["Fetch schedule ids from the list endpoint immediately before updating","Do not hardcode schedule ids in scripts or config","Make cleanup/update scripts re-query state each run"],"tags":["scheduler","not-found","rest-api"],"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"}