Skip to content

Cannot launch debugger after update to vscode 1.123.0 #4039

Description

@kmpm

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.26.4 windows/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • golang.org/x/tools/gopls v0.22.0
      golang.org/x/tools/gopls@v0.22.0 h1:9aON2mTxKrZ1y71RbQVnlPTTNfKZ9y5cv3x/f6XpsZw=
      github.com/BurntSushi/toml@v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
      github.com/fatih/camelcase@v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
      github.com/fatih/gomodifytags@v1.17.1-0.20250423142747-f3939df9aa3c h1:dDSgAjoOMp8da3egfz0t2S+t8RGOpEmEXZubcGuc0Bg=
      github.com/fatih/structtag@v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
      github.com/fsnotify/fsnotify@v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
      github.com/google/go-cmp@v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
      github.com/google/jsonschema-go@v0.4.2 h1:tmrUohrwoLZZS/P3x7ex0WAVknEkBZM46iALbcqoRA8=
      github.com/modelcontextprotocol/go-sdk@v1.4.0 h1:u0kr8lbJc1oBcawK7Df+/ajNMpIDFE41OEPxdeTLOn8=
      github.com/segmentio/asm@v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
      github.com/segmentio/encoding@v0.5.3 h1:OjMgICtcSFuNvQCdwqMCv9Tg7lEOXGwm1J5RPQccx6w=
      github.com/yosida95/uritemplate/v3@v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
      golang.org/x/exp/typeparams@v0.0.0-20260312153236-7ab1446f8b90 h1:cfW8UCYSVdPblxA7qQe3o5Iad55Vsx4BFmuGS9RNOmc=
      golang.org/x/mod@v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM=
      golang.org/x/oauth2@v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
      golang.org/x/sync@v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
      golang.org/x/sys@v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
      golang.org/x/telemetry@v0.0.0-20260409153401-be6f6cb8b1fa h1:efT73AJZfAAUV7SOip6pWGkwJDzIGiKBZGVzHYa+ve4=
      golang.org/x/text@v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
      golang.org/x/tools@v0.44.1-0.20260513175300-635ae9663724 h1:rz7KAMVmPA+7ecCT/BHKLE353MUOoCAwMqlUveE8508=
      golang.org/x/vuln@v1.1.4 h1:Ju8QsuyhX3Hk8ma3CesTbO8vfJD9EvUBgHvkxHBzj0I=
      honnef.co/go/tools@v0.7.0 h1:w6WUp1VbkqPEgLz4rkBzH/CSU6HkoqNLp6GstyTx3lU=
      mvdan.cc/gofumpt@v0.9.2 h1:zsEMWL8SVKGHNztrx6uZrXdp7AX8r421Vvp23sz7ik4=
      mvdan.cc/xurls/v2@v2.6.0 h1:3NTZpeTxYVWNSokW3MKeyVkz/j7uYXYiMtXRUfmjbgI=
      go: go1.26.4
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.123.0
      6a44c352bd24569c417e530095901b649960f9f8
      x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.52.2
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
    • Tools Configuration

Environment

GOBIN: undefined
toolsGopath:
gopath: C:\Users\peter\go
GOROOT: C:\Program Files\Go
PATH:

Tools

go:	C:\Program Files\Go\bin\go.exe: go version go1.26.4 windows/amd64

gotests:	C:\Users\peter\go\bin\gotests.exe	(version: v1.6.0 built with go: go1.26.4)
impl:	C:\Users\peter\go\bin\impl.exe	(version: v1.4.0 built with go: go1.26.4)
goplay:	C:\Users\peter\go\bin\goplay.exe	(version: v1.0.0 built with go: go1.26.4)
dlv:	C:\Users\peter\go\bin\dlv.exe	(version: v1.26.3 built with go: go1.26.4)
gopls:	C:\Users\peter\go\bin\gopls.exe	(version: v0.22.0 built with go: go1.26.4)

Go env

Workspace Folder (libdns-loopia): d:\Code\GH\kmpm\caddystuff\libdns-loopia

set AR=ar
set CC=gcc
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_ENABLED=0
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set CXX=g++
set GCCGO=gccgo
set GO111MODULE=
set GOAMD64=v1
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=C:\Users\peter\AppData\Local\go-build
set GOCACHEPROG=
set GODEBUG=
set GOENV=C:\Users\peter\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFIPS140=off
set GOFLAGS=
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\peter\AppData\Local\Temp\go-build693826569=/tmp/go-build -gno-record-gcc-switches
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMOD=d:\Code\GH\kmpm\caddystuff\libdns-loopia\go.mod
set GOMODCACHE=C:\Users\peter\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\peter\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\peter\AppData\Roaming\go\telemetry
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.26.4
set GOWORK=
set PKG_CONFIG=pkg-config

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

{
  "[go]": {
        "editor.insertSpaces": false,
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": "explicit"
        },
        "editor.suggest.snippetsPreventQuickSuggestions": false
    }
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${fileDirname}",
            "envFile": "${workspaceFolder}/.env",
        }
    ]
}

Describe the bug

Trying to debug any go code in windows fails with a message box saying
couldn't start dlv dap: connection timeout where I can choose to edit launch.json or cancel.
This started to happen after update to vscode 1.123.0 but I also updated to go from 1.26.4 from 1.26.3 in the same time period so that might affect.

Debuging on the same computer but in a devcontainer works but nothing in plain Windows 11 that worked before.

  • I have reinstalled the extension, several times.
  • I'v disabled firewall without any difference.
  • I can see that dlv.exe launches in the debug console and I can seen that the process keeps runing in Windows Activity Monitor. And it lauches fairly fast, <5 sec.
Starting: C:\Users\peter\go\bin\dlv.exe dap --listen=127.0.0.1:20300 from D:\Code\GH\kmpm\caddystuff\libdns-loopia\.vscode
DAP server listening at: 127.0.0.1:20300

Steps to reproduce the behavior:

  1. Go to the go file that you want to launch/debug
  2. Press F5 for Start Debugging
  3. See error couldn't start dlv dap: connection timeout

Screenshots or recordings

If applicable, add screenshots or recordings to help explain your problem.

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions