{"record":{"id":"d0e1c878272e6fc2","repo":"pulumi/pulumi","slug":"once-w-d0e1c8","errorCode":null,"errorMessage":"--once %w","messagePattern":"--once %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/stack/stack_schedule_new.go","lineNumber":259,"sourceCode":"\treturn RequireCloudStack(ctx, cmdutil.Diag(), pkgWorkspace.Instance, cmdBackend.DefaultLoginManager, stackFlag)\n}\n\nfunc runStackScheduleNew(\n\tctx context.Context,\n\tw io.Writer,\n\tfactory stackScheduleNewClientFactory,\n\targs stackScheduleNewArgs,\n\trender scheduleGetRenderFunc,\n) error {\n\tkind := strings.ToLower(strings.TrimSpace(args.kind))\n\tif err := validateScheduleNewArgs(kind, args); err != nil {\n\t\treturn err\n\t}\n\n\tif args.once != \"\" {\n\t\tnormalized, err := parseScheduleTimestamp(args.once)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"--once %w\", err)\n\t\t}\n\t\targs.once = normalized\n\t}\n\n\tc, stackID, err := factory(ctx, args.stack)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar schedule apitype.ScheduledAction\n\tswitch kind {\n\tcase scheduleKindRaw:\n\t\top, opErr := parseScheduleOperation(args.operation)\n\t\tif opErr != nil {\n\t\t\treturn opErr\n\t\t}\n\t\tschedule, err = c.CreateStackSchedule(ctx, stackID, apitype.CreateScheduledDeploymentRequest{\n\t\t\tScheduleCron: args.cron,","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/stack/stack_schedule_new.go#L241-L277","documentation":"The --once flag of `pulumi stack schedule new` accepts a timestamp for a one-off schedule. Before use it is normalized by parseScheduleTimestamp; if the value cannot be parsed as a valid timestamp, the error is wrapped as \"--once <reason>\". It is a flag-value validation error raised before creating the schedule.","triggerScenarios":"Running `pulumi stack schedule new ... --once <value>` where <value> is not a parseable/normalizable timestamp — wrong format, ambiguous date, or non-ISO layout.","commonSituations":"Passing human dates like \"tomorrow 5pm\" or \"08/30/2026\" in an unexpected layout; missing timezone producing an invalid value; shell quoting stripping parts of the timestamp.","solutions":["Pass an RFC3339/ISO-8601 timestamp, e.g. --once \"2026-08-31T02:00:00Z\".","Quote the timestamp so the shell doesn't split it.","Check the inner wrapped message after \"--once\" for the exact parse failure.","Use --cron instead if a repeating schedule was intended."],"exampleFix":"// before\npulumi stack schedule new --kind raw --name once --operation update --once \"tomorrow at 2am\" --yes\n// after\npulumi stack schedule new --kind raw --name once --operation update --once \"2026-08-31T02:00:00Z\" --yes","handlingStrategy":"validation","validationCode":"t, err := time.Parse(time.RFC3339, onceValue)\nif err != nil {\n    return fmt.Errorf(\"--once must be RFC3339, got %q\", onceValue)\n}\nif !t.After(time.Now()) {\n    return errors.New(\"--once must be in the future\")\n}","typeGuard":null,"tryCatchPattern":"if err := pulumiScheduleNew(onceArg); err != nil {\n    if strings.HasPrefix(err.Error(), \"--once\") {\n        return fmt.Errorf(\"bad --once timestamp: %w\", err)\n    }\n    return err\n}","preventionTips":["Always quote the timestamp in shell commands.","Generate timestamps with `date -u +%Y-%m-%dT%H:%M:%SZ`.","Validate RFC3339 format in wrapper scripts before invoking the CLI."],"tags":["cli","validation","timestamps","schedules"],"backgroundTag":"invalid-timestamp-format","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}