pulumi-debug-failed-operation
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 i
- 0
- Installs
- —
- Rating
- —
- Success rate
- 3
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 3e984ae6df44e1b7… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
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, and the error is in the diagnostic messages inside those events. Using the fields you settled on above, fetch the events and pull the messages 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[].diagnosticEvent | select(. != null) | "[\(.severity)] \(.message)"' \
| sed 's/<{%reset%}>//g'
For a failed preview, use the preview path with the preview id:
pulumi api /api/stacks/{orgName}/{projectName}/{stackName}/preview/<preview-id>/events \
| jq -r '.events[].diagnosticEvent | select(. != null) | "[\(.severity)] \(.message)"' \
| 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. The trailing
sed strips terminal color codes that Pulumi embeds in the text, which otherwise
show up as <{%reset%}>.
Find the cause and where the fix belongs
An operation can fail with errors from more than one resource, so read all of the diagnostics first, then work through each error. Trace every error 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.
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 three places, and naming the right one keeps you from editing code that was never the problem.
- 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. This is what a failed preview usually reports, because the plan could not be built. Fix it by editing the code.
- The state. The code is correct, but the stored state and the real cloud
resources disagree. Reconcile drift with
pulumi refresh, and bring a resource that already exists outside the state under management withpulumi importrather 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, or a quota. Fix the role, the ESC environment, or the capacity that the provider rejected, rather than the resource code.
When a diagnostic is empty or too thin to act on, the real error usually isn't in the record — it's in the log of whatever the resource shelled out to. Read it there. 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
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.
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>untilrequestedBy.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.
Files
3- SKILL.md
7a83abe3d95.8 KB - agents/openai.yaml
e397fc46bd248 B - use_cases.yaml
a59f4c56dd711 B
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from pulumi/agent-skills8
Convert, migrate, or import AWS CloudFormation stacks or templates into Pulumi programs. Load this skill whenever a user wants to move from CloudFormation to Pulumi, convert a CFN template, import existing CloudFormation-managed resources into Pulumi, or asks about CloudFormation-to-Pulumi migration
Track which stacks across a Pulumi organization use a specific package and at what versions. Use for cross-stack audits, identifying outdated or unmaintained package versions across many stacks, finding affected stacks before publishing breaking changes to a component package, or planning coordinate
Upgrade any Pulumi provider to a newer version and reconcile the resulting diff. Use when users want to upgrade or update a provider (including editing package.json, requirements.txt, pyproject.toml, go.mod, or Pulumi.yaml to bump a provider SDK), check for breaking changes before or during an upgra
Convert or migrate Azure ARM (Azure Resource Manager) templates, Bicep templates, or code to Pulumi, including importing existing Azure resources. This skill MUST be loaded whenever a user requests migration, conversion, or import of ARM templates, Bicep templates, ARM code, Bicep code, or Azure res
Load this skill when a user asks how to run Pulumi programmatically, embed Pulumi in an application, orchestrate multiple stacks in code, build a self-service infrastructure portal, replace pulumi CLI shell scripts with code, or use the Pulumi Automation API (LocalWorkspace, createOrSelectStack, inl
Load when the user is writing, reviewing, or debugging Pulumi TypeScript/Python programs; asks about Output<T> or apply() usage; wants to create ComponentResource classes; needs to refactor resources without destroying them (aliases); is setting up secrets or config; or is configuring a pulumi previ
Load this skill when a user wants to migrate, convert, port, translate, or move an AWS CDK application (including CDK stacks, constructs, or CloudFormation-synthesized templates) to Pulumi. Phrases such as "convert CDK to Pulumi", "migrate CDK app", "port CDK stacks", "replace CDK with Pulumi", "sto
Guide for authoring Pulumi ComponentResource classes. Use when creating reusable infrastructure components, designing component interfaces, setting up multi-language support, or distributing component packages.
Related methodology skillsscan passed
Set up isolated git worktrees — create a new branch for fresh work, or attach a worktree to an existing branch, PR, or commit. Use when starting isolated work or isolating an existing ref.
Break a tRPC backend into multiple services with custom routing links that split on the first path segment (op.path.split('.')) to route to different backend service URLs. Define a faux gateway router that merges service routers for the AppRouter type without running them in the same process. Share
Performs AI-powered code review on Git changes using the `ocr` CLI from alibaba/open-code-review. Use when the user asks to review code, review a pull request, review staged/unstaged changes, review a commit, or compare branches for code quality issues. Produces line-level review comments and can au
Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.
Quality review of a change: is the logic right, is it safe, does it hold under real load, is risky code tested, is it fast enough, and is every line needed. Reads the connected code, not only the diff. Each finding is explained in plain English. Use for "review this", "code review", "review the last
Keep a long-lived project's documentation from rotting by assigning existing project docs clear constitution, map, status, and history roles, then wiring the active agent harness to those canonical sources. Use in the maintain phase when docs drift from code, agents lose context between sessions, or