aws-toolkit-jetbrains icon indicating copy to clipboard operation
aws-toolkit-jetbrains copied to clipboard

Golang AWS SAM lambda Function debugging is not working on M1 Mac

Open OmerBlechman opened this issue 3 years ago • 4 comments

When trying to debug simple SAM, I'm receiving the following error:

could not launch process: fork/exec /var/task/hello: function not implemented

Is anyone knows how to solve it?

The full log is:

Mounting /Users/.../HelloWorld as /var/task:ro,delegated inside runtime container
START RequestId: 87012bed-214a-4603-8f3c-675ce1551167 Version: $LATEST
API server listening at: [::]:60198
2022-01-18T17:21:55Z warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
2022-01-18T17:21:55Z info layer=debugger launching process with args: [/var/task/hello]
could not launch process: fork/exec /var/task/hello: function not implemented
2022/01/18 17:21:55 exit status 1
18 Jan 2022 17:21:55,118 [ERROR] (rapid) Init failed error=Runtime exited with error: exit status 1 InvokeID=
API server listening at: [::]:60198
2022-01-18T17:21:55Z warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
2022-01-18T17:21:55Z info layer=debugger launching process with args: [/var/task/hello]
could not launch process: fork/exec /var/task/hello: function not implemented
2022/01/18 17:21:55 exit status 1
END RequestId: 473c16f3-4562-40aa-9a9f-1528fe87aaaa
REPORT RequestId: 473c16f3-4562-40aa-9a9f-1528fe87aaaa	Init Duration: 1.18 ms	Duration: 1041.97 ms	Billed Duration: 1042 ms	Memory Size: 128 MB	Max Memory Used: 128 MB	

OmerBlechman avatar Feb 09 '22 14:02 OmerBlechman

Here's a related issue for the AWS VS Code Toolkit: https://github.com/aws/aws-toolkit-vscode/issues/2020

From what I remember, the issue is that the container is being emulated as x86 which Delve cannot handle. So I believe we'd need ARM support for Go images from SAM CLI.

JadenSimon avatar Feb 09 '22 17:02 JadenSimon

@rli Can you try to help?

OmerBlechman avatar Mar 29 '22 14:03 OmerBlechman

Still needs SAM CLI support https://github.com/aws/aws-sam-cli/issues/3283

rli avatar Apr 05 '22 00:04 rli

Is there any progress on this? Getting this err on M1 as well

varfrog avatar Aug 26 '22 20:08 varfrog

Any update on this issue?

ravitejaavv avatar Nov 21 '22 06:11 ravitejaavv

This is blocked by https://github.com/aws/aws-sam-cli/issues/3283 . Consider upvoting 👍 that issue!

justinmk3 avatar Nov 21 '22 17:11 justinmk3