Open ashprao opened 2 years ago
could not launch process: fork/exec /var/task/hello-world: function not implemented
I believe function not implemented
is referring to a binary within the Docker container being unavailable, probably since it's emulating AMD64 on Apple silicon. I'm guessing Delve is trying to use some low-level library that the emulation does not support. There's not much information but I think ptrace
is the thing that's missing: https://github.com/docker/for-mac/issues/5191
SAM CLI does not support ARM containers, or else the solution would be to just run the lambda with the native architecture. Similar issue here: https://github.com/aws/aws-toolkit-vscode/issues/1566
Thanks for the responses. Much appreciated.
The background for this is that we are evaluating (once again) Go's suitability for some of our workloads. We are very keen to use, it but would prefer to have an easy workflow from a tooling perspective in coding our Lambda's with Go.
To that end, I am just a bit confused as to where to pursue this issue and make a case for getting a fix. Should I raise a bug here in AWS Toolkit project or is this an issue for the AWS SAM team, in the hope that they can can fix the issue with the docker container, or is it an issue for Docker?
We have standardised on VS Code and from our point of view, would consider moving to Go a show stopper without getting the debugger issue fixed.
Ah sorry, I realized I didn't offer any further steps. I would open up an issue with SAM CLI requesting further guidance in regards to ARM containers. They may also know more about potentially getting Delve to work correctly in an x86 container on an M1 mac. I don't have an M1 mac personally, otherwise I'd try this out myself to see if I could get it working.
It may be possible to build your own base image for ARM, though at that point things start to get nebulous in regards to support from other tooling.
Keep in mind that debugging Go lambdas would work correctly on x86 machines (e.g. an Intel mac), just not M1 macs. You could set-up an x86 host and use remote development as well. This way you can still use VS Code for your workflows, though it'll be a little bit more involved than normal.
I had this issue. Check your filesharing preferences in docker. I had shared /tmp , though after some update to docker this stopped working. I had to additionally share /private. You can find the file sharing preferences under Docker -> Preferences -> Resources -> File Sharing . Make sure you have /tmp and /private in there. You can test with docker run -it /tmp/aws-toolkit-vscode/vsctkeYZ6BB/output/helloworld:/tmp/goo ubuntu:latest /bin/bash
. If ls /tmp/goo
inside your container comes up with the empty set, docker filesharing a very probable culprit.
Hi @edyesed, thanks for your feedback.
I was able to confirm that Docker set up had /tmp
and /private
entries in the Docker->Preferences->Resources->File Sharing
. Additionally running ls /tmp/goo
after starting Docker with docker run -iv /tmp/aws-toolkit-vscode/vsctkwDKvtu/output/helloworld:/tmp/goo ubuntu:latest /bin/bash
did list the hello-world
artefact, so I am assuming that file share is working and perhaps not a contributor to my issue?
Just out of curiosity, it would be great if you could let me know if the list of directories shared, that I had by default in my Docker setting, are what you also have in your docker preferences, in addition to /tmp
and /private
.
/Users
/Volumes
/private
/tmp
/var/folders
I concur that file sharing is not the root of the issue you’re experiencing. In my docker file share I had /Users and /tmp . This had been functional for me historically with debugging Sam apps with vscode. This week I need to add /private as well 🤷. I recalled the error surfaced was function not implemented, but perhaps I am mistaken or this error appears for multiple conditions. Either way, file sharing is working for you and not the root of your issue.
bump on this issue
Any updates?
@OmerBlechman are you also getting could not launch process: ...: function not implemented
?
Any updates on this issue? I am also getting could not launch process: ...: function not implemented on my 2021 Apple M1 Pro.
Desktop (please complete the following information):
How to get my AWS SAM initiated local debugging of lambda's written in Go working?
Summary of the problem After creating a plain vanilla AWS SAM application with
sam init
forgolang
, and then using the code lens to create an AWS SAM template file based debug configuration, I get the following error when trying to debug the lambda code. Running the code without debugging works.From the output listed above, it seems to me that when using the debugger, it thinks that the function is not implemented. 2021-09-11 10:55:07 [INFO]: Waiting for SAM application to start... could not launch process: fork/exec /var/task/hello-world: function not implemented
Running the above lambda from command line with
sam build && sam local invoke
works.Other considerations
sam local invoke
.Steps to reproduce
sam init
.Hello world
template.