Skip to content

VS Code does not correctly attach to UNIX domain socket #473

@Neighborkid01

Description

@Neighborkid01

I am running my rails server with the command rdbg -n -c --open=vscode -- rails s and it will open VS Code but running the attach configuration will result in the error "Can not find attachable Ruby process." and if I run rdbg --util=list-socks I see nothing even though in the server output it specifies a port to listen on.

$ rdbg -n -c --open=vscode -- rails s
DEBUGGER: Debugger can attach via UNIX domain socket (/var/folders/k4/lsrtl0y55718pst90df0ldzh0000gn/T/com.apple.shortcuts.mac-helper/rdbg-501/rdbg-72212)
Launching: code /Users/executor/Documents/GitHub/VideoConnect/
=> Booting Puma
=> Rails 7.0.7.2 application starting in development
...

If I run rdbg -n -c -O -- rails s, then I see two log lines from the server specifying the UDS port and running rdbg --util=list-socks returns the port as expected. If I open VS Code and try to attach to the debugger again with the default config, I get the same error, but if I manually specify the debugPort to be the one from the console output, it is able to connect correctly and everything works as expected.

$ rdbg -n -c -O -- rails s
DEBUGGER: Debugger can attach via UNIX domain socket (/var/folders/k4/lsrtl0y55718pst90df0ldzh0000gn/T/com.apple.shortcuts.mac-helper/rdbg-501/rdbg-72755)
DEBUGGER: Debugger can attach via UNIX domain socket (/var/folders/k4/lsrtl0y55718pst90df0ldzh0000gn/T/com.apple.shortcuts.mac-helper/rdbg-501/rdbg-72755)
=> Booting Puma
=> Rails 7.0.7.2 application starting in development 
...
{
    "type": "rdbg",
    "name": "Attach with rdbg",
    "request": "attach",
    "debugPort": "/var/folders/k4/lsrtl0y55718pst90df0ldzh0000gn/T/com.apple.shortcuts.mac-helper/rdbg-501/rdbg-71078",
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions