pulumi/pulumi · error

--all and --count are mutually exclusive

Error message

--all and --count are mutually exclusive

What it means

`--all` (paginate through every referrer) and `--count` (cap the number of results) are mutually exclusive paging modes in `esc env referrer list`. Supplying both is rejected, since `--all` is only honored when `count` is at its zero default.

Source

Thrown at pkg/cmd/esc/cli/env_referrer_list.go:68

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

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

			ref, _, err := env.getExistingEnvRef(ctx, args)
			if err != nil {
				return err
			}
			if ref.version != "" {
				return errors.New("the list command does not accept versions")
			}
			if all && count != 0 {
				return errors.New("--all and --count are mutually exclusive")
			}
			if count < 0 || count > 500 {
				return errors.New("--count must be in the range [1, 500]")
			}

			merged := &client.ListEnvironmentReferrersResponse{
				Referrers: map[string][]client.EnvironmentReferrer{},
			}
			remaining := count
			continuationToken := ""
			for {
				opts := client.ListEnvironmentReferrersOptions{
					ContinuationToken: continuationToken,
				}
				if remaining > 0 {
					opts.Count = &remaining
				}
				if allRevisions {

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Remove `--count` when using `--all`
  2. Remove `--all` when a specific `--count` is desired
  3. In wrapper scripts, make the flags conditional so only one paging mode is passed

Example fix

// before
pulumi esc env referrer list my-org/my-project/my-env --all --count 100
// after
pulumi esc env referrer list my-org/my-project/my-env --all
Defensive patterns

Strategy: validation

Validate before calling

if [ -n "$ALL" ] && [ -n "$COUNT" ]; then echo "--all and --count are exclusive"; exit 2; fi

Prevention

When it happens

Trigger: Running `pulumi esc env referrer list <env> --all --count 100`, or passing `--count` together with `--all` in a script/alias.

Common situations: Combining default-configured flags in a wrapper script where `--count` is always injected; misunderstanding that `--all` overrides `--count`.

Related errors


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