argoproj/argo-workflows · error
scheduled-time contains invalid time.RFC3339 format. (e.g.:
Error message
scheduled-time contains invalid time.RFC3339 format. (e.g.: `2006-01-02T15:04:05-07:00`)
What it means
`argo submit --from ... --scheduled-time` expects an RFC3339 timestamp (time.RFC3339 layout, e.g. 2006-01-02T15:04:05-07:00) which is validated with time.Parse; on failure the command returns this fixed-message error. The value is later attached as the cronworkflow scheduled-time annotation.
Source
Thrown at cmd/argo/commands/submit.go:194
}
func submitWorkflowFromResource(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, resourceIdentifier string, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {
parts := strings.SplitN(resourceIdentifier, "/", 2)
if len(parts) != 2 {
return fmt.Errorf("resource identifier '%s' is malformed. Should be `kind/name`, e.g. cronwf/hello-world-cwf", resourceIdentifier)
}
kind := parts[0]
name := parts[1]
tempwf := wfv1.Workflow{}
if err := validateOptions([]wfv1.Workflow{tempwf}, submitOpts, cliOpts); err != nil {
return err
}
if cliOpts.ScheduledTime != "" {
_, err := time.Parse(time.RFC3339, cliOpts.ScheduledTime)
if err != nil {
return fmt.Errorf("scheduled-time contains invalid time.RFC3339 format. (e.g.: `2006-01-02T15:04:05-07:00`)")
}
submitOpts.Annotations = fmt.Sprintf("%s=%s", wfcommon.AnnotationKeyCronWfScheduledTime, cliOpts.ScheduledTime)
}
created, err := serviceClient.SubmitWorkflow(ctx, &workflowpkg.WorkflowSubmitRequest{
Namespace: namespace,
ResourceKind: kind,
ResourceName: name,
SubmitOptions: submitOpts,
})
if err != nil {
return fmt.Errorf("failed to submit workflow: %w", err)
}
if err = printWorkflow(created, common.GetFlags{Output: cliOpts.Output}); err != nil {
return err
}
View on GitHub (pinned to 35bff19146)
Solutions
- Provide a valid RFC3339 string, e.g. --scheduled-time '2026-09-03T10:00:00Z' or '2026-09-03T10:00:00+02:00'.
- Replace the space between date and time with 'T'.
- Generate the value with `date -u +%Y-%m-%dT%H:%M:%SZ` to guarantee the format.
Example fix
// before argo submit --from cronwf/hello-world-cwf --scheduled-time '2026-09-03 10:00:00' // after argo submit --from cronwf/hello-world-cwf --scheduled-time '2026-09-03T10:00:00Z'
Defensive patterns
Strategy: validation
Validate before calling
t := "2026-09-03T10:00:00Z"
if _, err := time.Parse(time.RFC3339, t); err != nil {
return fmt.Errorf("--scheduled-time must be RFC3339: %w", err)
} Type guard
func isRFC3339(s string) bool { _, err := time.Parse(time.RFC3339, s); return err == nil } Try / catch
err := cmd.Run()
if err != nil && strings.Contains(err.Error(), "scheduled-time contains invalid") {
log.Fatal("use RFC3339, e.g. 2026-09-03T10:00:00Z")
} Prevention
- Generate timestamps with date -u +%Y-%m-%dT%H:%M:%SZ.
- Always include a timezone ('Z' or ±hh:mm).
- Use 'T' between date and time, not a space.
When it happens
Trigger: Running `argo submit --from cronwf/x --scheduled-time '2026-09-03 10:00:00'` — space instead of 'T', missing timezone offset, or any string time.Parse(time.RFC3339) rejects.
Common situations: Using human-friendly date formats (YYYY-MM-DD HH:MM:SS); omitting the timezone (RFC3339 requires either 'Z' or ±hh:mm offset); locale-formatted dates from scripts.
Related errors
- unable to parse node field selector '%s': %w
- unable to parse node field selector '%s': %w
- unable to parse node field selector '%s': %w
- unable to parse node field selector '%s': %w
- ${e.Usage()}
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/c31cc8e7bf834b65.
Report an issue: GitHub.