Describe the bug
Attempting to run a local lambda debug session fails with the following error message:
Error running '[Local] LambdaEmptyFunction': Timeout waiting for Debugger process to start
To reproduce
The sam build starts, and then the IDE reports 'waiting for debugger' until it times out.
The IDE event log tab shows the following messages:
09:14 Debugger attach error: Unable to attach to debugger process.
09:14 Error running '[Local] LambdaEmptyFunction::LambdaEmptyFunction.Function::FunctionHandler': Timeout waiting for Debugger Worker process to start
Expected behavior
Screenshots
Your Environment
Are there any logs in the debug tool window?
Try to use run first so that it has time to download the docker image first.
I do not even get to the Debug tool window, it only shows as a greyed-out tab with the error message hovering above it, and it disappears when I try to select the tab.
Using run first does not make any difference.
I have installed sam cli using the instructions on https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-mac.html, and just upgraded to 0.34.0, which does not help.
These instructions however do contain one (very) puzzling statement. To confirm a proper docker installation, the following is suggested:
'After Docker is installed, verify that it's working. Also confirm that you can run Docker commands from the AWS SAM CLI (for example, docker ps). You don't need to install, fetch, or pull any containers––the AWS SAM CLI does this automatically as required. '
I know how to run docker, and sam is installed and running, but how do you run 'docker ps' using SAM CLI? There is no sam command that allows me to run an arbitrary command...
The phrasing does sound odd. I will talk to the doc writers. It also is not needed anymore since we do the check for you now: https://github.com/aws/aws-toolkit-jetbrains/blob/32404a5b50822d6d259d5c75466432dd1f971842/jetbrains-core/src/software/aws/toolkits/jetbrains/services/lambda/execution/local/SamRunner.kt#L26
Sounds similar to https://github.com/aws/aws-toolkit-jetbrains/issues/784 and https://github.com/aws/aws-toolkit-jetbrains/issues/642 . The plumbing for Rider might be different, but perhaps the same root cause: need explicit host instead of "localhost"?
Related PR: https://github.com/aws/aws-toolkit-jetbrains/pull/1402
@koendhondt, did you install Rider from Toolbox or from an installer?
Downloaded Rider dmg image from jetbrains and ran the installer. Used automatic upgrades to upgrade ever since.
Don't know if it helps you out, but here's what I tried so far:
As far as I can tell, there is no docker container being created when I run a debug session. If you could tell me how I can enable debug logging in Rider and/or AWS toolkit I might be able to gather some additional logs and/or information for you.
@koendhondt, could you please check Docker Preferences... > File Sharing and make sure you have /Applications path added here? It maps a Debugger directory under your Rider installation folder to Docker container volume when you run debug.
Thanks @sdubov , that was it. The problem was a combination with pycharm: I have this installed too, and have the AWS toolkit for pycharm as well. When I looked at the shared paths, it contained the following: /Applications/PyCharm.app/Contents/helpers
Removing this and adding /Applications did work.
Perhaps the aws toolkit installer needs to add /Applications/Rider.app/[path to tools] to the shared paths as well? At least it could contain the logic to check if /Applications is already in shared paths or add some type of message to notify the user.
At least it could contain the logic to check if /Applications is already in shared paths or add some type of message to notify the user.
That's true. We should definitely check this before running debug. Have this change in my todo list already :) Thank you.
I had the same issue, and @sdubov your suggestion has fixed it. But @sdubov it would be great if the check could be added to the code as per your TODO list...
Most helpful comment
@koendhondt, could you please check Docker
Preferences...>File Sharingand make sure you have/Applicationspath added here? It maps a Debugger directory under your Rider installation folder to Docker container volume when you run debug.