Hi everyone, We’re running into an issue when rem...
# seed
s
Hi everyone, We’re running into an issue when removing stages and I was wondering if we could get some help / guidance please? Our pipeline has ‘Auto-Deploy Pull Requests’ enabled along with the ‘Remove the stage when the PR is closed’ option. However, when we close a pull request Seed fails to remove the corresponding stage and the following error is output (shorten for brevity):
Copy code
Received response status [FAILED] from custom resource. Message returned: Lambda was unable to delete <arn> because it is a replicated function. Please see our documentation for Deleting Lambda@Edge Functions and Replicas. Logs: <cloudwatch-url>
For additional context, it’s a SST project with separate ‘server’ and ‘client’ stacks. The client is a Next.js application and uses the NextjsSite SST construct. What’s odd is the stage removal seems to succeed when I manually retry it in the Seed UI. It would be great to not have to manually clean up the PR stages if possible?
f
Hey @Sam Wrigley, just adding some background, the NextjsSite construct uses Lambda@Edge functions behind the scene.
And the Edge functions currently can’t be delete in one go. It’s a limitation on the AWS side.
For each Edge function, AWS deploys a replica of it to all the edge locations. And the first time when you try to remove these Edge functions, AWS will remove the replicas first, and respond with the above error you observe.
If you retry removing again, AWS will see that all replicas have been removed, it will remove the actual function and succeed.
We’ve got an open issue to work around this limitation https://github.com/serverless-stack/serverless-stack/issues/835
s
Thanks for the info, Frank! Until there's a workaround in place, is your guidance to manually retry any failed removals in the Seed UI?
f
Yeah, that’d be the only option at the moment.
I will keep you posted when the workaround is put in.
s
Thank you!
c
@Frank any movement on this?
c
@Frank I too am curious if there has been any movement on this front