pulumi/pulumi · error

getting stack schedule: %w

Error message

getting stack schedule: %w

What it means

The `pulumi stack schedule get` command fetches a single schedule via the cloud backend's GetStackSchedule API. Any failure from that API call (network problem, auth failure, schedule not found, permissions) is wrapped as "getting stack schedule". The command could not retrieve the schedule definition to render it.

Source

Thrown at pkg/cmd/pulumi/stack/stack_schedule_get.go:101

) (stackScheduleGetClient, client.StackIdentifier, error) {
	return RequireCloudStack(ctx, cmdutil.Diag(), pkgWorkspace.Instance, cmdBackend.DefaultLoginManager, stackFlag)
}

func runStackScheduleGet(
	ctx context.Context,
	w io.Writer,
	factory stackScheduleGetClientFactory,
	stackFlag, scheduleID string,
	render scheduleGetRenderFunc,
) error {
	c, stackID, err := factory(ctx, stackFlag)
	if err != nil {
		return err
	}

	schedule, err := c.GetStackSchedule(ctx, stackID, scheduleID)
	if err != nil {
		return fmt.Errorf("getting stack schedule: %w", err)
	}

	return render(w, schedule)
}

type scheduleGetRenderFunc func(w io.Writer, schedule apitype.ScheduledAction) error

func renderScheduleGetJSON(w io.Writer, schedule apitype.ScheduledAction) error {
	enc := json.NewEncoder(w)
	enc.SetEscapeHTML(false)
	enc.SetIndent("", "  ")
	return enc.Encode(summarizeSchedule(schedule))
}

func renderScheduleGetText(w io.Writer, s apitype.ScheduledAction) error {
	sum := summarizeSchedule(s)
	line := func(label, value string) {
		fmt.Fprintf(w, "%-10s %s\n", label+":", value)

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Verify the schedule ID is correct and belongs to the selected stack: `pulumi stack schedule list`.
  2. Confirm you are logged in and to the right backend/org: `pulumi whoami`, `pulumi login`.
  3. Retry if the failure was transient (network/service outage).
  4. Check the underlying wrapped error message for the root cause (404 vs 401 vs 5xx).

Example fix

// before
pulumi stack schedule get 123e4567-...   // getting stack schedule: not found
// after
pulumi stack schedule list               # confirm the real ID
pulumi stack schedule get <correct-id>
Defensive patterns

Strategy: try-catch

Try / catch

out, err := run("pulumi", "stack", "schedule", "get", id)
if err != nil {
    if strings.Contains(out+err.Error(), "not found") {
        // verify ID against `pulumi stack schedule list`
    }
    return fmt.Errorf("schedule get failed: %w", err)
}

Prevention

When it happens

Trigger: Running `pulumi stack schedule get <schedule-id>` when the schedule ID does not exist, the cloud API returns an error, the user lacks access to the stack, or there is a network/auth failure against the Pulumi Cloud service.

Common situations: Copy-pasted schedule ID with a typo or from a different stack/org; expired or missing login (`pulumi login`); backend outage; schedule deleted by someone else.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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