Code-server: Crash on Debian 8

Created on 7 Mar 2019  Â·  27Comments  Â·  Source: cdr/code-server

  • code-server version: 1.31.1-100
  • OS Version: debian 8
$ uname -a
Linux iZ28iwnpx2bZ 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) x86_64 GNU/Linux

$ cat /etc/debian_version
8.11

Steps to Reproduce

error message:

$ ./code-server -d /home/zoe/codes/vscode-workdir -h 127.0.0.1 -p 60443 --allow-http
INFO  code-server v1.31.1-100
INFO  Additional documentation: http://github.com/codercom/code-server
INFO  Initializing {"data-dir":"/home/zoe/codes/vscode-workdir","working-dir":"/home/zoe/codes/vscode-workdir/code-server-1.31.1-100-linux-x64","log-dir":"/home/zoe/codes/vscode-workdir/logs/20190307051426515"}
INFO  Starting shared process [1/5]...
INFO  Starting webserver... {"host":"127.0.0.1","port":60443}
WARN  No certificate specified. This could be insecure.
WARN  Documentation on securing your setup: https://coder.com/docs
INFO
INFO  Password: e9eb8d0a4d8c913247d49cc0
INFO
INFO  Started (click the link below to open):
INFO  http://localhost:60443/
INFO
INFO  Connected to shared process
ERROR SHARED stderr {"data":"Uncaught Exception:  Error: ENOENT: no such file or directory, open '/home/zoe/codes/vscode-workdir/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/home/zoe/codes/vscode-workdir/Backups/workspaces.json'\n    at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/home/zoe/codes/vscode-workdir/code-server-1.31.1-100-linux-x64/code-server:468:27371), <anonymous>:71445:31)\n    at ontimeout (timers.js:475:11)\n    at tryOnTimeout (timers.js:310:5)\n    at Timer.listOnTimeout (timers.js:270:5)\n"}
INFO  WebSocket opened / {"client":1,"ip":"127.0.0.1"}
INFO  Created data directory
internal/child_process.js:323
    throw errnoException(err, 'spawn');
    ^

Error: spawn ENOMEM
    at _errnoException (util.js:1024:11)
    at ChildProcess.spawn (internal/child_process.js:323:11)
    at Object.exports.spawn [as _spawn] (child_process.js:502:9)
    at t.async (/home/zoe/codes/vscode-workdir/code-server-1.31.1-100-linux-x64/code-server:716:35021)
    at e.exports (/home/zoe/codes/vscode-workdir/code-server-1.31.1-100-linux-x64/code-server:716:34522)
    at e (/home/zoe/codes/vscode-workdir/code-server-1.31.1-100-linux-x64/code-server:716:33324)
    at Timeout.c [as _onTimeout] (/home/zoe/codes/vscode-workdir/code-server-1.31.1-100-linux-x64/code-server:716:33617)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)
bug needs-investigation

Most helpful comment

I've got it working now by creating Backups/workspaces.json manually in the workdir directory with the following content:

{"rootWorkspaces":[],"folderURIWorkspaces":[],"emptyWorkspaceInfos":[],"emptyWorkspaces":[]}

And then creating the folder {workdir}/User/workspaceStorage.

All 27 comments

Seems like you're out of memory.

Similar crash on centos 7 machine with 1 cpu core and 2G ram:

INFO  Started (click the link below to open):
INFO  http://localhost:8443/
INFO
INFO  Starting shared process [1/5]...
INFO  Connected to shared process

ERROR SHARED stderr {"data":"Uncaught Exception:  Error: ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json'

Error: ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json'
    at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/root/installers/code-server-1.31.0-20-x86_64-linux/code-server:468:27371), <anonymous>:71434:31)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)
"}

And the process hangs here, no spawn like error shows up.
So I doubt that it may related to other issues rather than memory.

Exactly the same crash on ubuntu 16.04 machine with 8 cpu core and 48G ram, this might not be caused by out of memory.

Same problem on Debian 9.

INFO  Started (click the link below to open):
INFO  http://localhost:8443/
INFO   
INFO  Starting shared process [1/5]...
INFO  Connected to shared process
ERROR SHARED stderr {"data":"Uncaught Exception:  Error: ENOENT: no such file or directory, open '/home/jerodev/.code-server/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/home/jerodev/.code-server/Backups/workspaces.json'\n    at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/home/jerodev/codercom/code-server:468:27371), <anonymous>:71445:31)\n    at ontimeout (timers.js:475:11)\n    at tryOnTimeout (timers.js:310:5)\n    at Timer.listOnTimeout (timers.js:270:5)\n"}

I've got it working now by creating Backups/workspaces.json manually in the workdir directory with the following content:

{"rootWorkspaces":[],"folderURIWorkspaces":[],"emptyWorkspaceInfos":[],"emptyWorkspaces":[]}

And then creating the folder {workdir}/User/workspaceStorage.

@jerodev This works for me, thanks!
But from my experience, it should be {data-dir}/User/workspaceStorage

Interesting. Will investigate.

Posting mine too maybe it help. OS: fresh installation of Debian 9 64 bit
Running it as Root

INFO  Started (click the link below to open):
INFO  http://localhost:443/
INFO
INFO  Starting shared process [1/5]...
INFO  Connected to shared process
INFO  WebSocket opened / {"client":1,"ip":"XXXXXXXX"}
INFO  Created data directory
internal/child_process.js:323
    throw errnoException(err, 'spawn');
    ^

Error: spawn ENOMEM
    at _errnoException (util.js:1024:11)
    at ChildProcess.spawn (internal/child_process.js:323:11)
    at Object.exports.spawn [as _spawn] (child_process.js:502:9)
    at t.async (/root/code-server/code-server:716:35021)
    at e.exports (/root/code-server/code-server:716:34522)
    at e (/root/code-server/code-server:716:33324)
    at Timeout.c [as _onTimeout] (/root/code-server/code-server:716:33617)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)

How much memory do you have available when getting this error?

With a 2gb vps, 1 gb remain avaible and code-server process still working, while the interface return ERR_CONNECTION_REFUSED.
I keep code-server running with Screen

I get no error while starting it on Ubuntu 18.04 but the browser loads endlessly.

Which version are you running on @NiklasMerz ?

When I look at process running with htop, code-server appear pretty strange, the commands calling code-server are like ∞ length.

Could you post a snippet of one @zk-g ?

I m figuring out how to copy the full htop command string, whit Shift I just can copy what I see on screen

Which version are you running on @NiklasMerz ?

The latest Version of the Code-Server binary . In an Ubuntu 18.04 LXC container

Is there any kind of verbose mode? I will try it on another machine.

I didn't figure out how to copy the full string I ll just post the first part and a middle part
/root/code-server/code-server --bootstrap-fork vs/workbench/services/extensions/node/extensionHostProcess --args ["--type=extensionHost"] --env {" ":"/root/code-server/code-server"STY":"32514.code-server","SSH_CONNECTION":"XXX.XXX.XXX.XX 50263 XXX.XXX.XXX.XX 22","LANG":"en_US.UTF-8","OLDPWD":"/root","USER":"root","PWD":"E[19~:k9=\\E[20~:k;=\\E[21~:F1=\\E[23~:F2=\\E[24~:\\\n\t:F3=\\E[1;2P:F4=\\E[1;2Q:F5=\\E[1;2R:F6=\\E[1;2S:\\\n\t:F7=\\E[15;2~:F8=\\E[17;2~:F9=\\E[18;2~:FA=\\E[19;2~:\\\n\t:FB=\\E[20; --> then it keep like that

@zk-g I wonder if this could be a Screen issue? Could you try running it without screen?

@NiklasMerz you can export LOG_LEVEL to debug and it'll provide verbose output.

@zk-g that command appears to be _mostly_ correct. The PWD looks odd. Does it work for you?

I get this exact same error only when trying to run Debug->Start Debugging from the VScode menu for a node.js project.

Now I killed the screen but when running htop I still can see all code-server process running.
I started code-server without the screen with the command
./code-server --password=XXX --cert /etc/letsencrypt/live/XXX/cert.pem --cert-key /etc/letsencrypt/live/XXX/privkey.pem -d /home/vscode -p 443
and i got the same error:
Error: spawn ENOMEM at _errnoException (util.js:1024:11) at ChildProcess.spawn (internal/child_process.js:323:11) at Object.exports.spawn [as _spawn] (child_process.js:502:9) at t.async (/root/code-server/code-server:716:35021) at e.exports (/root/code-server/code-server:716:34522) at e (/root/code-server/code-server:716:33324) at Timeout.c [as _onTimeout] (/root/code-server/code-server:716:33617) at ontimeout (timers.js:475:11) at tryOnTimeout (timers.js:310:5) at Timer.listOnTimeout (timers.js:270:5)
While the interface return the error "Lost connection to socket. Retrying in Xs."

After that all the code-server process on htop are still running and using around 800MB of ram.
Now I restart the vps and try again.

@zk-g are you still getting the weird super long code-server in htop?

@NiklasMerz you can export LOG_LEVEL to debug and it'll provide verbose output.

Thanks but still no error. Just a high CPU load and no response in the browser. It is stuck at

INFO Starting shared process [1/5]...

EDIT:
It works on my client machine (Mint). Maybe something strange with the server. I have to do more tests.

Yes, but for be sure It s not still a screen bug related I ll try restart the vps and I try again
Tomorrow

Update: After restarting and starting code-server without screen, the htop command seem more 'normal' length, I still get the same usual error ERROR SHARED stderr but for now still not crash, CPU load is normal and code-server take around 700 mb of ram.


root@xxx:~/code-server# ./code-server --cert /etc/letsencrypt/live/xxx/cert.pem --cert-key /etc/letsencrypt/live/xxx/privkey.pem -d /home/vscode -p 443
INFO  code-server v1.0.0
INFO  Additional documentation: http://github.com/codercom/code-server
INFO  Initializing {"data-dir":"/home/vscode","working-dir":"/root/code-server","log-dir":"/home/vscode/logs/20190309121854195"}
INFO  Starting webserver... {"host":"0.0.0.0","port":443}
INFO
INFO  Password: 4ecDQQlGR7Hb
INFO
INFO  Started (click the link below to open):
INFO  http://localhost:443/
INFO
INFO  Starting shared process [1/5]...
INFO  Connected to shared process
INFO  WebSocket opened / {"client":1,"ip":"xxx"}
INFO  Created data directory
ERROR SHARED stderr {"data":"Uncaught Exception:  Error: ENOENT: no such file or directory, open '/home/vscode/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/home/vscode/Backups/workspaces.json'\n    at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/root/code-server/code-server:468:27371), <anonymous>:71434:31)\n    at ontimeout (timers.js:475:11)\n    at tryOnTimeout (timers.js:310:5)\n    at Timer.listOnTimeout (timers.js:270:5)\n"}
INFO  WebSocket closed / {"client":1,"code":1001}
INFO  WebSocket opened / {"client":2,"ip":"xxx"}
INFO  Created data directory


Likely helped by the latest release. Closing in favor of #169.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Arsaev picture Arsaev  Â·  3Comments

pchecinski picture pchecinski  Â·  3Comments

justmao945 picture justmao945  Â·  3Comments

pchecinski picture pchecinski  Â·  3Comments

grant picture grant  Â·  3Comments