Skip to content

debugpy attach request connect with No Config debugging #625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ollie-bell opened this issue Feb 21, 2025 · 2 comments
Closed

debugpy attach request connect with No Config debugging #625

ollie-bell opened this issue Feb 21, 2025 · 2 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@ollie-bell
Copy link

ollie-bell commented Feb 21, 2025

I have a launch.json configuration:

{
    "name": "Python Debugger: Attach",
    "type": "debugpy",
    "request": "attach",
    "connect": {
        "host": "localhost",
        "port": 5678
    },
    "pathMappings": [
        {
            "localRoot": "${workspaceFolder}",
            "remoteRoot": "."
        }
    ],
}

This works fine with vscode python debugging tools... but what debugpy command actually gets run when this configuration is used? Is it possible to use the new No-Config Debugging instead of this launch.json configuration?

I've tried debugpy --connect localhost:5678 but I get

Error: invalid --connect <address>: --listen and --connect are mutually exclusive

when using debugpy shipped with the vscode extension (i.e. I haven't installed debugpy manually in my venv).

For context, I am connecting to a container which has a (simplified) Dockerfile:

FROM python:3.12-slim

RUN pip install "uvicorn[standard]" fastapi
RUN pip install debugpy -t /tmp

WORKDIR /app
COPY app.py .

ENTRYPOINT exec python -X frozen_modules=off \
    /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -m \
    uvicorn app:app --host 0.0.0.0 --port 8080
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 21, 2025
@ollie-bell ollie-bell changed the title debugpy command equivalent to launch.json configuration debugpy attach request connect with No Config debugging Feb 21, 2025
@eleanorjboyd
Copy link
Member

Hi! To check my understanding you are looking to use the no-config debugging in your launch.json? Right now for launch.json configs the command should be printed in your logs with the full arguments.

For no-config debugging you can use it now from your terminal so in your integrated terminal running debugpy _____ should work.

And where are you trying debugpy --connect localhost:5678? In your terminal?

@eleanorjboyd eleanorjboyd added the info-needed Issue requires more information from poster label Feb 24, 2025
@eleanorjboyd eleanorjboyd self-assigned this Feb 24, 2025
Copy link

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

Happy Coding!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants