Description
Describe the bug
AWS documentation says the Handler
property has a max length 128 characters, but values exactly 128 characters long appear to be truncated to 127 characters in the dotnet6
Lambda runtime, and therefore fail.
Expected Behavior
A handler value exactly 128 characters long shouldn't be truncated and should invoke the handler method successfully.
Current Behavior
A handler value exactly 128 characters long, such as:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX::XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.LambdaFunction::HandleAsync
produces a failure:
Amazon.Lambda.RuntimeSupport.ExceptionHandling.LambdaValidationException: Unable to find method 'HandleAsyn' in type 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.LambdaFunction' from assembly 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX': Found no methods matching method name 'HandleAsyn'.
at Amazon.Lambda.RuntimeSupport.Bootstrap.UserCodeLoader.FindCustomerMethod(Type type) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/UserCodeLoader.cs:line 242
at Amazon.Lambda.RuntimeSupport.Bootstrap.UserCodeLoader.Init(Action`1 customerLoggingAction) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/UserCodeLoader.cs:line 116
at Amazon.Lambda.RuntimeSupport.Bootstrap.UserCodeInitializer.InitializeAsync() in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/UserCodeInitializer.cs:line 46
at Amazon.Lambda.RuntimeSupport.LambdaBootstrap.InitializeAsync() in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs:line 155
Reproduction Steps
- Create a Lambda with a handler specification that is exactly 128 characters long.
- Try to invoke the function.
Possible Solution
No response
Additional Information/Context
AWS Console shows the full value in the "Runtime settings" of the Lambda function, so it seems to be getting truncated somewhere in the Lambda runtime.
AWS .NET SDK and/or Package version used
N/A — this bug is independent from .NET SDK.
Targeted .NET Platform
.NET 6
Operating System and version
Amazon Linux 2