Open trixoflow opened 3 years ago
I do not believe that the WSL2 opened networked ports are visible to Win10 by default.
Are you able to telnet to that debug port from Windows side?
hi! thank you for the lighting speed answer. Great idea but didn't work :'(
I opened the port 59775 and I executed the following
sam local invoke --template C:\w\flowplayer\lamda\HelloLamda\HelloWorldFunction\src\main\.aws-sam\build\template.yaml --event "C:\Users\trixo\AppData\Local\Temp\[Local] App-event12665.json" --debug-port 59775
I got the usual:
C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\chevron\renderer.py:73: SyntaxWarning: "is" with a literal. Did you mean "=="?
if scope is 0:
Invoking helloworld.App (java8.al2)
Skip pulling image and use local one: amazon/aws-sam-cli-emulation-image-java8.al2:rapid-1.8.0.
Mounting C:\w\flowplayer\lamda\HelloLamda\HelloWorldFunction\src\main\.aws-sam\build\Function as /var/task:ro,delegated inside runtime container
Picked up _JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=59775 -XX:MaxHeapSize=2834432k -XX:MaxMetaspaceSize=163840k -XX:ReservedCodeCacheSize=81920k -XX:+UseSerialGC -XX:-TieredCompilation -Djava.net.preferIPv4Stack=true -Xshare:off
Then I telnet from windows: "telnet localhost 59775" and I got the following on the other terminal:
Debugger failed to attach: timeout during handshake
and it continue to be stack.
And telnet was able to connect?
Edit: Nvm, it must have since the debug handshake timed out due to telnet not doing the handshake
What is the debug host under the SAM CLI tab in the debug run config? That host is populated by the configured docker endpoints in the IDE
Yes the telnet succeeded sorry for not mention it clearly. I have uploaded all three tabs in the configuration
This looks like this bug: https://github.com/aws/aws-toolkit-eclipse/issues/164
I tried invoking it from terminal, run passes debug freezes. So probably it is not an aws-toolkit-jetbrains issues, but something more generic, should we move this issues on another repository?
What I think happens is that when AWS Toolkit executes sam.cmd local invoke ...
- it starts up the Docker container (in my case, of public.ecr.aws/lambda/java:17-rapid-x86_64
image), and then during the container kick-off at some point after the Picked up _JAVA_OPTIONS...
message it expects a connection from a remote debugger, but not receiving one, hence it looks as if the debug session hangs. The worst thing is that sometimes it suddenly starts working out of nowhere for a couple of days, and then stops working in the same unexpected manner.
To me it seems like the AWS Toolkit fails to match the debug port provided via --debug-port
argument to sam.cmd local invoke ...
when creating a debugger connection. I've tested this by manually creating a Remote JVM Debug
configuration in IntelliJ on the matching port, and was able to continue with debugging of my Lambda code.
I'm running on Windows 10 Pro, Docker in Ubuntu on WSL2, and I've updated the following components in my environment to the latest versions of today with no apparent effect:
Describe the bug Lambda runs fine locally, but when I try to debug is stack on "Picked up _JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=57546 -XX:MaxHeapSize=2834432k -XX:MaxMetaspaceSize=163840k -XX:ReservedCodeCacheSize=81920k -XX:+UseSerialGC -XX:-TieredCompilation -Djava.net.preferIPv4Stack=true -Xshare:off"
Full log:
I also noticed that there is a docker container created and started, that is not deleted, even when I stop debugging
To reproduce
Expected behavior To stop at the breaking point inside the RequestHandler
Screenshots
Your Environment
Additional context