I got the following error when trying to deploy in...
# general
s
I got the following error when trying to deploy infrastructure using circleci:
error: no resource plugin aws-v4.24.1 found in the workspace or on your $PATH, install the plugin using pulumi plugin install resource aws v4.24.1
I am not sure why I need to manually install aws plugin? I didn't do that on my local machine ps. I am using organization account, when I do this on my personal account I don't have this issue
1
This is a screenshot of the error
l
Generally this happens when a stack is deployed with one version of the plugin from one machine, and different version is installed on another machine. Usually (for me) the "error" machine only has the new version, but the most recent deployment happened from another machine with an older version of the plugin.
Your options are 1) to install the old plugin and deploy from this machine; the old version of the plugin is needed to read, but the new version will be used when writing, and then everything is good (you can remove the old version of the plugin).
or 2) to install the latest version on some other (dev) machine, manually deploy (upgrading the plugin associated with the resources), and then run the CircleCI pipeline.
The most robust solution for a pipeline is to detect these errors and resolve them in the pipeline, since they do happen every few weeks in my experience.
Fortunately the error message includes the command that resolves it.
s
Thank you for your answer! I only deployed from one machine which is circleci executor and don't understand how that caused error you described 🤔 Can pulumi somehow address this problem by maybe looking at package.json package versions and automatically install proper plugin so that they are all same on every machine?
l
Yes in general it does that, but occasionally the version in the state is different to the version available to Pulumi. When you're caching / retaining your plugins, then both versions are available and you don't see this problem; if the old versions are gone (maybe you're creating a new ~/.pulumi each time you build) then you have only the newest plugin available, and the older one is still being referenced in the state.
The best thing to do is to add ~/.pulumi to whatever caching CircleCI offers, so you always keep all versions of the plugins. If you can't do that, then you need to be able to install both the newest and currently in-use versions of each plugin for each deployment.
s
Thanks @little-cartoon-10569 a lot! 🙌
👍 1