Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support runtime provided.al2 for debugging #3718

Open
L4B0MB4 opened this issue Mar 8, 2022 · 13 comments
Open

Support runtime provided.al2 for debugging #3718

L4B0MB4 opened this issue Mar 8, 2022 · 13 comments

Comments

@L4B0MB4
Copy link

L4B0MB4 commented Mar 8, 2022

When developing a go lambda including a external extension one has to switch to provided.al2. If you want to debug the lambda with

sam local start-api --host 0.0.0.0 -d 5858 --debugger-path dlv --debug-args "-delveAPI=2"

it only works until it builds the docker image.
image

How are we not supposed to debug this ?

Also (as a side note) I could have sworn it worked at one point. But after multiple colleagues had this problem I found myself unable to reproduce a working debugger as well - so it might be my dementia.

Any plans on supporting this in the (near) future ?

@CoshUS
Copy link
Contributor

CoshUS commented Mar 15, 2022

Instead of using the go emulation image, provided runtime will pull the provided lambda emulation image which does not support debugging. We currently don't have plans on supporting this. Tagging it as a feature request.

@alijarjis-pol
Copy link

I'd also like to see this feature implemented. Its very annoying that there is no way to debug a Go Lambda locally at the moment.

@shearn89
Copy link

Developing on a mac and generally working on ARM lambdas, not being able to debug is certainly a problem!

@ravitejaavv
Copy link

Any update on this issue

@ShankaranarayananBR
Copy link

Any update on this issue??

@mcblair
Copy link

mcblair commented Feb 14, 2023

We use lambdas behind API Gateway, and use gin proxy. In order for us to debug our SAM functions in al2 runtime, we've implemented an abstraction that determines if running in AWS - if so, we call lambda.Start with gin proxy, if not, we call a localStart function that starts gin directly.

I'm not aware of any alternatives, but this at least allows us to debug a single function.

@sbilello
Copy link

sbilello commented Feb 14, 2023

@mcblair could you share a sample repository with an hello world lambda that are you able to debug in local in GoLand or VScode in an M1 Mac please?

@mcblair
Copy link

mcblair commented Feb 15, 2023

@sbilello Sure, just whipped this up: https://github.com/mcblair/aws-hello-go-lambda

It compiles, I have step-through debugged it in VS Code, on my M1 Mac with arm64. Can sam build and deploy it, too.

@sbilello
Copy link

@mcblair Thank you! It should be worth a blog post! I noticed it works nicely on VScode but unfortunately GoLand does not support provided.al2

@mcblair
Copy link

mcblair commented Feb 15, 2023

@mcblair Thank you! It should be worth a blog post! I noticed it works nicely on VScode but unfortunately GoLand does not support provided.al2

The AWS toolkit & SAM doesn't support provided.al2 for debugging lambdas. To debug that way, go1.x is required and you must debug from an x86_64 machine, M1 macs(or any arm chip) will not work (see #4706).

I was debugging main with F5 in VS Code and stepping through. Debugging in GoLand should work the same way, as it isn't using AWS toolkit or SAM to even be aware of the function runtime.

@andrewbohm
Copy link

Are there any plans on supporting debugging on al2 in the future? Since aws is no longer going to support go1.x we are going to have to create all of our new functions with al2 and having the ability to debug would be nice to say the least.

@jackmcguire1
Copy link

Bump

1 similar comment
@jledesma-tc
Copy link

Bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests