Search code examples
.netamazon-web-servicesaws-lambdaarm64

Why is my AWS Lambda crashing when running in ARM64 architecture?


I'll summarize my issue.

I have a solution containing multiple .NET lambdas (3.1) which I deploy using serverless, all of which work just fine in the old architecture (x86_64) but when I changed the architecture setting to arm64 (and saw that it updated the actual lambda in console) whenever I actually run the lambda it crashes.

Unable to load assembly 'Lambda.Api'.: LambdaException
19 Oct 2021 09:22:15,116 [WARN] (invoke@invoke.c:331 errno: None) run_dotnet(dotnet_path, &args) failed
Unknown application error occurred

I have three questions regarding this.

  1. How do I get more information from the logs regarding the failure? I tried adding logs but nothing showed, this error happened too early and I need to find a way to debug the process locally, maybe to see which dependency I need to fix.
  2. Is this issue due to anything other than dependencies? What else could it be caused by?
  3. If this is caused by DLL dependencies, how do I find which one?

Solution

  • I'm not sure, but probably you have to pass arm64 parameter during the packaging

    dotnet lambda package -farch arm64
    

    Details