{"record":{"id":"97fcff60c141a2af","repo":"pulumi/pulumi","slug":"the-history-command-does-not-accept-versions","errorCode":null,"errorMessage":"the history command does not accept versions","messagePattern":"the history command does not accept versions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/esc/cli/env_schedule_history.go","lineNumber":59,"sourceCode":"\t\tArgs: cobra.ExactArgs(2),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tctx := cmd.Context()\n\n\t\t\tformat, err := parseOutputFormat(output)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := env.esc.getCachedClient(ctx); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tref, args, err := env.getExistingEnvRef(ctx, args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif ref.version != \"\" {\n\t\t\t\treturn errors.New(\"the history command does not accept versions\")\n\t\t\t}\n\t\t\tif count < 0 {\n\t\t\t\treturn errors.New(\"--count must be non-negative\")\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\tresp, err := env.esc.client.ListEnvironmentScheduleHistory(ctx, ref.orgName, ref.projectName, ref.envName, scheduleID) //nolint:lll\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif count > 0 && resp != nil && len(resp.ScheduleHistoryEvents) > count {\n\t\t\t\tresp.ScheduleHistoryEvents = resp.ScheduleHistoryEvents[:count]\n\t\t\t}","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/esc/cli/env_schedule_history.go#L41-L77","documentation":"`esc env schedule history` inspects schedule runs on the live environment, so versioned environment references are rejected. If the parsed ref carries a version, the command fails immediately with this message.","triggerScenarios":"Running `esc env schedule history <org/proj/env@version> <scheduleID>` with a `@version` suffix.","commonSituations":"Pasting a versioned ref from history output or another versioned command; scripting that appends `@latest` by default.","solutions":["Remove the `@version` suffix from the environment reference","Run against the current environment name, then use `esc env history` separately if historical environment revisions are needed"],"exampleFix":"// before\nesc env schedule history org/proj/env@latest sched-123 --count 10\n// after\nesc env schedule history org/proj/env sched-123 --count 10","handlingStrategy":"validation","validationCode":"case \"$ENV_REF\" in *@*) echo \"history does not accept versions\" >&2; exit 1;; esac","typeGuard":"func hasVersion(ref string) bool { return strings.Contains(ref, \"@\") }","tryCatchPattern":null,"preventionTips":["Use plain env names for schedule history","Keep version refs out of schedule subcommands"],"tags":["cli","esc","versioning"],"backgroundTag":"versioned-ref-not-supported","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}