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

Comments

@xingzhao0401
Copy link

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

@roberthmiller

This comment has been minimized.

Copy link

commented May 28, 2019

have you run chown on your go directory yet?

@xingzhao0401

This comment has been minimized.

Copy link
Author

commented May 28, 2019

have you run chown on your go directory yet?

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

@roberthmiller

This comment has been minimized.

Copy link

commented May 28, 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?

@xingzhao0401

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Contributor

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

@roberthmiller

This comment has been minimized.

Copy link

commented Jun 20, 2019

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

This comment has been minimized.

Copy link
Author

commented Jun 20, 2019

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

commented Jul 1, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

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

@morningspace

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

#821 is ready for review, @deansheather

@xingzhao0401

This comment has been minimized.

Copy link
Author

commented Jul 3, 2019

@morningspace 3q,The problem is solved

@code-asher code-asher closed this Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.