-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Cancelling bundling of Lambda function causes next deployment to fail #33201
Comments
Hi I was not able to create the bundling-tmp folder in amplify but I get your point here. Also, #18459 (comment) is still relevant in this case. |
This is done to avoid duplicate work, but apparently we can't distinguish between unfinished and finished previous work. The directory was probably called Should be a matter of unconditionally deleting the temp folder before starting bundling. |
Some findings: The following code creates the asset folders (e.g. aws-cdk/packages/aws-cdk-lib/core/lib/asset-staging.ts Lines 418 to 426 in a486bbc
and: aws-cdk/packages/aws-cdk-lib/core/lib/asset-staging.ts Lines 332 to 333 in a486bbc
If the bundling is abruptly terminated (i.e. with Then on the next bundling run, if the CDK bundling code sees the asset folder exists, it will skip re-bundling: aws-cdk/packages/aws-cdk-lib/core/lib/asset-staging.ts Lines 438 to 439 in a486bbc
What I did to reproduce the issue:
A workaround for now would be to remove the empty asset folder and re-ran |
Describe the bug
Cancelling
cdk synth
when a Lambda function is bundling can cause an emptybundling-temp-<hash>
folder incdk.out
. This results in the next deployment of the Lambda to fail withInvalidParameterValueException: Uploaded file must be a non-empty zip
.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
CDK does not use existing
bundling-temp
folder if it is empty.Current Behavior
CDK uses existing empty
bundling-temp
folder for deployment.Reproduction Steps
npx ampx sandbox --debug
Ctrl+C
right whenBundling asset <Lambda>/Code/Stage...
appearsbundling-temp
folder incdk.out
npx ampx sandbox
againPossible Solution
No response
Additional Information/Context
We are seeing this for Amplify customers but I believe this can happen using only CDK for example in #18459 (comment).
CDK CLI Version
2.176.0
Framework Version
No response
Node.js Version
22.13.1
OS
Linux/Mac/Windows (More frequently on Windows from what we've seen)
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: