aws-lambda-dotnet: Lambda runtime prints repeated messages (and some odd ones) when it can't find the handler for the function or when an exception is thrown in the constructor

Using dotnetcore3.1 runtime, I get the following log statements from a single Lambda invocation when I create a Lambda function that has a misconfigured Handler property in CloudFormation (meaning, the Handler refers to a class or method that doesn’t exist in the assembly).

image

The biggest problem is that Unable to load type 'LambdaSharp.Core.ProcessLogEventsFunction.Function' from assembly 'ProcessLogEvents'.: LambdaException is logged 3 times (highlighted in yellow). That means, upon querying the logs, it appears this error occurred more often than it actually did.

There are some other error messages being logged that seem to be an implementation issue of the lambda runtime and not useful to the Lambda function developer (highlighted in green).

  • 12 May 2020 21:19:02,997 [WARN] (invoke@invoke.c:297 errno: Address family not supported by protocol) run_dotnet(dotnet_path, &args) failed
  • Unknown application error occurred

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Has anyone gotten any update about this? I am also experiencing the same error: 15 Sep 2020 08:23:47,792 [WARN] (invoke@invoke.c:331 errno: Address family not supported by protocol) run_dotnet(dotnet_path, &args) failed

This happens occasionally, most of the times it works, but sometimes this error appears, it seems to be a bit random (as in, the next request which is handled by the lambda works without a problem)

@bjorg If a Lambda compute environment fails during initialization the Lambda service retries 2 more times in case the issue was intermittent. This is a done at the Lambda service level same for all runtimes. It is not specific design decision for .NET.

I had this issue when the application was erroring but the lambda had ran out of memory so it only logged [WARN] (invoke@invoke.c:331 errno: .... Once I added more memory the exception started logging.

I have this error too when using 5.1.1 but I’m not using Autofac