Debug a Pulumi update or preview that failed: read the failure Pulumi already recorded, find what caused it, and fix it. Load this skill when the user asks to debug, diagnose, or fix a failed update or preview, or points at a failing `pulumi up` or `pulumi preview`. Don't load it for authoring new infrastructure, migrations, or provider upgrades; those have their own skills.
Capabilities
Read what failed
A failed update and a failed preview both record engine events
Find the first real error
One failure produces several messages, and most of them are…
Find the cause and where the fix belongs
An operation can fail with errors from more than one resource, so work…
Fix the cause
If the evidence does not settle the cause, say what you know, what you…
Getting started
Full instructionsInstall the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.
Instructions: SKILL.mdv1.2.0
Debug a failed Pulumi operation
A Pulumi operation has failed. Find what caused it and fix it. The user usually
points you at it, so start by working out which operation to debug, and confirm it
with the user before doing anything else. Pulumi recorded the error when the
operation failed, so once you know which operation it is you can read the error from
that record without running anything again.
The commands below reach Pulumi Cloud with pulumi api, a subcommand of the Pulumi
CLI that you run in your shell. Each one targets a stack by the explicit
{orgName}/{projectName}/{stackName} path you pass it, so you do not need that
stack selected locally to read its record. Selecting the stack matters later, when
you go to apply a fix.
Start from the operation the user gave you
The user usually supplies the operation as a set of fields: the org, project, stack,
and update version (or preview id), most often stated in prose, for example "debug
update 161 of vvm-dev". You need these to address the API: {orgName},
{projectName}, {stackName}, and the version or preview id.
Fill any missing field from context. Take the org, project, or stack from the
currently selected stack (pulumi stack --show-name, pulumi stack ls) or
Pulumi.yaml. A missing version means the most recent update on that stack.
Briefly confirm which operation you landed on, its version or preview id and the
stack, before reading further. Keep it lightweight; they already told you.
Read what failed
A failed update and a failed preview both record engine events. The error is in the
diagnostic events, and a policy violation is in the policy events. Using the fields
you settled on above, fetch the events and pull both kinds out.
For a failed update, use the update path with the version number:
pulumi api /api/stacks/{orgName}/{projectName}/{stackName}/update/<version>/events \
| jq -r '.events[]
| if .diagnosticEvent then "[\(.diagnosticEvent.severity)] \(.diagnosticEvent.message)"
elif .policyEvent then "[policy \(.policyEvent.enforcementLevel)] \(.policyEvent.policyPackName)/\(.policyEvent.policyName): \(.policyEvent.message)"
else empty end' \
| sed 's/<{%reset%}>//g'
For a failed preview, use the preview path with the preview id and the same jq
filter:
pulumi api /api/stacks/{orgName}/{projectName}/{stackName}/preview/<preview-id>/events \
| jq -r '<same filter as above>' | sed 's/<{%reset%}>//g'
Read every message, not only the ones tagged severity == "error". A provider
error carries that error tag, but a program error, which is the common case when
a preview fails, arrives as a stderr diagnostic tagged info#err. A policy
violation with enforcement level mandatory fails the operation by itself, often
with no other error. The trailing sed strips terminal color codes that Pulumi
embeds in the text, which otherwise show up as <{%reset%}>.
Also read how the operation was run. The update record has an environment map
(pulumi api /api/stacks/{orgName}/{projectName}/{stackName}/updates/<version>).
A pulumi.flag.target key means the run used --target, and git.head and
git.dirty tell you which commit it ran.
Find the first real error
One failure produces several messages, and most of them are consequences. Before
you trace anything, find the first error that names a resource, a function call, or
a line of the program. Treat these as symptoms of an earlier error, never as the
cause:
Resource monitor has terminated, shutting down,grpc: the client connection is closing,Channel has been shut down, Python_InactiveRpcErrortracebacks, and
.NETGrpc.Core.RpcExceptiontraces. The engine stopped because something else
failed first.- A Python traceback that ends in
KeyboardInterrupt, orcontext canceled. The
run was stopped by a person, a CI timeout, or a cancel. Look for an earlier error. expected resource operations for <urn> but none were seenwhen another error is
present. An update plan was cut short by that error.- Node.js lines about promises that were still waiting (
PULUMI_DEBUG_PROMISE_LEAKS),
deprecation and experimental warnings, and credential-source warnings. update failedandpreview failedon their own lines.
If no error remains after you set these aside, the record is too thin. For a run in
CI, the update record's environment map often has ci.build.url; read that log.
For a local run, run the same pulumi preview again with --debug and read its
output. Tell the user what you found and where.
An error from a function call (invocation of aws:route53/getZone:getZone returned an error, invoke of ... failed) has no URN. Trace it to the call in the program
and to the inputs passed to that call. Check that the call ran against the account,
subscription, or project the stack is meant to use.
Find the cause and where the fix belongs
An operation can fail with errors from more than one resource, so work through each
real error. Trace it back to the resource that raised it (its URN and type), to where
that resource is declared in the program, and to the inputs that feed it.
Before you edit code, compare this run with the last successful operation of the
same kind on the stack. If the commit is the same and the stack config is the same,
the code is very likely not the problem, and the fix is in the command, the config,
the workspace, the state, or the environment.
The error text tells you what kind of problem it is, and that points to where the
fix belongs. A Pulumi fix lands in one of six places. Name the right one before you
change anything; most wasted fixes edit code that was never the problem.
Search references/common-failures.md for a
distinctive phrase from the first real error, for example
grep -n -i 'not specified in --target' references/common-failures.md, and read
the matching entry. Its contents list names every entry. If nothing matches, use
the six places below.
- The program. The code is wrong: a bad reference, a wrong type, an input the
provider rejected, or a value used before it had resolved. Fix it by editing the
code. One exception: when the program throws on purpose, because a guard checks
the branch, account, region, an environment variable, or the state of something
in the cloud, the guard is working. Satisfy the precondition, or tell the user what
the guard asks for when only they can do it; never delete the check. - The command. The code is correct, but the way it was run is wrong: a
--targetURN that does not match, a resource left out of a--targetlist, or
a targeted run after a provider change. Fix the command, not the code. - The stack config and other stacks. A required config key is not set for this
stack, or aStackReferencereads an output that the other stack does not export.
Set the key for this stack, or check what the other stack exports and in which
code. - The workspace. Dependencies are not installed, a local package is not built,
a build step that makes a file the program reads did not run, or the language
toolchain is missing or the wrong version. Runpulumi install, build the package
or the file, or install the toolchain. - The state. The code is correct, but the stored state and the real cloud
resources disagree. Reconcile drift withpulumi refresh, and bring a resource
that already exists outside the state under management withpulumi import
rather than recreating it. Note that an operation which failed partway through
applying may have already changed some resources, so check the current state
before you decide. - The environment. The problem is outside Pulumi: credentials, permissions,
OIDC, a wrong cloud account, the key that encrypts the stack's secrets, or a quota.
Fix the identity, the ESC environment, or the capacity. Change resource code only
when the account cannot offer the value the program asks for, such as a machine
size that is not available in the region.
When a resource failed to become ready and the message holds no rejection from the
API, read the error in the system the resource deployed to; see "Resources that do
not become ready" in the reference. If reaching it needs access you don't have (a
token, a run, a not-found), stop and tell the user what you're blocked on and the one
thing you need from them.
Fix the cause
If the evidence does not settle the cause, say what you know, what you do not, and
the one check that would settle it. Do not act on a guess.
Make the smallest change that addresses the root cause. How you confirm the fix,
and how you deliver it, whether as a local edit or as a pull request, follow your
mode's workflow, not this skill.
Ask the user before an action that deletes or replaces a resource, deploys another
stack, deploys to production, or changes permissions. Never remove protect, delete
a resource from state, raise a timeout, or turn off a security control as the fix
unless you have found why that is correct and the user agrees. These changes make
the error go away without fixing its cause, and some of them destroy data.
If the user didn't say which operation
When the user gives you nothing to go on, debug their most recent operation on the
stack. The update list does not record who ran each update, so find it through the
API:
- Run
pulumi whoamito get the current user's login. - Read the latest update and who requested it with
pulumi api /api/stacks/{orgName}/{projectName}/{stackName}/updates/latest, and
compare itsrequestedBy.githubLoginto the login from step 1. - If they match, that update is the one to debug. If they do not, walk back one
version at a time with
pulumi api /api/stacks/{orgName}/{projectName}/{stackName}/updates/<n>until
requestedBy.githubLoginmatches the user.
Tell the user which operation you landed on, its version, kind, and result, and
confirm it is the one they mean before going further.
Explore more skills
Browse all- Pulumi EscGuidance for working with Pulumi ESC (Environments, Secrets, and Configuration). Use when users ask about managing…
- Pulumi ComponentGuide for authoring Pulumi ComponentResource classes. Use when creating reusable infrastructure components, designing…
- Pulumi Automation APILoad this skill when a user asks how to run Pulumi programmatically, embed Pulumi in an application, orchestrate…
- Pulumi Neo HandoffHand off the current thread to a new Pulumi Neo task as a one-way transfer. Use when the user explicitly asks to hand…
- Pulumi OverviewUse this skill for any task that creates, modifies, inspects, or destroys cloud infrastructure or SaaS configuration,…
- Pulumi Context APIQuery the Pulumi Context API, a graph query interface over an organization's infrastructure in Pulumi Cloud. Use when a…
Security
Reviews (0)
More from Pulumi
View source →Frequently asked questions about pulumi-debug-failed-operation
What does the pulumi-debug-failed-operation skill do?
Debug a Pulumi update or preview that failed: read the failure Pulumi already recorded, find what caused it, and fix it. Load this skill when the user asks to debug, diagnose, or fix a failed update or preview, or points at a failing `pulumi up` or `pulumi preview`. Don't load it for authoring new infrastructure, migrations, or provider upgrades; those have their own skills. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the pulumi-debug-failed-operation skill?
Run `npx @skills-hub-ai/cli install pulumi-debug-failed-operation` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/pulumi-debug-failed-operation/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does pulumi-debug-failed-operation work with?
pulumi-debug-failed-operation runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the pulumi-debug-failed-operation skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use pulumi-debug-failed-operation after installing it?
In Claude Code, type `/pulumi-debug-failed-operation` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the pulumi-debug-failed-operation skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.
Badge for your README
Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.
[](https://skills-hub.ai/skills/pulumi-debug-failed-operation)<a href="https://skills-hub.ai/skills/pulumi-debug-failed-operation"><img src="https://skills-hub.ai/api/badges/skill/pulumi-debug-failed-operation" alt="Install on Skills Hub"></a>More options in the badge docs.