Giter VIP home page Giter VIP logo

Comments (26)

erm0l0v avatar erm0l0v commented on July 22, 2024 2

Hello I've installed delve via brew.

So in terminal this command works perfect:

dlv debug main.go (no root user)

However I still get error in vscode:

2016/09/14 18:18:36 server.go:71: Using API v1
2016/09/14 18:18:36 debugger.go:61: launching process with args: [./debug]
could not launch process: could not fork/exec

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "remotePath": "",
            "port": 2345,
            "host": "127.0.0.1",
            "program": "${workspaceRoot}",
            "env": {},
            "args": [],
            "showLog": true
        }
    ]
}

dlv version

Delve Debugger
Version: 0.11.0-alpha
Build: v0.11.0

go version

go version go1.7.1 darwin/amd64

from vscode-go.

lukehoban avatar lukehoban commented on July 22, 2024 1

@bruparel Sounds like you are not in the right directory. You need to be in the directory where you cloned https://github.com/derekparker/delve before you run make install.

from vscode-go.

skeleton1231 avatar skeleton1231 commented on July 22, 2024 1

@ramya-rao-a

Thanks!

I solved the problem, here is my step:

  1. brew uninstall delve
    2.delete the keychain for delve
    3.Manual install the delve through the instruction (https://github.com/derekparker/delve/blob/master/Documentation/installation/osx/install.md)

image

from vscode-go.

lukehoban avatar lukehoban commented on July 22, 2024

Yeah - dlv is invoked as a normal user, so if you have signed dlv such that it cannot be used as a normal user it will not work with the VS Code integration currently.

I'm not sure of options for working around this, other than distributing our owned signed binary along with the plugin.

Thoughts?

from vscode-go.

mattetti avatar mattetti commented on July 22, 2024

The first thing might be to not tell users to go get delve on this page: https://marketplace.visualstudio.com/items/lukehoban.Go It looks like the issue I'm encountering is due to the fact that I installed on OS X without noticing that I should be signing the binary. I'm also not getting any errors being reported or logs so it's a bit hard to understand what's wrong. I'll properly reinstall delve and see if it helps :)

from vscode-go.

caledhwa avatar caledhwa commented on July 22, 2024

So, from the delve Wiki:

https://github.com/derekparker/delve/wiki/Building

Installing on Mac OSX, there really doesn't seem to be anything regarding USER here. So, the self-signing cert seemed to work. I wonder what I'd need to do differently to make this work.

Did you try this on Mac OS? Just curious... if others are having this experience. I also agree with @mattetti that I was almost drawn off by the go get.

from vscode-go.

mattetti avatar mattetti commented on July 22, 2024

Alright, so after reinstalling with the cert, everything looks good with the exception of my local variables not showing up (but hovering them in my code displays the values)

from vscode-go.

caledhwa avatar caledhwa commented on July 22, 2024

So, uninstalling delve, what did you do? I feel like I did it right the first time, but then after it didn't work, I did the go get - maybe if I start over with that... @mattetti

from vscode-go.

mattetti avatar mattetti commented on July 22, 2024

@caledhwa I went into the delve repo that I go get'd, created a cert and used make install with the cert info to rebuild and reinstall delve.

from vscode-go.

lukehoban avatar lukehoban commented on July 22, 2024

That's right - the instructions on installing Delve are here: https://github.com/derekparker/delve/wiki/Building. On OS X this requires creating a self-signed cert and then using that to CERT=dlv-cert make install.

I've modified the README to not suggest go get for Delve since that won't work on OS X.

I'll leave this open to track reporting a better error message when a non-signed dlv binary is installed.

from vscode-go.

lukehoban avatar lukehoban commented on July 22, 2024

We're now reporting back the errors from Delve itself, so you'll get the same somewhat cryptic error that Delve provides to tell you that you don't have a signed dlv:

2015/11/21 18:51:15 debugger.go:56: launching process with args: [./debug]
could not launch process: could not fork/exec

That will be enough to easily search for the issue. I'll leave communicating this failure case more explicitly to Delve itself for now.

from vscode-go.

caledhwa avatar caledhwa commented on July 22, 2024

Thanks for this! 👍 I just need to figure out what I did wrong when I signed Delve.

from vscode-go.

lukehoban avatar lukehoban commented on July 22, 2024

FWIW - The most common issue I've seen has been accidentally missing this step:

In keychains select “System”, and you should find your new certificate. Use the context menu for the certificate, select “Get Info”, open the “Trust” item, and set “Code Signing” to “Always Trust”.

from vscode-go.

shdatta avatar shdatta commented on July 22, 2024

I also got some errors while building delve. I had to do following to get additional packages and depenecies..(on Mac)
go get github.com/peterh/liner
go get github.com/spf13/cobra
go get gopkg.in/yaml.v1
go get golang.org/x/sys/unix
go get gopkg.in/yaml.v2

Then CERT=dlv-cert make install worked and I am able to debug the programs.

Looks like there are still some issues with adding variables to watch window ( or may be its user error). But glad to have gotten so far

from vscode-go.

bruparel avatar bruparel commented on July 22, 2024

I am new to Go and Delve both, therefore, I am sure I am doing something wrong. I am on a Mac using OS X. I followed Derek's instructions for 'Building'. The last bullet item says:

Run the following: CERT=dlv-cert make install, which will install the binary and codesign it.

Which binary are we installing? When I ran the command at the command prompt in my home directory, I get the following response:

Bharat:~
→ CERT=dlv-cert make install
make: *** No rule to make target `install'. Stop.

I named my cert 'dlv-cert'.

Please help.

from vscode-go.

bruparel avatar bruparel commented on July 22, 2024

@lukehoban Thank you. That worked.

from vscode-go.

ameykpatil avatar ameykpatil commented on July 22, 2024

@erm0l0v I am facing an exact same issue, did you able to solve it?

from vscode-go.

ThreeBearsDan avatar ThreeBearsDan commented on July 22, 2024

@erm0l0v I encounter this problem, too. dlv can work under terminal, but doesn't work under IDE vscode. help!

from vscode-go.

danbricedatascience avatar danbricedatascience commented on July 22, 2024

Same issue.

2016/12/26 22:44:41 debugger.go:55: launching process with args: [./debug]
2016/12/26 22:44:42 server.go:301: method Run has wrong number of ins: 1
2016/12/26 22:44:42 server.go:301: method Stop has wrong number of ins: 2
2016/12/26 22:44:42 debugger.go:239: continuing
Hello World!
101

When running a very simple Hello World. Breakpoints are "bypassed" and the program simply complete like if it is not in debug mode.

It perfectly works with dlv command line.

I'm on MacOSX 10.11.6, delve is installed from homebrew - certificate is well created.

Simple Hello World program used.

package main

import "fmt"

func main() {
	fmt.Println("Hello World!")
	i := 101   // Where I put the breakpoint
	fmt.Println(i)
}

from vscode-go.

ramya-rao-a avatar ramya-rao-a commented on July 22, 2024

@roblourens can you take a look at this?

from vscode-go.

roblourens avatar roblourens commented on July 22, 2024

This seems kind of far from the original issue so hopefully I'm not missing a thread. @erm0l0v that error message could not launch process: could not fork/exec would probably be coming from your code, so I don't know why it would be working via command line but not vscode. Could that be the case?

@ThreeBearsDan Do you see that exact error message or do you just share the issue that it works via CLI but not vscode? Can you post the console output?

@danbricedatascience What's your delve version? That was a delve bug at some point at least - https://github.com/derekparker/delve/issues/378

from vscode-go.

erm0l0v avatar erm0l0v commented on July 22, 2024

@roblourens Currently debug works for me well. Problem was in certificate.

During first debug session OS ask me about root password and after filling password debug starts working in console but not in vs-code. This confused me and I am complained this problem.

@ThreeBearsDan @danbricedatascience Please try to restart system and run debug if OS ask you about root password - that mean that you have some issue with certificate (as I understand).

I did several steps to fix this problem and don't remeber which of the helped me. Probably it was manual installation of delve

from vscode-go.

danbricedatascience avatar danbricedatascience commented on July 22, 2024

@roblourens Version: 0.11.0-alpha

@erm0l0v Restart MacOS X does not change anything.

I will try manual installation of delve instead of brew.

from vscode-go.

skeleton1231 avatar skeleton1231 commented on July 22, 2024

I have the same problem
work well on Terminal

image

but still fail on vscode

image

anyone help?
I use brew install delve

from vscode-go.

ThreeBearsDan avatar ThreeBearsDan commented on July 22, 2024

@roblourens I am sorry for late reply. That work well now. I do nothing, just upgrade vsnode to Version 1.7.1. So I think it must be something wrong with vscode.
@erm0l0v Thank u. It's not the issue with certificate. I think it's the issue with vscode. I just upgrade vscode and it work well.
image

from vscode-go.

ramya-rao-a avatar ramya-rao-a commented on July 22, 2024

@skeleton1231. @ameykpatil Let's use #717 to track the issue where you get the error

server.go:71: Using API v1
debugger.go:61: launching process with args: [./debug]
could not launch process: could not fork/exec

This is coming from delve it self and #717 is tracking this.

@erm0l0v @ThreeBearsDan Glad to hear that you are unblocked now.

Anyone else coming to this thread with the same error as above, please see #717 , #269 and https://github.com/derekparker/delve/issues/357

from vscode-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.