https://pulumi.com logo
Title
a

adamant-father-26302

02/10/2023, 11:31 AM
when runnning
pulumi about
i get the following error:
warning: Failed to get information about the Pulumi program's dependencies: failed to get modules: exit status 1
with -v=7 i can see i get:
I0210 11:56:35.288506 1326938 langruntime_plugin.go:348] langhost[go].GetProgramDependencies(proj=aws-cluster-0-stage,pwd=/home/hans/work/fiveteninfra/provider/aws/live/stage/aws-cluster-0-stage,program=.,transitiveDependencies=false) failed: err=failed to get modules: exit status 1
I think its this call that fails:
c.cc.Invoke(ctx, "/pulumirpc.LanguageRuntime/GetProgramDependencies", in, out, opts...)
which uses RPC I think, am I lacking some requirements ?
e

echoing-dinner-19531

02/10/2023, 12:23 PM
What do you get if you run
go list --json -m ...
in the program directory?
a

adamant-father-26302

02/10/2023, 12:25 PM
go: can't match module patterns using the vendor directory
        (Use -mod=mod or -mod=readonly to bypass.)
e

echoing-dinner-19531

02/10/2023, 12:26 PM
ah well that's why, I'd need to go check some go docs to work out what that means though
a

adamant-father-26302

02/10/2023, 12:26 PM
hm, so pulumi gets confused when you vendor deps?
e

echoing-dinner-19531

02/10/2023, 12:27 PM
yeh seems it, I didn't think anyone was doing vendoring in Go anymore now that mod files were a thing
a

adamant-father-26302

02/10/2023, 12:28 PM
can that also be the reason it seems to use the "wrong" plugin versions? im using
<http://github.com/pulumi/pulumi-kubernetes/sdk/v3|github.com/pulumi/pulumi-kubernetes/sdk/v3> v3.17.0
, but it selects:
SelectCompatiblePlugin(..., kubernetes): selecting plugin 'kubernetes-3.24.0': best match
e

echoing-dinner-19531

02/10/2023, 12:29 PM
yeh probably
a

adamant-father-26302

02/10/2023, 12:29 PM
oh cool, ive been trying to figure that out for quite a while 🙂
couldnt make sense of the plugins being used
when I deleted the vendor directory, I dont get the error anymore, but get
No dependencies found
instead
but I still can't quite figure out why it chooses plugin 3.24.0 of kubernetes:
I0210 14:17:51.717238 1409869 plugins.go:165] gatherPluginsFromSnapshot(): plugin kubernetes 3.24.0 is required by first-class provider "urn:pulumi:euc1::aws-cluster-0-stage::fiveten:eksspotcluster:EksSpotClusterComponent$eks:index:Cluster$pulumi:providers:kubernetes::cluster-0-stage-eks-cluster-eks-k8s"
I0210 14:17:51.717253 1409869 plugins.go:165] gatherPluginsFromSnapshot(): plugin kubernetes 3.24.0 is required by first-class provider "urn:pulumi:euc1::aws-cluster-0-stage::fiveten:eksspotcluster:EksSpotClusterComponent$eks:index:Cluster$pulumi:providers:kubernetes::cluster-0-stage-eks-cluster-provider"
I0210 14:17:51.717264 1409869 plugins.go:165] gatherPluginsFromSnapshot(): plugin kubernetes 3.24.0 is required by first-class provider "urn:pulumi:euc1::aws-cluster-0-stage::fiveten:eksspotcluster:EksSpotClusterComponent$pulumi:providers:kubernetes::cluster-0-stage-k8sProvider"
when go.mod says:
<http://github.com/pulumi/pulumi-kubernetes/sdk/v3|github.com/pulumi/pulumi-kubernetes/sdk/v3> v3.17.0
I guess that comes from
pulumi stack export > something
then you can look at
something
and see the input to the urn has version 3.24.0
but I thought it was the SDK version that decided what plugin to use*
e

echoing-dinner-19531

02/10/2023, 2:31 PM
Go SDKs do an oddity where the version isn't hardcoded in but it tries to work it out based on how it was imported
So I think that's probably what's causing this
a

adamant-father-26302

02/10/2023, 2:32 PM
so getting from the stack inputs is a fallback if it cant find specific from imports?
also, its imported like this
k8s "<http://github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes|github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes>"
is there any workarounds for getting consistent plugin versions across many computers?
e

echoing-dinner-19531

02/10/2023, 2:50 PM
It should be consistent if using go.mod files with fixed version numbers in them
a

adamant-father-26302

02/10/2023, 2:51 PM
We do use that, but the 3.24.0 plugin being downloaded does not match with the pulumi-kubernetes sdk in go.mod or go.sum
but we have been using vendored sdk's earlier, but no idea how it got 3.24.0, we never had that new version of pulumi-kubernetes*
e

echoing-dinner-19531

02/10/2023, 2:52 PM
yeh the old version might be in the stack state, and currently the engine tries to use those plugin versions as well. Wer're looking at changing that
a

adamant-father-26302

02/10/2023, 2:55 PM
is it like,
pluginVersion = if SDK.version > stack.resource.input-version then sdk.version else stack.resource.input-version
? just guessing 🙂
e

echoing-dinner-19531

02/10/2023, 3:31 PM
It loads both, then uses the old or new based on if it's doing updates or deletes