microsoft/vscode-python

Unverified breakpoint when attaching to process in docker container

nrempel opened this issue · 5 comments

Environment data

  • VS Code version: 1.23.0
  • Extension version (available under the Extensions sidebar): 2018.4.0
  • OS and version: macOS 10.13.4
  • Python version (& distribution if applicable, e.g. Anaconda):
    Python 3.6.5 (default, Apr 25 2018, 14:23:58) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]
  • Type of virtual environment used: Docker
  • Relevant/affected Python packages and their versions: Python - 2018.4.0

Actual behavior

All breakpoints are marked as 'unverified breakpoint'. Unable to set breakpoints or step through code.

Expected behavior

Ability to set breakpoints and step through code.

Steps to reproduce:

  1. Follow steps here to create a reproducible environment: https://github.com/DonJayamanne/vscode-python-samples/tree/master/remote-debugging-docker-django

  2. Set a breakpoint here: https://github.com/DonJayamanne/vscode-python-samples/blob/master/remote-debugging-docker-django/home/views.py#L10

  3. navigate to localhost:8000 to trigger breakpoint

  4. The code breaks on base.py:126 inside of the django library instead of in views.py.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

##########Linting Output - pylint##########
No config file found, using default configuration

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

Nothing

@nrempel
Please could you try this with the experimental debugger:

  • pip install ptvsd --pre
  • Use ptvsd.enable_attach(address) instead of ptvsd.enable_attach('my_secret', address)
    Remove the my_secret argument value.
  • Attach using the experimental debugger (basically all you need to do is change "type":"python" to "type":"pythonExperimental" in your launch.json

Please let me know how that goes.

Thanks @DonJayamanne I'll try and test this in the next couple days.

@nrempel Have you had a chance to test this once again with the experimental debugger?

Hi @DonJayamanne, sorry I've been caught up with work.

I got things working with the experimental debugger, but still ran into a couple issues.

I'll put together an example case that demonstrates it as soon as possible.

Thanks!

I'll close this issue for now, please create a separate issue (s) for the new issues you have come across. Thanks