Open andrewbohm opened 2 years ago
Thanks for reporting this issue.
I've tried using AWS Toolkit's shortcut (which displays on top of the API definition) to start the debugging session. I was able to attach debugger and start debugging.
Can you try with that approach and see if it is working?
@mndeveci Thanks for responding. I do not see AWS toolkit shortcut you are stating. I did try try the "AWS: Add Debug Configuration" with no avail.
See screenshot:
There is one before the Events
property, which says AWS: Add API Debug Configuration
, can you try that one and see if it is going to stop at breaking point?
No luck.
Same results with both Add Debug configuration settings.
{
"version": "0.2.0",
"configurations": [
{
"type": "aws-sam",
"request": "direct-invoke",
"name": "common-services:GetQrCodeFunction",
"invokeTarget": {
"target": "template",
"templatePath": "${workspaceFolder}/template.yaml",
"logicalId": "GetQrCodeFunction"
},
"lambda": {
"payload": {},
"environmentVariables": {}
}
},
{
"type": "aws-sam",
"request": "direct-invoke",
"name": "API common-services:GetQrCodeFunction",
"invokeTarget": {
"target": "api",
"templatePath": "${workspaceFolder}/template.yaml",
"logicalId": "GetQrCodeFunction"
},
"api": {
"path": "/generate-qrcode",
"httpMethod": "post",
"payload": {
"json": {}
}
}
}
]
}
Debug console
2022-09-15T21:30:22Z info layer=debugger created breakpoint: &api.Breakpoint{ID:1, Name:"", Addr:0x8a8ead, Addrs:[]uint64{0x8a8ead}, File:"/home/abohm/Code/pacific-uniform/common-services/common-services/get-qrcode/main.go", Line:31, FunctionName:"main.handler", Cond:"", HitCond:"", HitCondPerG:false, Tracepoint:false, TraceReturn:false, Goroutine:false, Stacktrace:0, Variables:[]string(nil), LoadArgs:(*api.LoadConfig)(0xc000e48000), LoadLocals:(*api.LoadConfig)(0xc000e48030), WatchExpr:"", WatchType:0x0, VerboseDescr:[]string(nil), HitCount:map[string]uint64{}, TotalHitCount:0x0, Disabled:false, UserData:interface {}(nil)}
2022-09-15T21:30:22Z debug layer=debugger continuing
/var/task/get-qrcode: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /var/task/get-qrcode)
2022-09-15T21:30:22Z debug layer=debugger continuing
2022-09-15T21:30:22Z debug layer=debugger detaching
2022/09/15 21:30:22 <nil>
15 Sep 2022 21:30:22,631 [ERROR] (rapid) Init failed InvokeID= error=Runtime exited with error: exit status 1
Socket connection to remote was closed
API server listening at: [::]:5867
2022-09-15T21:30:22Z warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
2022-09-15T21:30:22Z info layer=debugger launching process with args: [/var/task/get-qrcode]
Are there any news on this issue? I'm experiencing the same thing on my laptop...
Description:
Debug port is not opening up when running sam local command below. only port 5001 is exposed
Steps to reproduce:
sam build
sam local start-api -p 5001-d 8099 --debugger-path={CORRECT PATH TO dlv} --debug-args="-delveAPI=2"
Observed result:
sam local start-api -p 5001-d 8099 --debugger-path={CORRECT PATH TO dlv} --debug-args="-delveAPI=2"
OUTPUT:launch.json:
Expected result:
To show debug section in output and show debug port opened. When running Debug With SAM in VSCODE I would expect it to attach correctly and not state the following:
Failed to continue: "Error: connect ECONNREFUSED 127.0.0.1:8991"
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.56.1Add --debug flag to command you are running