Pulumi "no stack named ... found" in CI
Pulumi looked for the named stack in the current backend and organization and did not find it. The login is valid; the stack simply is not where the CLI is looking.
What this error means
A pulumi stack select <name> or pulumi up --stack <name> step fails with "error: no stack named 'X' found". Other stacks may select fine.
pulumi
error: no stack named 'dev' foundCommon causes
Wrong backend or organization
The stack exists under a different Pulumi Cloud organization or a different self-managed backend than the one CI logged into.
The stack was never created in this backend
CI expects a stack that only exists locally on a developer machine or was never initialized in the shared backend.
How to fix it
Select with the fully qualified name or create it
- List stacks to see what the backend actually has.
- Use the org-qualified name, or create the stack if it is genuinely new.
- Re-run the command.
Terminal
pulumi stack ls
pulumi stack select myorg/myproject/dev --createPoint at the correct backend
Log in to the backend that holds the stack, or set PULUMI_BACKEND_URL to it before selecting.
.github/workflows/ci.yml
env:
PULUMI_BACKEND_URL: s3://my-pulumi-stateHow to prevent it
- Reference stacks by their org-qualified name in CI.
- Ensure shared stacks are created in the shared backend, not just locally.
- Pin the backend so every job looks in the same place.
Related guides
Pulumi "could not create stack: stack already exists" in CIFix Pulumi "error: could not create stack: stack already exists" in CI - a job ran `pulumi stack init` for a…
Pulumi "getting stack: ... not logged in" in CIFix Pulumi "error: getting stack: ... not logged in" in CI - a Pulumi command ran before any login, so there…
Pulumi "resource ... does not exist" drift in CIFix Pulumi "error: resource ... does not exist" in CI - a resource recorded in state was deleted outside Pulu…