{"record":{"id":"eef21e108076309d","repo":"apache/dolphinscheduler","slug":"request-params-not-valid-error-eef21e","errorCode":"REQUEST_PARAMS_NOT_VALID_ERROR","errorMessage":"REQUEST_PARAMS_NOT_VALID_ERROR: request parameter {crontab} is not valid","messagePattern":"REQUEST_PARAMS_NOT_VALID_ERROR: request parameter (.+?) is not valid","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java","lineNumber":170,"sourceCode":"        scheduleObj.setProjectName(project.getName());\n        scheduleObj.setWorkflowDefinitionCode(workflowDefinitionCode);\n        scheduleObj.setWorkflowDefinitionName(workflowDefinition.getName());\n\n        ScheduleParam scheduleParam = JSONUtils.parseObject(schedule, ScheduleParam.class);\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        }\n        if (scheduleParam.getStartTime().getTime() > scheduleParam.getEndTime().getTime()) {\n            log.warn(\"The start time must smaller than end time\");\n            throw new ServiceException(Status.START_TIME_BIGGER_THAN_END_TIME_ERROR);\n        }\n\n        scheduleObj.setStartTime(scheduleParam.getStartTime());\n        scheduleObj.setEndTime(scheduleParam.getEndTime());\n        if (!CronUtils.isValidExpression(scheduleParam.getCrontab())) {\n            log.error(\"Schedule crontab verify failure, crontab:{}.\", scheduleParam.getCrontab());\n            throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, scheduleParam.getCrontab());\n        }\n        scheduleObj.setCrontab(scheduleParam.getCrontab());\n        validateMissedFirePolicy(scheduleParam);\n        scheduleObj.setMissedFirePolicy(scheduleParam.getMissedFirePolicy());\n        scheduleObj.setTimezoneId(scheduleParam.getTimezoneId());\n        scheduleObj.setWarningType(warningType);\n        scheduleObj.setWarningGroupId(warningGroupId);\n        scheduleObj.setFailureStrategy(failureStrategy);\n        scheduleObj.setCreateTime(now);\n        scheduleObj.setUpdateTime(now);\n        scheduleObj.setUserId(loginUser.getId());\n        scheduleObj.setUserName(loginUser.getUserName());\n        scheduleObj.setReleaseState(ReleaseState.OFFLINE);\n        scheduleObj.setWorkflowInstancePriority(workflowInstancePriority);\n        scheduleObj.setWorkerGroup(workerGroup);\n        scheduleObj.setEnvironmentCode(environmentCode);\n        scheduleDao.insert(scheduleObj);\n","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java#L152-L188","documentation":"REQUEST_PARAMS_NOT_VALID_ERROR with the parameter name 'crontab' is thrown by insertSchedule when CronUtils.isValidExpression() cannot parse the supplied cron expression. DolphinScheduler uses Quartz-compatible cron syntax (6-7 fields, seconds first) and validates it before scheduling. The message interpolates the offending crontab string as the parameter.","triggerScenarios":"POST /projects/{projectCode}/schedule with schedule JSON containing a malformed crontab, e.g. \"crontab\":\"0 0 * *\" (missing fields) or Unix-style \"0 0 * * *\" without a seconds field, or an invalid field value like \"0 0 32 * * ?\".","commonSituations":"Reusing Unix crontab expressions (5 fields) in DolphinScheduler (Quartz needs seconds field plus optional year); typos such as commas in the day-of-week field; forgetting the '?' in day-of-month/day-of-week; migrating schedules from other schedulers with different cron dialects.","solutions":["Rewrite the expression as a Quartz cron (format: seconds minutes hours dayOfMonth month dayOfWeek [year]), e.g. \"0 0 0 * * ? *\".","Use the schedule preview endpoint (POST /schedule/preview) or CronUtils to test the expression before saving.","Check field values are in range (seconds/minutes 0-59, hours 0-23, day-of-month 1-31) and that DAY fields use '?' where appropriate."],"exampleFix":"// before\n{\"crontab\":\"0 0 * * *\"}            // Unix 5-field cron\n// after\n{\"crontab\":\"0 0 0 * * ? *\"}         // Quartz daily at midnight","handlingStrategy":"validation","validationCode":"// CronUtils is internal; replicate a Quartz-style check before calling:\nif (!org.quartz.CronExpression.isValidExpression(param.getCrontab())) {\n    throw new IllegalArgumentException(\"crontab is not a valid Quartz expression: \" + param.getCrontab());\n}","typeGuard":null,"tryCatchPattern":"try { schedulerService.insertSchedule(...); } catch (ServiceException e) { if (e.getCode() == Status.REQUEST_PARAMS_NOT_VALID_ERROR) { /* log e.getMessage(); fix crontab */ } }","preventionTips":["Use Quartz 6-7 field cron syntax (seconds first), not 5-field Unix cron","Validate with the schedule preview endpoint before saving","Keep a library of tested cron expressions for common intervals"],"tags":["scheduler","cron","validation"],"backgroundTag":"invalid-regex-pattern","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"}