Environment
- SST: 4.7.1 (from 3.17.10)
- @pulumi/aws: 7.20.0 (from 6.77.0)
- @pulumi/pulumi: 3.215.0
- Bun: 1.3.11, Node: 22, macOS
Issue
sst refresh --stage staging and --stage prod both exit with code 1 due to promise leaks. sst refresh --dev completes cleanly.
sst deploy is blocked by the migration check since refresh didn't complete.
Leaked resource types (via PULUMI_DEBUG_PROMISE_LEAKS=true)
aws:lambda/function:Function
aws:lambda/functionUrl:FunctionUrl
aws:lambda/functionEventInvokeConfig:FunctionEventInvokeConfig
aws:lambda/permission:Permission
aws:s3/bucketPolicy:BucketPolicy
aws:iam/rolePolicy:RolePolicy
pulumi-nodejs:dynamic:Resource (KvKeys)
Stack traces originate from function.ts:2668 inside apply(async ...) at function.ts:1888.
Stack composition
Astro (×2), Nextjs (×1), StaticSite (×1), Function (×12), Cron (×9), Queue (×12), SnsTopic (×3), ApiGatewayWebSocket (×1), Router (×4), Postgres (×2), Dynamo (×10), Email (×1), Vpc (×1).
Possibly related
Additional context
- This stack deployed without issues on SST 3.17.10
sst diff --stage staging evaluates all resources and shows correct changes before the promise leak exits the process
- Tested disabling the
$transform below — same result
$transform(sst.aws.Function, (args) => {
args.runtime ??= 'nodejs22.x';
args.nodejs = { ...args.nodejs, sourcemap: true };
args.environment = $output(args.environment).apply((env) => {
// adds --enable-source-maps to NODE_OPTIONS
});
});
Current state
- Dev:
sst refresh --dev completed. sst deploy failed — attempted to create new RDS instances instead of updating existing ones.
- Staging:
sst refresh --stage staging failed (promise leaks). Attempted sst deploy which partially completed — deleted v3 resources but did not create v4 replacements. Staging sites are down (empty KvStore, missing server functions).
- Prod:
sst refresh --stage prod failed (promise leaks). Deploy not attempted. Prod is running on v3-deployed resources but state is now v7 format. Cannot deploy with v3 or v4.
I'd appreciate some guidance on how to safely deploy to prod given the v7 state and the promise leak blocking the migration.
Separate: Bun catalog: protocol
nodejs.install copies literal "catalog:" into Lambda build package.json. npm install fails. Workaround: explicit versions for affected packages.
Environment
Issue
sst refresh --stage stagingand--stage prodboth exit with code 1 due to promise leaks.sst refresh --devcompletes cleanly.sst deployis blocked by the migration check since refresh didn't complete.Leaked resource types (via
PULUMI_DEBUG_PROMISE_LEAKS=true)aws:lambda/function:Functionaws:lambda/functionUrl:FunctionUrlaws:lambda/functionEventInvokeConfig:FunctionEventInvokeConfigaws:lambda/permission:Permissionaws:s3/bucketPolicy:BucketPolicyaws:iam/rolePolicy:RolePolicypulumi-nodejs:dynamic:Resource(KvKeys)Stack traces originate from
function.ts:2668insideapply(async ...)atfunction.ts:1888.Stack composition
Astro (×2), Nextjs (×1), StaticSite (×1), Function (×12), Cron (×9), Queue (×12), SnsTopic (×3), ApiGatewayWebSocket (×1), Router (×4), Postgres (×2), Dynamo (×10), Email (×1), Vpc (×1).
Possibly related
KvKeysduring site deploys #6479 — sameapply(async ...)pattern fixed insite-builder.tsServicecomponents insst diffmode #6605 / Fix dangling promises insst diffwithServicecomponent #6606 — same pattern fixed incontainer-builder.tsAdditional context
sst diff --stage stagingevaluates all resources and shows correct changes before the promise leak exits the process$transformbelow — same resultCurrent state
sst refresh --devcompleted.sst deployfailed — attempted to create new RDS instances instead of updating existing ones.sst refresh --stage stagingfailed (promise leaks). Attemptedsst deploywhich partially completed — deleted v3 resources but did not create v4 replacements. Staging sites are down (empty KvStore, missing server functions).sst refresh --stage prodfailed (promise leaks). Deploy not attempted. Prod is running on v3-deployed resources but state is now v7 format. Cannot deploy with v3 or v4.I'd appreciate some guidance on how to safely deploy to prod given the v7 state and the promise leak blocking the migration.
Separate: Bun catalog: protocol
nodejs.install copies literal "catalog:" into Lambda build package.json. npm install fails. Workaround: explicit versions for affected packages.