pulumi/pulumi · error

the history command does not accept versions

Error message

the history command does not accept versions

What it means

`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.

Source

Thrown at pkg/cmd/esc/cli/env_schedule_history.go:59

		Args: cobra.ExactArgs(2),
		RunE: func(cmd *cobra.Command, args []string) error {
			ctx := cmd.Context()

			format, err := parseOutputFormat(output)
			if err != nil {
				return err
			}

			if err := env.esc.getCachedClient(ctx); err != nil {
				return err
			}

			ref, args, err := env.getExistingEnvRef(ctx, args)
			if err != nil {
				return err
			}
			if ref.version != "" {
				return errors.New("the history command does not accept versions")
			}
			if count < 0 {
				return errors.New("--count must be non-negative")
			}

			scheduleID := args[0]
			if scheduleID == "" {
				return errors.New("schedule ID cannot be empty")
			}

			resp, err := env.esc.client.ListEnvironmentScheduleHistory(ctx, ref.orgName, ref.projectName, ref.envName, scheduleID) //nolint:lll
			if err != nil {
				return err
			}

			if count > 0 && resp != nil && len(resp.ScheduleHistoryEvents) > count {
				resp.ScheduleHistoryEvents = resp.ScheduleHistoryEvents[:count]
			}

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Remove the `@version` suffix from the environment reference
  2. Run against the current environment name, then use `esc env history` separately if historical environment revisions are needed

Example fix

// before
esc env schedule history org/proj/env@latest sched-123 --count 10
// after
esc env schedule history org/proj/env sched-123 --count 10
Defensive patterns

Strategy: validation

Validate before calling

case "$ENV_REF" in *@*) echo "history does not accept versions" >&2; exit 1;; esac

Type guard

func hasVersion(ref string) bool { return strings.Contains(ref, "@") }

Prevention

When it happens

Trigger: Running `esc env schedule history <org/proj/env@version> <scheduleID>` with a `@version` suffix.

Common situations: Pasting a versioned ref from history output or another versioned command; scripting that appends `@latest` by default.

Related errors


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/97fcff60c141a2af. Report an issue: GitHub.