argoproj/argo-workflows · warning

cron schedules must consist of 5 values only

Error message

cron schedules must consist of 5 values only

What it means

PrettySchedule renders a human-friendly version of a cron schedule. It only supports standard 5-field cron expressions; if the schedule string has 6 or more space-separated values it deliberately throws so the user knows the schedule can't be pretty-printed (likely a seconds-field cron).

Source

Thrown at ui/src/cron-workflows/pretty-schedule.tsx:18

import x from 'cronstrue';
import * as React from 'react';

import {WarningIcon} from '../shared/components/fa-icons';

/*
    https://github.com/bradymholt/cRonstrue
    vs
    https://github.com/robfig/cron

    I think we must assume that these libraries (or any two libraries) will never be exactly the same and accept that
    sometime it'll not work as expected. Therefore, we must let the user know about this.
 */

export function PrettySchedule({schedule}: {schedule: string}) {
    try {
        if (schedule.split(' ').length >= 6) {
            throw new Error('cron schedules must consist of 5 values only');
        } else if (schedule.startsWith('@every')) {
            return null;
        }

        const pretty = x.toString(schedule);
        return <span title={pretty}>{pretty}</span>;
    } catch (e) {
        return (
            <span>
                <WarningIcon /> {e.toString()}
            </span>
        );
    }
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Use a standard 5-field cron expression in the CronWorkflow spec.
  2. Strip any seconds field before rendering: drop the leading token.
  3. Handle the thrown error in the component boundary and display the raw schedule instead.

Example fix

// before
schedule: '0 0 9 * * *' // 6 fields, throws
// after
schedule: '0 9 * * *' // 5 fields
Defensive patterns

Strategy: validation

Validate before calling

const fields = schedule.trim().split(/\s+/);
if (fields.length !== 5) {
  throw new Error(`expected 5-field cron, got ${fields.length}`);
}

Try / catch

try {
  return <PrettySchedule schedule={schedule} />;
} catch (e) {
  return <span title="unsupported format">{schedule}</span>;
}

Prevention

When it happens

Trigger: Rendering a CronWorkflow whose spec.schedule contains a 6+ field expression, e.g. '0 0 0 * * *' (seconds included) or a multi-word parser expression.

Common situations: Users pasting Quartz-style cron (with seconds) from other systems like Spring or Quartz Scheduler; extra accidental whitespace counting as extra fields.

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/a15fc1ba9bba8dbc. Report an issue: GitHub.