Skip to content

Visual Studio Insiders Python debugpy attach to remote process fails to get target process. #8305

@v-balabanov

Description

@v-balabanov

Describe the bug
I can't get remote debugging to work while trying to attach to remote linux container python process via debugpy. Only record shown in Attach to process window is "dummy" one with PID = 54321.

Steps to Reproduce

  1. Have linux docker container with running python process launched with debugpy CLI
  2. Try to attach to process from VS insiders using Python remote, specifying tcp://localhost:5678/.
  3. Refresh list of processes, target doesn't appear.

Expected behavior
At least target process is being shown in list.
At most, threads are shown and breakpoints are working after attach.

Additional context and screenshots
I have VS insiders, Django app running in docker linux contaner, launched with python3 /tmp/debugpy --listen 0.0.0.0:5678 manage.py runserver 0.0.0.0:8000.
When I'm trying to attach to process using Python remote (debugpy) and providing tcp://localhost:5678/ as target, I do not see target process.
The only record there is what I believe dummy one with PID=54321.
When I'm attaching to that one, I don't get threads list (obviously) but no exceptions/messages have been raised.

VSCode can attach just fine, so the port is open and ready to accept connections.

I believe I do have proper mappings because Containers tab content is synced with local workspace.
I do have the very same version of debugpy (1.8.17) -- on remote target, in C:\Program Files\Microsoft Visual Studio\18\Insiders\Common7\IDE\Extensions\Microsoft\Python\Core\debugpy (have updated it), in local and global python envs.
I have checked connection to this port from Dev PS inside VS Insiders and it works (apparently no firewall issues).

What steps could I do next to resolve this issue?

Configuration information
VS Version: Insiders [11111.16]
PTVS version: 17.0.25266.3
Python version: 3.12
Debugger Type (if applicable): New -- debugpy

Diagnostics file
No PythonToolsDiagnostics_*.log file in temp.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions