pulumi-eks icon indicating copy to clipboard operation
pulumi-eks copied to clipboard

Pulumi unable to find a resource plugin after I upgraded the runtime to v3.5.1 and all npm packages to latest version

Open bob-bins opened this issue 4 years ago • 8 comments
trafficstars

Pulumi does not automatically install the eks plugin using the latest version of everything.

Steps to reproduce

I am running all of this in a docker container created from the Dockerfile:

FROM node:15.3.0-alpine3.12

RUN apk update && apk add curl aws-cli openssl && \
    rm -rf /var/cache/apk/*

ENV PATH=$PATH:/root/.pulumi/bin
ARG PULUMI_VERSION="3.5.1"
RUN apk add libc6-compat && \
    curl -fsSL https://get.pulumi.com/ | sh -s -- --version $PULUMI_VERSION

ARG KUBECTL_VERSION="v1.19.6"
RUN curl -o /bin/kubectl -L https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl && \
    chmod +x /bin/kubectl

RUN apk add --update docker openrc && \
    rc-update add docker boot

WORKDIR /code
ENTRYPOINT ["sh"]

I have the following npm packages installed (node_modules and yarn.lock were deleted before yarn install to be extra sure):

        "@pulumi/aws": "^4.0.0",
        "@pulumi/awsx": "^0.30.0",
        "@pulumi/docker": "^3.0.0",
        "@pulumi/eks": "^0.30.0",
        "@pulumi/kubernetes": "^3.0.0",
        "@pulumi/postgresql": "^3.0.0",
        "@pulumi/pulumi": "^3.0.0",

I run the following command with the Dockerfile and my npm project in my cwd.

docker build -t infra .
docker run --rm -it \
    -v "$(pwd)":/code:cached \
    -v "/var/run/docker.sock:/var/run/docker.sock:rw" \
    -v $HOME/.aws:/root/.aws \
    -v $HOME/.kube:/root/.kube \
    infra

When I run pulumi up I see:

Previewing update (eks-dev):
[resource plugin kubernetes-2.8.2] installing
Downloading plugin: 0 B / 28.83 MiB [----------------------------------]   0.00%[resource plugin aws-3.31.0] installing
Downloading plugin: 28.83 MiB / 28.83 MiB [=========================] 100.00% 2s
Downloading plugin: 74.84 MiB / 74.84 MiB [=========================] 100.00% 4s
     Type                     Name                    Plan     Info
     pulumi:pulumi:Stack      infrastructure-eks-dev           
     └─ pulumi:providers:eks  default                          1 error
Diagnostics:
  pulumi:providers:eks (default):
    error: no resource plugin 'eks' found in the workspace or on your $PATH

Running pulumi plugin ls gives me:

NAME        KIND      VERSION  SIZE    INSTALLED  LAST USED
aws         resource  4.8.0    269 MB  n/a        55 seconds ago
docker      resource  3.0.0    41 MB   n/a        55 seconds ago
kubernetes  resource  3.4.0    67 MB   n/a        55 seconds ago
postgresql  resource  3.1.0    39 MB   n/a        55 seconds ago

Expected behavior

I expected pulumi up to just work. I expected eks to show up in the list of Pulumi plugins.

Workaround

Running pulumi plugin install resource eks v0.30.0 "solves" the issue but I shouldn't have to do this.

bob-bins avatar Apr 20 '21 23:04 bob-bins

This is going to cause me to avoid switching to Pulumi 3.0.

Does anyone know what's causing this?

abatilo avatar May 02 '21 14:05 abatilo

I am not able to reproduce this issue. I tried with a fresh PULUMI_HOME as well as a docker setup as defined in the bug. In both cases the provider plugin was correctly acquired. I also tried specifically with eks-0.30.0 suspecting a publishing issue but that seems to work as well.

@bob-bins - are you running the pulumi plugin ls from within the docker container? I am surprised to see some of the older versions of aws and kubernetes plugins there given the state of your package.json.

viveklak avatar Jun 10 '21 04:06 viveklak

Hm. I'm still getting this issue from within Github Actions so I know it doesn't have to do with an unclean environment. The github action is running from within the container specified by that Dockerfile. And yes, all these commands are run from within the Docker container. I updated the Pulumi version to 3.5.1 (original ticket had 3.0.0).

I am surprised to see some of the older versions of aws and kubernetes plugins there given the state of your package.json

The emphasis was on the lack of eks. I assume the reason the old plugins were listed was because my pulumi dir wasn't totally cleaned out, but it shouldn't matter in the case of this bug which is about a missing package.

Curious how you weren't able to reproduce the bug though... I seem to always hit the bug whether I'm running it in docker on my laptop, in docker in github actions, or on my laptop directly without containers

bob-bins avatar Jun 24 '21 02:06 bob-bins

Tried to repro this with @bob-bins. We confirmed that baseline use cases worked fine in docker. I will keep this open since something about the way @bob-bins' project is set up seems to cause this issue for him. He will try to come up with a more targeted repro and updated the issue.

viveklak avatar Jun 30 '21 19:06 viveklak

I found the issue. My plugin in the statefile was

            {
                "urn": "urn:pulumi:eks-dev::infrastructure::pulumi:providers:eks::default",
                "custom": true,
                "id": "f83332c1-2f57-4c82-8792-7b7907fdc272",
                "type": "pulumi:providers:eks"
            },

I was missing the inputs and outputs sections:

            {
                "urn": "urn:pulumi:eks-dev::infrastructure::pulumi:providers:eks::default",
                "custom": true,
                "id": "f83332c1-2f57-4c82-8792-7b7907fdc272",
                "type": "pulumi:providers:eks",
                "inputs": {
                    "version": "0.30.0"
                },
                "outputs": {
                    "version": "0.30.0"
                }
            },

Not sure why this section was missing from my statefile, or why it only became an issue when I upgraded to Pulumi v3, but at least I found a permanent solution. I'm fine with closing this ticket if there's nothing else you want to look into about it

bob-bins avatar Jun 30 '21 19:06 bob-bins

We are still seeing this but the above workaround doesn't work for us. We manually add it back in and then subsequent updates override it.

The only workaround that does work is installing the plugin manually.

Could you re-open?

liamawhite avatar Oct 27 '21 12:10 liamawhite

Reopened at @liamawhite's request. Possible link with https://github.com/pulumi/pulumi/issues/7702.

viveklak avatar Nov 08 '21 14:11 viveklak

Same problem here, new fix has been provided in plugin 'kubernetes' V3.21.1 but it still uses the V3.20.2 when doing 'pulumi up'!!! pulumi/pulumi-kubernetes#2249

LucasBrazi06 avatar Nov 30 '22 09:11 LucasBrazi06