{"record":{"id":"19f43ecd44aece9e","repo":"argoproj/argo-workflows","slug":"cron-schedules-must-consist-of-5-values-only-19f43e","errorCode":null,"errorMessage":"cron schedules must consist of 5 values only","messagePattern":"cron schedules must consist of 5 values only","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"ui/src/cron-workflows/schedule-validator.tsx","lineNumber":9,"sourceCode":"import x from 'cronstrue';\nimport * as React from 'react';\n\nimport {SuccessIcon, WarningIcon} from '../shared/components/fa-icons';\n\nexport function ScheduleValidator({schedule}: {schedule: string}) {\n    try {\n        if (schedule.split(' ').length >= 6) {\n            throw new Error('cron schedules must consist of 5 values only');\n        }\n        return (\n            <span>\n                <SuccessIcon /> {x.toString(schedule)}\n            </span>\n        );\n    } catch (e) {\n        return (\n            <span>\n                <WarningIcon /> Schedule maybe invalid: {e.toString()}\n            </span>\n        );\n    }\n}\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/ui/src/cron-workflows/schedule-validator.tsx#L1-L24","documentation":"ScheduleValidator checks user-entered cron schedules and throws the same error as PrettySchedule when the input has 6 or more space-separated values. The component only validates 5-field crons and shows a success icon via cronstrue otherwise; 6+ fields are rejected up front.","triggerScenarios":"Typing a schedule in the cron-workflow form with 6+ fields, e.g. Quartz '0 30 9 * * ?' or '30 9 * * * 2026'.","commonSituations":"Copying Quartz/6-field crons from Java schedulers or crontab variants that include seconds or year fields; pasting with trailing whitespace.","solutions":["Enter a standard 5-field cron expression (minute hour day-of-month month day-of-week).","Remove the seconds/year fields from a Quartz expression.","Catch the error in the validator and show a helpful message telling the user only 5-field crons are supported."],"exampleFix":"// before\nschedule: '0 30 9 * * ?'\n// after\nschedule: '30 9 * * *'","handlingStrategy":"validation","validationCode":"const isValidCron = (s: string) => s.trim().split(/\\s+/).length === 5;\nif (!isValidCron(schedule)) showWarning('Use a 5-field cron expression');","typeGuard":"const isFiveFieldCron = (s: string): boolean =>\n  s.trim().split(/\\s+/).length === 5;","tryCatchPattern":"try {\n  <ScheduleValidator schedule={schedule} />\n} catch {\n  <WarningIcon /> Only 5-field cron expressions are supported;\n}","preventionTips":["Validate schedules on input in the cron-workflow form.","Strip seconds/year fields when importing Quartz crons.","Show inline validation before submission."],"tags":["ui","cron","form-validation"],"backgroundTag":"invalid-cron-expression","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}