aws / aws-lambda-runtime-interface-emulator

Apache License 2.0
915 stars 95 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #108

Closed samprakos closed 8 months ago

samprakos commented 8 months ago

On my arm64 mac trying to run a lambda locally. It doesn't appear to be getting to my code before this error happens. This has been working fine until this latest docker image update.

local_mac(release-candidate)» ./invoke.sh SendCorrespondence                                                                                                                                      [10:56:53]
Invoking Phoenix.LambdaServices::Phoenix.LambdaServices.Functions.Correspondence::HandleFromSQSEvent (dotnet6)                                                                                                                                     
arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Extension:50 is already cached. Skipping download                                                                                                                                              
arn:aws:lambda:us-east-1:464622532012:layer:dd-trace-dotnet:12 is already cached. Skipping download                                                                                                                                                
Local image is up-to-date                                                                                                                                                                                                                          
Using local image: samcli/lambda-dotnet:6-arm64-584e72cce5abee842011bf1a1.                                                                                                                                                                         

Mounting /Users/esamprakos/idexx/phoenix/app/Phoenix.LambdaServices/local_mac/.aws-sam/build/SendCorrespondence as /var/task:ro,delegated, inside runtime container                                                                                
START RequestId: 837f2c6e-d339-4a52-a8be-3b387ae6f1dd Version: $LATEST
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
19 Dec 2023 15:57:08,587 [ERROR] (rapid) Init failed error=exit status 255 InvokeID=
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x244604]

goroutine 19 [running]:
go.amzn.com/lambda/core.(*Runtime).Release(...)
    /LambdaRuntimeLocal/lambda/core/states.go:109
go.amzn.com/lambda/rapid.doInvoke.func1.2({0x377830?, 0x400012a280})
    /LambdaRuntimeLocal/lambda/rapid/start.go:328 +0x2a4
go.amzn.com/lambda/telemetry.(*NoOpTracer).CaptureInvokeSubsegment(0x4000113440?, {0x377830?, 0x400012a280?}, 0x2409e0?)
    /LambdaRuntimeLocal/lambda/telemetry/tracer.go:54 +0x38
go.amzn.com/lambda/rapid.doInvoke.func1({0x377830, 0x400012a280})
    /LambdaRuntimeLocal/lambda/rapid/start.go:309 +0x4cc
go.amzn.com/lambda/telemetry.(*NoOpTracer).CaptureInvokeSegment(0x4000100000?, {0x377830?, 0x400012a280?}, 0x0?)
    /LambdaRuntimeLocal/lambda/telemetry/tracer.go:44 +0x38
go.amzn.com/lambda/rapid.doInvoke({0x377830, 0x400012a280}, 0x400015a9a0, 0x4000128600, 0x400007e000, 0x400023e198)
    /LambdaRuntimeLocal/lambda/rapid/start.go:276 +0x1f4
go.amzn.com/lambda/rapid.handleInvoke({0x377830, 0x400012a280}, 0x400015a9a0, 0x0?, 0x400007e000)
    /LambdaRuntimeLocal/lambda/rapid/start.go:529 +0x254
go.amzn.com/lambda/rapid.start({0x377830?, 0x400012a280}, 0x400015a9a0)
    /LambdaRuntimeLocal/lambda/rapid/start.go:690 +0x438
go.amzn.com/lambda/rapid.Start(0x4000186000)
    /LambdaRuntimeLocal/lambda/rapid/sandbox.go:72 +0xc88
go.amzn.com/lambda/rapidcore.(*SandboxBuilder).Create(0x400010c140)
    /LambdaRuntimeLocal/lambda/rapidcore/sandbox.go:209 +0x100
created by main.main
    /LambdaRuntimeLocal/cmd/aws-lambda-rie/main.go:46 +0x1a8
No response from invoke container for SendCorrespondence                                                                                                                                                                                           
Function 'SendCorrespondence' timed out after 30 seconds                                                                                                                                                                                           

My invoke.sh is this:

sam local invoke "$@" --parameter-overrides "DefaultArchitecture=arm64"
samprakos commented 8 months ago

Nevermind...I know what the issue is :)