I’m using pulumi.StackReference and it seems that ...
# general
I’m using pulumi.StackReference and it seems that when I add calls to getOutput I’m getting Javascript Heap errors (out of memory) when running “pulumi up”, any smoking guns?
its hanging at “running read pulumipulumiStackReference” for a couple minutes before crashing
Can you share details of the error - either here or in a GitHub bug report?
import * as pulumi from “@pulumi/pulumi”; const env = pulumi.getStack(); const infraStackReference = new pulumi.StackReference(“username/pulumi-infra/“+env); const vpcOutput = infraStackReference.getOutput(“vpc”); const clusterOutput = infraStackReference.getOutput(“cluster”); const albOutput = infraStackReference.getOutput(“internalAlb”);
just doing that is enough to crash it, if I comment out ANY one of the getOutput calls it seems to work. but each getOutput call I add seems to add 1-2 minutes to the build time
here is the log including the node/pulumi version info
@white-balloon-205 gonna try -v=9 to see if I can see whats happening during the stall at “running read pulumipulumiStackReference”
Interesting - never seen this before. Could you open an issue in
Do you happen to have a particularly low memory limit on the environment you are running these deployments?
we are running on aws codebuild and even bumped up to “7 GB memory, 4 vCPUs”
we have an infra stack and a services stack, as you can see above I cut down the services index.ts to be very minimal
for some reason each getOutput call is adding minutes to the build process
And you have no reason to believe that the outputs of your stack are extremely large do you?
infra is pretty much a vpc, 2 load balancers, s3 bucket, dynamodb table, and an ec2 instance
im prob missing a few details but no, not extremely large
the infra deploys quickly with no issues
we export the vpc for example, and we also export the ecs cluster (which is in the vpc), not sure if that causes any weird reference loop or un-necessary data
it just sits here until it fails: pulumipulumiStack pulumi-services-project-staging running read pulumipulumiStackReference username/pulumi-infra/project-staging
even with -v=9 thats the last operation before it fails
If I remove the 3 getOutput calls it completes quickly
each one i add back slows it down by ~2 minutes until it eventually crashes
Okay. Could you open an issue to track? We can look into it. This does sound like a Pulumi bug in
will do
We did make one change in this space recently - https://github.com/pulumi/pulumi/pull/3071 - which could in theory be triggering an issue here.