Aws-toolkit-jetbrains: Rider Lambda debugging doesn't work: Timeout waiting for Debugger Worker process to start

Created on 27 Nov 2019  ·  11Comments  ·  Source: aws/aws-toolkit-jetbrains

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

  1. Using the New project wizard, create a LambdaEmptyFunction project (or any other Lambda project)
  2. Configure credentials;
  3. Create a Local run configuration for the project;
  4. Select Run -> Debug

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

  • OS: MacOS Mojave 10.14.6
  • JetBrains' Product: Rider
  • JetBrains' Product Version: 2019.2.3
  • Toolkit Version: 1.8-192
  • SAM CLI Version: SAM CLI, version 0.22.0
  • JVM/Python Version: jvm 1.8.0_202, Python 2.7.10, Python 3.7.4
  • Docker Desktop Version: Community edition, version 2.1.0.5
  • Docker Engine Version: Docker version 19.03.5, build 633a0ea
bug

Most helpful comment

@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.

All 11 comments

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:

  • purged all my docker containers (docker system prune -a), docker images returns an empty list;
  • restart Rider, load solution and run a debug session, Timeout waiting for debugger appears;
  • docker images now lists (after some time):
    REPOSITORY TAG IMAGE ID CREATED SIZE
    lambci/lambda dotnetcore2.1 4cef2fb5726d 31 hours ago 1.03GB
  • restart Rider
  • run 'watch -n 1 docker ps' and start KiteMatic from Docker Desktop (KiteMatic shows an empty container list)
  • load solution and run debug session again, timeout occurs again.
  • nothing is show in docker ps output, KiteMatic container list remains empty;
  • run a 'Run' session, docker ps output shows (briefly) a running container, KiteMatic container list now contains a container based on the lambda:dotnetcore2.1 image;
  • rerunning the same command shows that the existing container is removed and replaced by new one one;
  • running a Debug session again shows the existing container being removed, and no new one being created.

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...

Was this page helpful?
0 / 5 - 0 ratings