{"record":{"id":"9a1387e32613dca2","repo":"apache/dolphinscheduler","slug":"10023","errorCode":"10023","errorMessage":"online status does not allow update operations","messagePattern":"online status does not allow update operations","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java","lineNumber":539,"sourceCode":"    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\n        // updateWorkflowInstance param\n        if (!StringUtils.isEmpty(scheduleExpression)) {\n            ScheduleParam scheduleParam = JSONUtils.parseObject(scheduleExpression, ScheduleParam.class);\n            if (scheduleParam == null) {\n                log.warn(\"Parameter scheduleExpression is invalid, so parse cron error.\");\n                throw new ServiceException(Status.PARSE_TO_CRON_EXPRESSION_ERROR);\n            }\n            if (DateUtils.differSec(scheduleParam.getStartTime(), scheduleParam.getEndTime()) == 0) {\n                log.warn(\"The start time must not be the same as the end or time can not be null.\");\n                throw new ServiceException(Status.SCHEDULE_START_TIME_END_TIME_SAME);\n            }","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java#L521-L557","documentation":"updateSchedule refuses to modify a schedule whose releaseState is ONLINE (SCHEDULE_CRON_ONLINE_FORBID_UPDATE). Online schedules are considered active/running, so mutation is disallowed until the schedule is taken offline.","triggerScenarios":"Any updateSchedule call (direct or via updateScheduleByWorkflowDefinitionCode / REST PUT scheduler) on a schedule currently in ReleaseState.ONLINE.","commonSituations":"Editing a live schedule through the UI without first clicking 'offline'; CI scripts updating schedules while they run; concurrent operations where another user onlined the schedule between fetch and update.","solutions":["Take the schedule offline first (offlineScheduler / release API), then update, then bring it back online.","Check schedule.getReleaseState() before attempting an update and skip or offline accordingly.","Coordinate with teammates — the schedule may have been onlined by someone else.","In automation, wrap: offline -> update -> online."],"exampleFix":"// before\nscheduleService.updateSchedule(loginUser, projectCode, id, ...); // fails when online\n\n// after\nscheduleService.offlineScheduler(loginUser, projectCode, id);\nscheduleService.updateSchedule(loginUser, projectCode, id, ...);\nscheduleService.onlineScheduler(loginUser, projectCode, id);","handlingStrategy":"validation","validationCode":"Schedule schedule = scheduleDao.queryByWorkflowDefinitionCode(code);\nif (schedule != null && schedule.getReleaseState() == ReleaseState.ONLINE) {\n    throw new IllegalStateException(\"Offline schedule \" + schedule.getId() + \" before updating\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    schedulerService.updateSchedule(loginUser, projectCode, id, ...);\n} catch (ServiceException e) {\n    if (e.getCode() == Status.SCHEDULE_CRON_ONLINE_FORBID_UPDATE.getCode()) {\n        schedulerService.offlineScheduler(loginUser, projectCode, id);\n        schedulerService.updateSchedule(loginUser, projectCode, id, ...);\n        schedulerService.onlineScheduler(loginUser, projectCode, id);\n    }\n}","preventionTips":["Adopt offline -> update -> online as the standard update flow","Check ReleaseState before mutating schedules","Serialize schedule mutations to avoid concurrent online/offline races","Refresh schedule state from the server before editing in UIs"],"tags":["scheduler","immutable-state","release-state","conflict"],"backgroundTag":"invalid-state-transition","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"}