pulumi/pulumi · error
no snapshot found
Error message
no snapshot found
What it means
listResources' snapshot loader returns this when the current stack's Snapshot() yields nil — i.e. the backend reports no snapshot at all for the stack. State commands have nothing to enumerate or search, so they abort with 'no snapshot found'.
Source
Thrown at pkg/cmd/pulumi/state/io.go:344
s, err := cmdStack.RequireStack(
ctx,
sink,
ws,
lm,
stackName,
cmdStack.LoadOnly,
opts,
"",
)
if err != nil {
return "", err
}
*snap, err = s.Snapshot(ctx, secrets.DefaultProvider)
if err != nil {
return "", err
}
if *snap == nil {
return "", errors.New("no snapshot found")
}
}
urnList := make([]string, len((*snap).Resources))
for i, r := range (*snap).Resources {
urnList[i] = string(r.URN)
}
var urn string
err := survey.AskOne(&survey.Select{
Message: prompt,
Options: urnList,
}, &urn, survey.WithValidator(survey.Required), ui.SurveyIcons(cmdutil.GetGlobalColorization()))
if err != nil {
return "", err
}
result := resource.URN(urn)
contract.Assertf(result.IsValid(),
"Because we chose from an existing URN, it must be valid")
return result, nilView on GitHub (pinned to 793f7b2e16)
Solutions
- Confirm the stack has resources: run `pulumi stack` or `pulumi stack export` first
- Deploy once (`pulumi up`) so a snapshot exists before state operations
- Check you selected the intended stack (`pulumi stack ls`, `pulumi stack select`)
- Restore the checkpoint from backend backups if the stack should have state
Defensive patterns
Strategy: validation
Validate before calling
// ensure the stack has a snapshot before state operations
if strings.TrimSpace(stackExport()) == "" || len(stackResources()) == 0 {
return errors.New("stack has no state; run `pulumi up` first")
} Prevention
- Never run state commands on a freshly stack init'ed stack before the first up
- Confirm target stack with `pulumi stack` before operations
- Keep backend checkpoints backed up in case storage is lost
When it happens
Trigger: Running `pulumi state` commands against a stack that has never been deployed (empty state), or a backend whose checkpoint for the stack is missing/blank.
Common situations: Selecting a freshly created but never-updated stack (`pulumi stack init` then `pulumi state delete ...`); pointing at the wrong project/stack; backend storage corruption losing the checkpoint.
Related errors
- stack has no snapshot yet; cannot resolve --provider %s
- getting snapshot: %w
- load stack snapshot: %w
- %s: snapshot integrity failure; it was already written, but
- snapshot integrity failure; refusing to use it: %w
AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31).
Data as JSON: /api/errors/bf7caccd7ebe8599.
Report an issue: GitHub.