Pulumi Upgrade Failure: No Automatic Rollback for Provider Plugins
0 reputation · 17 May 2024, 17:22 UTC
0 reputation · 17 May 2024, 17:22 UTC
When executing pulumi upgrade, the CLI downloads and installs provider plugins into the local .pulumi/cache directory. If the process aborts mid-download or a plugin fails to initialize, the stack may remain in a failed state while the new plugin files persist in the cache.
The current recovery workflow requires manual intervention: uninstalling the failed plugin version, reinstalling the previous stable version, and running pulumi refresh. There is currently no native CLI flag, such as --rollback, to automate the reversion of provider changes upon an error.
This lack of automated recovery creates a risk of state inconsistency where subsequent upgrade attempts fail due to stale or mismatched plugin files in the local environment.
35275 reputation · 17 May 2024, 23:04 UTC
No atomic rollback flag exists. The Pulumi CLI does not provide a --rollback option or any native mechanism to automatically revert provider plugin changes when pulumi upgrade fails mid-download or during initialization. The upgrade process is linear; a failure leaves the stack in a failed state until you intervene manually.
Safest cache clearing: Run pulumi plugin purge to remove all cached plugins, or delete the .pulumi/cache directory directly. Both approaches force fresh downloads on the next operation. pulumi plugin purge is preferable because it is a supported CLI command and avoids accidental deletion of unrelated files.
No documented roadmap entry. As of the current Pulumi CLI 3.x releases, there is no public roadmap item confirming a built-in rollback feature for provider-level upgrade failures. Feature requests exist in the issue tracker, but no release timeline has been announced.
pulumi plugin list and note the provider name and version that was being installed when the upgrade aborted.pulumi plugin rm <provider> <failed_version> (or pulumi plugin uninstall <provider> <failed_version> in older CLI versions).pulumi plugin install <provider> <stable_version> matching the version your stack configuration expects.pulumi plugin purge to eliminate any stale files that could interfere with subsequent runs.pulumi refresh to synchronize the stack's state file with the actual infrastructure. Do not run pulumi up until refresh completes without errors.pulumi stack export) before removing plugins. A corrupted state file combined with plugin changes can make recovery harder.Pulumi.yaml or project configuration. Version mismatches are a common cause of repeated failures.pulumi refresh, inspect the output for any resources showing failed or deleted status. These indicate state drift that must be resolved before further deployments.If the failure occurred during a provider schema upgrade (e.g., a major version bump that changes resource schemas) rather than a simple plugin download, the stack's state file may already contain references to the new schema. In that case, pulumi refresh alone may not suffice and you may need to edit the state file or use pulumi state delete for affected resources. Please confirm whether the upgrade was a patch/minor version (plugin binary only) or a major version with schema changes.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.