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

go extension #725

Closed
xingzhao0401 opened this issue May 28, 2019 · 12 comments
Closed

go extension #725

xingzhao0401 opened this issue May 28, 2019 · 12 comments

Comments

@xingzhao0401
Copy link

xingzhao0401 commented May 28, 2019

  • code-server version: 1.1119-vsc1.33.1
  • OS Version: docker
  • Extension: Go 0.10.2

Description

type 'F5' debug golang project,error info :
API server listening at: 127.0.0.1:2345 2019-05-28T06:56:31Z info layer=debugger launching process with args: [/home/coder/project/src/github.com/yudai/gotty/debug] could not launch process: fork/exec /home/coder/project/src/github.com/yudai/gotty/debug: operation not permitted Process exiting with code: 1

View the actual compilation command with the "top" command:go build -o /home/coder/project/src/github.com/yudai/gotty/debug -gcflags all=-N -l github.com/yudai/gotty

How to modify the configuration can change the actual compilation command to:go build -o /home/coder/project/src/github.com/yudai/gotty/debug -gcflags "all=-N -l" github.com/yudai/gotty

@teddy-codes
Copy link

have you run chown on your go directory yet?

@xingzhao0401
Copy link
Author

have you run chown on your go directory yet?

no,containers are started with root accounts,does it matter?

@teddy-codes
Copy link

I don't think that the root user matters in this case. Are you the second user on your computer?

Can you try sudo chmod g+rw /home/coder/project within the container and tell me if that fixes this?

@xingzhao0401
Copy link
Author

xingzhao0401 commented May 29, 2019

I don't think that the root user matters in this case. Are you the second user on your computer?

Can you try sudo chmod g+rw /home/coder/project within the container and tell me if that fixes this?

have no effect

@morningspace
Copy link
Contributor

morningspace commented Jun 19, 2019

This appears to be a common issue? I see very similar error:

API server listening at: 127.0.0.1:25433
could not launch process: fork/exec /home/coder/project/__debug_bin: operation not permitted
Process exiting with code: 1

What I'm using:

  • code-server version: 1.1156-vsc1.33.1
  • OS Version: Ubuntu 18.04.2 LTS
  • Microsoft Go Extension: 0.10.2

@xingzhao0401 @roberthmiller

@teddy-codes
Copy link

I think this is actually a common issue because of perms. Not entirely sure what the fix would be though since I am not too familiar with the codebase.

@xingzhao0401
Copy link
Author

I saw that the compilation command error caused no executable file to be generated,Correct parameter'-N-l'missing' symbol.Maybe there's something wrong with the interaction when program calls the plug-in.

@morningspace
Copy link
Contributor

morningspace commented Jul 1, 2019

Hey, a quick update, after add --privileged, everything works perfect... I can debug now!

Then, I found a similar issue who reported in dlv which is exactly what I need.

So, I think the recommended solution for this at the moment is that, we need to add --security-opt seccomp=unconfined when launch the container. It's better than using --privileged since it's more fine-grained.

I think this is not an issue of code-server, but instead something related to either dlv or docker. To me, it seems nothing could be done by code-server to address this issue. So, maybe we are happy to close it now...

On the other hand, maybe it's not something officially recommended, but at least for local dev, it looks good to use this option. I'd think we should update docs somewhere in this repo to reflect this, so that others could be benefit as well. :-)

@xingzhao0401 @roberthmiller

@deansheather
Copy link
Member

It's unfourtunate that this is the case, but it looks like there's nothing we can do except document it. I believe the only place we provide instructions for running code-server within Docker is in the README, so maybe we should put it in the known issues section and link to this issue.

PRs are welcome.

@morningspace
Copy link
Contributor

Awesome, I'd be happy to submit a PR for this since it's just doc change...

@morningspace
Copy link
Contributor

#821 is ready for review, @deansheather

@xingzhao0401
Copy link
Author

@morningspace 3q,The problem is solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants