Error: could not load provider for resource: could not find provider
Fixes Pulumi destroy or update failing because state references a provider version that is no longer installed. For engineers who upgraded the CLI or provider and now cannot even destroy, with the stack-export surgery fix.
Error: could not load provider for resource ... could not find provider urn:pulumi:...
TL;DR
Your state points at a provider version that is not installed anymore. Back up state with pulumi stack export, rewrite the stale provider URN to the installed version, re-import, then destroy or update.
The error
error: could not load provider for resource urn:pulumi:[stack]::[project]::eks:index:Cluster$aws:eks/cluster:Cluster::eksCluster: could not find provider urn:pulumi:[stack]::eks::pulumi:providers:aws::default_6_37_1::[id]Fix it
- Back up state before touching anything:
pulumi stack export > stack.jsonand keep a copy somewhere safe.
- Success check:
stack.jsonexists and is valid JSON.
- Find which provider version IS installed:
pulumi plugin lsand note the aws provider version (e.g. 6.40.0).
- Success check: you have a concrete installed version.
- In a copy of the export, replace every occurrence of the stale provider URN segment (e.g.
default_6_37_1) with the installed one (e.g.default_6_40_0), keeping the trailing id suffix consistent with the installed provider.
- Success check: no occurrences of the old version string remain.
pulumi stack import < stackmodified.json, then re-runpulumi destroyorpulumi up.
- Success check: the provider loads and the operation proceeds.
When to use this
You hit this when destroy/update fails at provider load after a CLI or provider upgrade changed which provider versions are installed.
When NOT to use this
Do not use this for "failed to download plugin" errors. That is a missing plugin; install it with pulumi plugin install resource aws [version] instead.
Compatibility
Pulumi CLI 3.x. The URN surgery approach works across provider versions.
Variants
error: could not load provider for resource [urn]: could not find provider [urn]naming any provider- The same failure on
pulumi previewwhen the preview needs the provider
Root cause
State records the exact provider instance (name + version + id) each resource was created with. Upgrading the CLI does not rewrite those references, so if the old provider binary is gone, even a destroy cannot load what it needs.
Edge cases
- If the replacement still fails, the id suffix may also need to match an installed provider instance. Compare against
pulumi plugin lsoutput carefully. --disable-integrity-checkingdoes not bypass this; the provider binary itself is missing.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.