Skip to content
DevOps AI ToolKit
Newsletter
All guides
AI for Pulumi By James Joyner IV · · 8 min read

Pulumi Error: 'no stack named dev found' — Cause, Fix, and Troubleshooting Guide

Quick answer

Fix Pulumi 'no stack named dev found' by creating the stack with pulumi stack init or logging into the correct backend and organization.

  • #pulumi
  • #iac
  • #troubleshooting
  • #errors
Free toolkit

Fixing errors like this? Get 500 free DevOps AI prompts

500 copy-paste AI prompts for the stack you actually run — one PDF, free.

Overview

error: no stack named 'dev' found means you asked Pulumi to select or operate on a stack that does not exist in the backend and project you are currently logged into. Stacks are isolated instances of your program’s state; if dev was never created here — or lives in a different backend, organization, or project — Pulumi cannot find it.

Because stack names are resolved against the active backend and the current project (Pulumi.yaml), this error frequently shows up after switching backends, cloning a fresh repo, or running in CI where no stack has been initialized yet.

error: no stack named 'dev' found

Symptoms

  • pulumi stack select dev, pulumi up --stack dev, or pulumi stack rm dev fails with no stack named 'dev' found.
  • pulumi stack ls shows a different set of stacks (or none).
  • The stack exists in Pulumi Cloud but you are logged into a local backend (or vice versa).
  • A fresh clone or CI runner has no stacks yet.
  • The stack exists under a different organization or project name than the one you referenced.

Common Root Causes

1. The stack was never created in this backend

Stacks must be initialized. A repo checkout does not create stacks by itself.

pulumi stack ls

2. Logged into the wrong backend

Pulumi Cloud, --local, and object-storage backends each have their own set of stacks. Switching backends changes which stacks are visible.

pulumi login --local        # different stacks than app.pulumi.com

3. Wrong organization or fully-qualified name

On Pulumi Cloud, stacks are <org>/<project>/<stack>. Referring to dev while the stack lives under myorg/myproject/dev — or under a different org — fails to resolve.

4. Wrong project directory

Stack names are scoped to the project in the current Pulumi.yaml. Running from the wrong directory (or with a mismatched project name) hides the stack you expect.

5. Typo or case mismatch

Dev, develop, and dev are distinct. A small mismatch yields no stack named ... found.

How to Diagnose

List the stacks that actually exist for the current project and backend:

pulumi stack ls

List across all projects you have access to (Pulumi Cloud):

pulumi stack ls --all

Confirm which backend and identity you are using:

pulumi whoami --verbose

Check the project name Pulumi is resolving against:

cat Pulumi.yaml

Fixes

Create the stack if it does not exist: The direct fix when the stack is genuinely absent.

pulumi stack init dev

Select the correct existing stack: If pulumi stack ls shows the real name, select that.

pulumi stack ls
pulumi stack select dev

Use the fully-qualified name on Pulumi Cloud: Reference the org and project explicitly.

pulumi stack select myorg/myproject/dev
# or init it fully-qualified
pulumi stack init myorg/myproject/dev

Log into the backend that holds the stack: If the stack lives in Pulumi Cloud but you are on local (or vice versa), switch backends first.

pulumi login                 # Pulumi Cloud
# or
pulumi login s3://my-pulumi-state-bucket
pulumi stack ls

Run from the correct project directory: Ensure you are in the folder whose Pulumi.yaml matches the project the stack belongs to.

cd ~/projects/myproject
pulumi stack select dev

Initialize stacks in CI before use: Automation should create the stack if missing, then select it.

pulumi stack select dev || pulumi stack init dev

What to Watch Out For

  • Stack names are per-backend and per-project — the same name can exist in one place and not another.
  • On Pulumi Cloud, always be explicit about <org>/<project>/<stack> when scripting to avoid ambiguity.
  • pulumi stack init creates a new empty stack; do not run it expecting to attach to existing state.
  • Switching backends with pulumi login silently changes which stacks pulumi stack ls returns.
  • A mismatched project name in Pulumi.yaml (e.g. after a rename) makes existing stacks appear missing.
  • Use pulumi stack select <name> || pulumi stack init <name> in pipelines so first runs do not fail.
Free download · 368-page PDF

Get 500 Battle-Tested DevOps AI Prompts — Free

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.