coder/code-server

go extension

xingzhao0401 opened this issue · 12 comments

  • 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

have you run chown on your go directory yet?

have you run chown on your go directory yet?

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

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?

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

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

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.

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.

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

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.

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

#821 is ready for review, @deansheather

@morningspace 3q,The problem is solved