aws / aws-extensions-for-dotnet-cli

Extensions to the dotnet CLI to simplify the process of building and publishing .NET Core applications to AWS services
Apache License 2.0
369 stars 86 forks source link

Trying to deploy a function that is larger than 52428800 bytes should return a non-0 code #289

Closed trucchuspear-policymogul closed 10 months ago

trucchuspear-policymogul commented 10 months ago

Describe the bug

When building and deploying .NET Lambda functions, I sometimes get the error "Error updating code for Lambda function: Zipped size must be smaller than 52428800 bytes" however the process does not return a non-zero code hence my CI build process does not know where was an error.

Expected Behavior

When "Error updating code for Lambda function: Zipped size must be smaller than 52428800 bytes" occurs, a non-0 exit code should be returned

Current Behavior

Process exited with code 0

Reproduction Steps

Prepare a lambda project that returns in a large ZIP file - larger than 52428800 bytes and run "dotnet-lambda deploy-function"

Possible Solution

Return any non-zero code when the process exits

Additional Information/Context

Using TeamCity as the build server

AWS .NET SDK and/or Package version used

.NET CLI 6.0.100

Targeted .NET Platform

.NET 6

Operating System and version

Ubuntu

ashishdhingra commented 10 months ago

@trucchuspear-policymogul Thanks for reporting the issue. It appears that you are affected by the Deployment package (.zip file archive) size quota mentioned in Function configuration, deployment, and execution table at Lambda quotas. Could you please share the error stack trace? Looks like the .NET Lambda extension tooling returns -1 error code (non-zero) in case of exceptions here.

Could you also share the version of Amazon.Lambda.Tools used? When I try to reproduce the issue to update (or create) existing Lambda function, I get the error Error updating code for Lambda function: Request must be smaller than 70167211 bytes for the UpdateFunctionCode operation. This is different from the error you described.

Thanks, Ashish

trucchuspear-policymogul commented 10 months ago

I can confirm that the .NET Lambda extension tooling is indeed returning a non-zero result and instead the problem with to do with my script.

To resolve the problem, I added a "set -e" at the top of my script and that forced the script to exit when the .NET tooling errored.

github-actions[bot] commented 10 months ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.