Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: pulumi.runtime.invokeOutput is not a function #4641

Closed
mausch opened this issue Oct 15, 2024 · 6 comments
Closed

TypeError: pulumi.runtime.invokeOutput is not a function #4641

mausch opened this issue Oct 15, 2024 · 6 comments
Assignees
Labels
awaiting/core Blocked on a missing bug or feature in pulumi/pulumi (except codegen) kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed resolution/fixed This issue was fixed

Comments

@mausch
Copy link

mausch commented Oct 15, 2024

Describe what happened

In Typescript, with @pulumi/eks 2.8.1 and @pulumi/aws 6.55.0 trying to create an EKS cluster crashes with:

 TypeError: pulumi.runtime.invokeOutput is not a function
        at Object.getPartitionOutput (/home/mauricio/prg/elevate/elevate-devops/infra/node_modules/@pulumi/getPartition.ts:89:27)
        at createCore (/home/mauricio/prg/elevate/elevate-devops/infra/node_modules/@pulumi/cluster.ts:461:42)
        at createCluster (/home/mauricio/prg/elevate/elevate-devops/infra/node_modules/@pulumi/cluster.ts:1916:18)
        at new Cluster (/home/mauricio/prg/elevate/elevate-devops/infra/node_modules/@pulumi/cluster.ts:1802:25)
        at createEKS (file:///home/mauricio/prg/elevate/elevate-devops/infra/nonprod.ts:352:28)

Apparently there's been some breaking change in getPartitionOutput?
See also sst/sst#3880

Sample program

    const eksCluster = new eks.Cluster(eksClusterName, {
        name: eksClusterName,
        vpcId: vpcNonProduction.id,
        publicSubnetIds: publicSubnets.map(x => x.id),
        privateSubnetIds: privateSubnets.map(x => x.id),
        nodeAssociatePublicIpAddress: false,
        endpointPrivateAccess: true,
        endpointPublicAccess: false,
        createOidcProvider: true,
        version: "1.28",
        clusterSecurityGroup: ...,
        nodeGroupOptions: {
            instanceType: "t3.medium",
            nodeSecurityGroup: nodeSg,
        },
        storageClasses: {
            gp2: {
                metadata: {
                    name: "gp2",
                },
                type: "gp2",
                allowVolumeExpansion: true,
                default: true,
            }
        }
    });

Log output

No response

Affected Resource(s)

No response

Output of pulumi about

CLI
Version 3.122.0
Go Version go1.22.4
Go Compiler gc

Plugins
KIND NAME VERSION
resource aws 6.55.0
resource aws-native 0.97.0
resource command 0.9.2
resource docker 4.4.5
resource eks 2.8.1
resource kubernetes 4.5.4
language nodejs unknown
resource random 4.14.0

Host
OS nixos
Version 24.05 (Uakari)
Arch x86_64

This project is written in nodejs: executable='/nix/store/ilkfhnqz4xczrliqjva8770x2svbfznd-nodejs-20.14.0/bin/node' version='v20.14.0'

...

Dependencies:
NAME VERSION
@aws-sdk/types 3.609.0
@pulumi/aws 6.55.0
@types/node 14.18.35
aws-sdk 2.1658.0
fast-xml-parser 4.4.1
js-yaml 4.1.0
ts-node 10.9.1
@pulumi/docker 4.4.5
@pulumi/eks 2.8.1
typescript 5.2.2
@types/js-yaml 4.0.8
node-fetch 3.3.2
@pulumi/aws-native 0.97.0
@pulumi/command 0.9.2
@pulumi/kubernetes 4.5.4
@pulumi/random 4.14.0
tmp 0.2.1

Pulumi locates its logs in /tmp/nix-shell.IUphpA by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@mausch mausch added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 15, 2024
@t0yv0 t0yv0 added the p1 A bug severe enough to be the next item assigned to an engineer label Oct 15, 2024
@t0yv0
Copy link
Member

t0yv0 commented Oct 15, 2024

pulumi/pulumi#17518 seems to be related to this one

@t0yv0
Copy link
Member

t0yv0 commented Oct 15, 2024

#4641: TypeError: pulumi.runtime.invokeOutput is not a function

invokeOutput was introduced pulumi/pulumi#17237 into the core Node JS SDK v3.133.0 and onward:

pulumi/pulumi@f74a5df#diff-f786ce189e2b1bb74d5f9425d102b713287faea09bc04b692ea0d42e1b035a10R95

@t0yv0
Copy link
Member

t0yv0 commented Oct 15, 2024

@mausch could you provide a more self-contained repro? I tried running the EKS cluster example in https://github.com/pulumi/pulumi-eks/blob/master/examples/cluster/index.ts#L20 on these versions of Pulumi Core, EKS and AWS and it seems to provision fine. Could something be downgrading the "@pulumi/pulumi" SDK version in your program for some reason? What is in your packages-lock.json or yarn.lock?

@t0yv0 t0yv0 added needs-repro Needs repro steps before it can be triaged or fixed and removed needs-triage Needs attention from the triage team p1 A bug severe enough to be the next item assigned to an engineer labels Oct 15, 2024
@t0yv0
Copy link
Member

t0yv0 commented Oct 15, 2024

@mausch we ran this down with the team a bit further. AWS v3.55.0 used this minimum core dependency:

  "@pulumi/pulumi": "^3.42.0"

https://github.com/pulumi/pulumi-aws/blob/v6.55.0/sdk/nodejs/package.json#L16

And it used this version of Node SDK generator from Pulumi Core that controls the minimum SDK dependency:

 github.com/pulumi/pulumi/pkg/v3 v3.133.1

This minimum version was too low it seems, which is a bug. This is maintained in this file:
https://github.com/pulumi/pulumi/blob/master/pkg/codegen/nodejs/gen.go#L50

It has since been fixed to correctly indicate a higher necessary "@pulumi/pulumi" dependency that includes the new functions such as pulumi.runtime.invokeOutput.

It looks though that these fixes have not propagated yet to pulumi-aws.

This routine update PR should fix the problem by using the latest version of the Node SDK generator:

#4628

We are releasing the next minor version of the provider presently and I believe the problem should be fixed.

@t0yv0
Copy link
Member

t0yv0 commented Oct 15, 2024

Can you reproduce this problem with https://github.com/pulumi/pulumi-aws/releases/tag/v6.56.0 ?

@t0yv0 t0yv0 added resolution/fixed This issue was fixed area/core awaiting/core Blocked on a missing bug or feature in pulumi/pulumi (except codegen) and removed area/core labels Oct 23, 2024
@t0yv0
Copy link
Member

t0yv0 commented Oct 23, 2024

I believe this should be fixed in the latest release, but please let us know if not so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting/core Blocked on a missing bug or feature in pulumi/pulumi (except codegen) kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

2 participants