code-server icon indicating copy to clipboard operation
code-server copied to clipboard

Cannot get debugging to work for any language (Python / Javascript)

Open rohan-dave opened this issue 7 years ago • 11 comments

I am currently running Coder through a docker container on my local machine and I would like to debug Python in it.

Here are the steps I took:

  1. Installed the ms-python Python extension through the marketplace.
  2. Installed the Python language through the terminal in the IDE via apt-get command.
  3. Click on "Start without Debugging" or "Debugging" for a simple Hello World program.

The IDE throws an errors as below: "events.js:183 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE 0.0.0.0:8443 at u.setupListenHandle [as _listen2] (net.js:1360:14) at listenInCluster (net.js:1401:12) at doListen (net.js:1510:7) at _combinedTickCallback (internal/process/next_tick.js:142:11) at process._tickCallback (internal/process/next_tick.js:181:9)events.js:183 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE 0.0.0.0:8443 at u.setupListenHandle [as _listen2] (net.js:1360:14) at listenInCluster (net.js:1401:12) at doListen (net.js:1510:7) at _combinedTickCallback (internal/process/next_tick.js:142:11) at process._tickCallback (internal/process/next_tick.js:181:9) "

The same error occurs with Javascript as well.

rohan-dave avatar Mar 12 '19 18:03 rohan-dave

Interesting. Seems to be attempting to bind on port 8443. Can you try running code-server on a different port?

kylecarbs avatar Mar 12 '19 18:03 kylecarbs

@kylecarbs Still getting the same error even though I am running it on port 9000 locally. Here's the docker run command:

docker run -p 127.0.0.1:9000:8443 -v "/Users/rdave/ide:/root/project" codercom/code-server code-server --allow-http --no-auth

rohan-dave avatar Mar 12 '19 18:03 rohan-dave

does it happen if you used 0.0.0.0 instead of 127.0.0.1? @rohan-dave

Edit Nevermind, saw your host IP in the original post

nol166 avatar Mar 12 '19 22:03 nol166

Run binary on my Mac and Linux, debug Python work fine, but debug node.js and golang not working. Both work fine with local vscode, but nothing get from code-server.

zigego avatar Mar 13 '19 16:03 zigego

I also cant get Node.js to debug in editor. I've tried on 3 different servers now (Debian 8, Ubuntu 16.10, Ubuntu 18.04) and all three just wont debug.

There is no error message given in terminal either. It just pops up the small debug control panel for a second then the panel disappears and nothing happens.

I can run node --inspect in the built in terminal but cant attach to vscode even with Debug > Node: Auto Attach enabled in settings.

I dont know if this might apply to this issue but I do get this error pretty much immediately after starting code-server on all three servers, even on a fresh setup with no projects opened: ERROR SHARED stderr {"data":"Uncaught Exception: Error: Unexpected end of JSON input\n\nSyntaxError: Unexpected end of JSON input\n at JSON.parse (<anonymous>)\n at pfs_1.readFile.then.contents (eval at exports.requireModule (/home/{{USR}}/vscode/code-server-1.32.0-245-linux-x64/code-server:468:27660), <anonymous>:77277:45)\n at <anonymous>\n at Timeout.setTimeout [as _onTimeout] (eval at exports.requireModule (/home/{{USR}}/vscode/code-server-1.32.0-245-linux-x64/code-server:468:27660), <anonymous>:52540:31)\n at ontimeout (timers.js:498:11)\n at tryOnTimeout (timers.js:323:5)\n at Timer.listOnTimeout (timers.js:290:5)\n"} #121

bdodroid avatar Mar 13 '19 20:03 bdodroid

I've noticed this behavior as well. I changed the running port of code-server to 8440 and while this removes the Error: listen EADDRINUSE 0.0.0.0:8443 errors observed earlier, now I just get an infinitely running blue bar sliding left to right at the top of the Debug sidebar.

Other aspects such as code completion work and I can run dlv (for context, this is Go) from the terminal. There doesn't appear to be any output regarding errors that I can find.

davefinster avatar Mar 14 '19 05:03 davefinster

Fixed with the latest release 1.32.0-310!

kylecarbs avatar Mar 19 '19 17:03 kylecarbs

image

@kylecarbs New release does not work.

jeasonstudio avatar Mar 20 '19 09:03 jeasonstudio

Hm. Will investigate.

kylecarbs avatar Mar 20 '19 13:03 kylecarbs

Related: https://github.com/codercom/code-server/issues/301. Found the issue. Fix will come out shortly.

kylecarbs avatar Mar 20 '19 14:03 kylecarbs

Fixed with the latest release.

kylecarbs avatar Mar 27 '19 02:03 kylecarbs