Skip to content
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

debug: connecting to dlv-dap results in connection error #1270

Closed
suzmue opened this issue Mar 4, 2021 · 5 comments
Closed

debug: connecting to dlv-dap results in connection error #1270

suzmue opened this issue Mar 4, 2021 · 5 comments
Assignees
Labels
Debug Issues related to the debugging functionality of the extension. FrozenDueToAge
Milestone

Comments

@suzmue
Copy link
Contributor

suzmue commented Mar 4, 2021

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

  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.16 darwin/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.53.2
  • Check your installed extensions to get the version of the VS Code Go extension
    • Go Nightly

Describe the bug

{
            "name": "Launch Program",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": "${workspaceFolder}",
            "debugAdapter": "dlv-dap"
 }

Steps to reproduce the behavior:

  1. Reinstall dlv
  2. Click on 'Launch Program'
  3. See error

Screen Shot 2021-03-04 at 11 02 25 AM

This appears to be a timing related issue, since it does not happen often. This needs a better error message and/or a second attempt to connect.

@suzmue suzmue added the Debug Issues related to the debugging functionality of the extension. label Mar 4, 2021
@suzmue suzmue self-assigned this Mar 4, 2021
@hyangah hyangah added the DlvDAP label Mar 4, 2021
@polinasok
Copy link
Contributor

This happens when the server is not up and ready to listen. Do we have a sufficient delay in the factory? I think there used to be a start-up delay in the old adapter as well.

@polinasok
Copy link
Contributor

The error message is coming from the editor. I don't know how to control it.

@suzmue
Copy link
Contributor Author

suzmue commented Mar 8, 2021

There was a delay but it was not sufficient. Once @hyangah's change for redirecting stdout and stderr from dlv dap is in, I have a change that will wait for the "DAP serving listening at" message before returning the server info to vscode.

@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/300071 mentions this issue: src/goDebugFactory: wait for dlv dap server to start in factory

@hyangah hyangah added this to the v0.23.1 milestone Mar 10, 2021
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/300609 mentions this issue: [release] src/goDebugFactory: wait for dlv dap server to start in factory

gopherbot pushed a commit that referenced this issue Mar 10, 2021
…tory

When we start dlv dap, we want to make sure it has started before
sending the info back to vscode so it will be able to connect.
Wait for the 'DAP server listening at' message before returning the
host. Display the error for the user otherwise.

Fixes #1270

Change-Id: Id710b67ceaa87b1f6dff84d8108ac61dfbe15707
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/300071
Trust: Suzy Mueller <[email protected]>
Run-TryBot: Suzy Mueller <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/300609
Trust: Hyang-Ah Hana Kim <[email protected]>
@golang golang locked and limited conversation to collaborators Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Debug Issues related to the debugging functionality of the extension. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

4 participants