{"record":{"id":"726e67769f69dd76","repo":"pulumi/pulumi","slug":"once-must-be-an-iso-8601-rfc-3339-timestamp","errorCode":null,"errorMessage":"--once must be an ISO 8601 / RFC 3339 timestamp: %w","messagePattern":"--once must be an ISO 8601 / RFC 3339 timestamp: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/esc/cli/env_schedule_edit.go","lineNumber":75,"sourceCode":"\t\t\t\treturn errors.New(\"the edit command does not accept versions\")\n\t\t\t}\n\n\t\t\tscheduleID := args[0]\n\t\t\tif scheduleID == \"\" {\n\t\t\t\treturn errors.New(\"schedule ID cannot be empty\")\n\t\t\t}\n\n\t\t\tswitch {\n\t\t\tcase cron == \"\" && once == \"\":\n\t\t\t\treturn errors.New(\"exactly one of --cron or --once must be set\")\n\t\t\tcase cron != \"\" && once != \"\":\n\t\t\t\treturn errors.New(\"only one of --cron or --once may be set\")\n\t\t\t}\n\n\t\t\tif once != \"\" {\n\t\t\t\tt, err := time.Parse(time.RFC3339, once)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"--once must be an ISO 8601 / RFC 3339 timestamp: %w\", err)\n\t\t\t\t}\n\t\t\t\tif !t.After(time.Now()) {\n\t\t\t\t\treturn errors.New(\"--once must be a timestamp in the future\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treq := client.UpdateEnvironmentScheduleRequest{\n\t\t\t\tScheduleCron: cron,\n\t\t\t\tScheduleOnce: once,\n\t\t\t}\n\n\t\t\ts, err := env.esc.client.UpdateEnvironmentSchedule(ctx, ref.orgName, ref.projectName, ref.envName, scheduleID, req)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfmt.Fprintf(env.esc.stdout, \"Updated schedule %s for %s/%s/%s\\n\",\n\t\t\t\ts.ID, ref.orgName, ref.projectName, ref.envName)","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/esc/cli/env_schedule_edit.go#L57-L93","documentation":"When --once is supplied, its value must parse as an ISO 8601 / RFC 3339 timestamp. If time.Parse(time.RFC3339, once) fails, the command returns this wrapped error indicating the format is invalid.","triggerScenarios":"Passing --once values like `2026-09-01 09:00:00` (space instead of T), a date without time/zone (`2026-09-01`), or locale-formatted timestamps.","commonSituations":"Hand-writing timestamps without the required `T` separator or timezone offset; shell date output not matching RFC 3339.","solutions":["Use full RFC 3339 format: `--once 2026-09-01T09:00:00Z` (or with explicit offset like +02:00)","Generate the timestamp with a tool that emits RFC 3339, e.g. `date -u -d '+1 day' +%Y-%m-%dT%H:%M:%SZ`"],"exampleFix":"// before\nesc env schedule edit org/proj/env sched-123 --once \"2026-09-01 09:00:00\"\n// after\nesc env schedule edit org/proj/env sched-123 --once \"2026-09-01T09:00:00Z\"","handlingStrategy":"validation","validationCode":"date -u -d \"$ONCE\" +%Y-%m-%dT%H:%M:%SZ >/dev/null 2>&1 || { echo \"ONCE must be RFC 3339\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always generate timestamps with +%Y-%m-%dT%H:%M:%SZ","Use T separator and Z/offset timezone","Test format with `date` before passing to CLI"],"tags":["cli","esc","timestamp","validation"],"backgroundTag":"invalid-timestamp-format","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}