pulumi: Installing a version of plugin sometimes fails on Windows
pulumi plugin install resource azure v0.18.2-dev.1556768307+g78c053
[resource plugin azure-0.18.2-dev.1556768307+g78c0537] installing
Downloading plugin: 36.55 MiB / 36.55 MiB [=======================] 100.00% 22s
error: installing [resource plugin azure-0.18.2-dev.1556768307+g78c0537] from https://api.pulumi.com:
moving plugin: rename C:\Users\name\.pulumi\plugins\resource-azure-v0.18.2-dev.1556768307+g78c0537.tmp804464559 C:\Users\name\.pulumi\plugins\resource-azure-v0.18.2-dev.1556768307+g78c0537:
Access is denied.
The temporary folder does get created and the manual rename does work, so I suspect some API which fails for this kind of path?
Edit: Summary of the underlying issue and proposed solution
This exact same problem was happening with golang’s module cache on Windows: module zips were downloaded/extracted to a temp dir and then renamed with os.Rename to the final dir, just like how we handle plugin installs (https://github.com/golang/go/issues/36568). The problem on Windows is that aggressive file scanners are checking the files in the temp dir, preventing the rename operation from succeeding (errors with “Access is denied.”).
The golang team’s solution was to extract the zip in-place in the final destination, rather than extracting to a temp dir and renaming it. Note that they were leveraging some file locking mechanism they already had in place, and we’ll likely need to do something similar to prevent multiple concurrent installs from cobbling over each other.
A simpler initial “fix” may be just to introduce some retries. If I’m remembering correctly, the golang team initially tried this, but still ran into the problem. However, the amount of plugin files is typically very small (~1-2 files), so we may have better luck with retries since we’re not dealing with that many files. Though, as more multi-lang components are introduced, the number of files in plugin directories will also increase as those will be running npm install (and equivalents for the other languages).
Reference: https://github.com/golang/go/commit/093049b3709eda7537ece92a2991918cf53782d6 https://github.com/golang/go/commit/576fa692774137633b09dd244e1de36993dd2803
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 27 (16 by maintainers)
@lukehoban here is what i see… i run “pulumi up” for an aws-csharp project. I get an error “error: no resource plugin ‘aws-v2.13.0’ found in the workspace or on your $PATH, install the plugin using
pulumi plugin install resource aws v2.13.0”…so i ran “pulumi plugin install resource aws v2.13.0” which returns “Moving plugin…error: installing [resource plugin aws-2.13.0] from : moving plugin: rename C:\Users\parag.andleigh.pulumi\plugins\resource-aws-v2.13.0.tmp163307875 C:\Users\parag.andleigh.pulumi\plugins\resource-aws-v2.13.0: Access is denied” and i am running it as an “Administrator” in a powershell window
not sure why this issue was closed, i see no solution. I am getting this error