ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json'
code-serverversion: v1.31.1-100- OS Version: Ubuntu 18.10
Steps to Reproduce
- use docker to start code-server, wait a while
- and you will see this error:
ERROR SHARED stderr {"data":"Uncaught Exception: Error: ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json'\n at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/usr/local/bin/code-server:468:27336), <anonymous
>:76664:31)\n at ontimeout (timers.js:498:11)\n at tryOnTimeout (timers.js:323:5)\n at Timer.listOnTimeout (timers.js:
290:5)\n"}
me too
me too
I also found this while running on Google cloud
Please avoid me too comments in favour of using GitHub reactions.
I'm getting the very same error in the beginning. Later, when I navigate to the code-server's address in my browser, login with the generated password and mess around in vscode it suddenly crashes. In order, I did the following actions:
- open terminal and execute
go versionthenpython3 -V - created a new folder
- Hit
File->Open Folderand navigated to one of the newly created folders - crash
Traceback:
root@dev:~/native-code-server/bin# ./code-server -d /root/native-code-server/projects --allow-http
INFO code-server v1.31.1-100
INFO Additional documentation: http://github.com/codercom/code-server
INFO Initializing {"data-dir":"/root/native-code-server/projects","working-dir":"/root/native-code-server/bin","log-dir":"/root/native-code-server/projects/logs/20190308233649456"}
INFO Starting shared process [1/5]...
INFO Starting webserver... {"host":"0.0.0.0","port":8443}
WARN No certificate specified. This could be insecure.
WARN Documentation on securing your setup: https://coder.com/docs
INFO
INFO Password: ************************
INFO
INFO Started (click the link below to open):
INFO http://localhost:8443/
INFO
INFO Connected to shared process
ERROR SHARED stderr {"data":"Uncaught Exception: Error: ENOENT: no such file or directory, open '/root/native-code-server/projects/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/root/native-code-server/projects/Backups/workspaces.json'\n at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/root/native-code-server/bin/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
INFO WebSocket closed / {"client":1,"code":1001}
INFO WebSocket opened / {"client":2,"ip":"127.0.0.1"}
INFO Created data directory
INFO WebSocket closed / {"client":2,"code":1006}
INFO WebSocket opened / {"client":3,"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 (/root/native-code-server/bin/code-server:716:35021)
at e.exports (/root/native-code-server/bin/code-server:716:34522)
at e (/root/native-code-server/bin/code-server:716:33324)
at Timeout.c [as _onTimeout] (/root/native-code-server/bin/code-server:716:33617)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
root@prod:~/native-code-server/bin# ls -lh /root/native-code-server/projects/Backups/workspaces.json
ls: cannot access '/root/native-code-server/projects/Backups/workspaces.json': No such file or directory
I get same error at tecent clould centos 7.4 64 ,Docker version 18.09.3, build 774a1f4
INFO code-server development
INFO Additional documentation: http://github.com/codercom/code-server
INFO Initializing {"data-dir":"/root/.code-server","working-dir":"/root/project","log-dir":"/root/.code-server/logs/20190309021032283"}
INFO Starting shared process [1/5]...
INFO Starting webserver... {"host":"0.0.0.0","port":8443}
WARN No certificate specified. This could be insecure.
WARN Documentation on securing your setup: https://coder.com/docs
WARN Launched without authentication.
INFO
INFO Started (click the link below to open):
INFO http://localhost:8443/
INFO
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'\n\nError: ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json'\n at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/usr/local/bin/code-server:468:27625),
Thanks~
+1 running both on binary version and Dockerfile gives the same result. Ubuntu 16.04
I get same error in Ubuntu 16.04 on AWS clouds
ubuntu@ip-172-31-25-334:~/coder$ sudo ./code-server -p 80
INFO code-server v1.0.0
INFO Additional documentation: http://github.com/codercom/code-server
INFO Initializing {"data-dir":"/home/ubuntu/.code-server","working-dir":"/home/ubuntu/coder","log-dir":"/home/ubuntu/.code-server/logs/20190309104304890"}
INFO Starting shared process [1/5]...
INFO Starting webserver... {"host":"0.0.0.0","port":80}
WARN No certificate specified. This could be insecure.
WARN Documentation on securing your setup: https://coder.com/docs
INFO
INFO Password: fl4u1A3chFfj
INFO
INFO Started (click the link below to open):
INFO http://localhost:80/
INFO
INFO Connected to shared process
ERROR SHARED stderr {"data":"Uncaught Exception: Error: ENOENT: no such file or directory, open '/home/ubuntu/.code-server/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/home/ubuntu/.code-server/Backups/workspaces.json'\n at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/home/ubuntu/coder/code-server:468:27371),
Debian 9 64 bit (fresh installation)
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
I can confirm this happens in Container Linux/CoreOS stable as well, running on Digital Ocean (as well as Debian 9.7 as other have reported).
I got same error in Ubuntu 16.04 on aliyun cloud
root@xxx:~/workdir# docker run -t -p 127.0.0.1:8443:8443 -v "${PWD}:/root/project" codercom/code-server --allow-http --no-auth
INFO code-server development
INFO Additional documentation: http://github.com/codercom/code-server
INFO Initializing {"data-dir":"/root/.local/share/code-server","working-dir":"/root/project","log-dir":"/root/.cache/code-server/logs/20190311023801696"}
INFO Starting shared process [1/5]...
INFO Starting webserver... {"host":"0.0.0.0","port":8443}
WARN No certificate specified. This could be insecure.
WARN Documentation on securing your setup: https://coder.com/docs
WARN Launched without authentication.
INFO
INFO Started (click the link below to open):
INFO http://localhost:8443/
INFO
INFO Connected to shared process
ERROR SHARED stderr {"data":"Uncaught Exception: Error: ENOENT: no such file or directory, open '/root/.local/share/code-server/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/root/.local/share/code-server/Backups/workspaces.json'\n at Timeout.setTimeout [as _onTimeout] (eval at exports.requireModule (/usr/local/bin/code-server:468:27625), <anonymous>:67388:31)\n at ontimeout (timers.js:498:11)\n at tryOnTimeout (timers.js:323:5)\n at Timer.listOnTimeout (timers.js:290:5)\n"}
Same error on Ubuntu 18.04 Digital Ocean standard vps while just trying to run binary version.
ERROR SHARED stderr {"data":"Uncaught Exception: Error: ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json'\n at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/root/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"}
Same error on Ubuntu 16.04 and no file from data directory can be seen in vs code's explorer
Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-1030-azure x86_64) Windows Azure Virtual Machine code-server-1.31.1-100-linux-x64
ERROR SHARED stderr {"data":"Uncaught Exception: Error: ENOENT: no such file or directory, open '/home/<user>/.code-server/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/home/<user>/.code-server/Backups/workspaces.json'\n at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/home/<user>/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":"<hoster_ip>"}
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/<user>/code-server-1.31.1-100-linux-x64/code-server:716:35021)
at e.exports (/home/<user>/code-server-1.31.1-100-linux-x64/code-server:716:34522)
at e (/home/<user>/code-server-1.31.1-100-linux-x64/code-server:716:33324)
at Timeout.c [as _onTimeout] (/home/<user>/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)
I managed to make it work with specifying -d like this:
./code-server ./projects/<myproject> --allow-http --no-auth -d /Users/<username>/.code-server
But I still see the same error in the console.
@xuemind seems like your error is caused because the VM ran out of memory. You might need to add a gb or two of swap so the binary is able to boot properly without running our of memory. I was able to get it running on a GCP micro instance with 600mb of memory like this
Same here on Ubuntu 18.10 server via the binary.
However by specifying -d /home/[user]/.code-server and manually creating /home/[user]/.code-server/Backups/workspaces.json it seems to have worked!
@ndom91 what does your workspaces.json file look like? I'm having trouble finding an example and am receiving a cannot read property 'map' of undefined error with an empty workspaces.json file.
I get this error when i try to run the binary on Ubuntu Server 18.04:
INFO code-server v1.0.0 INFO Additional documentation: http://github.com/codercom/code-server INFO Initializing {"data-dir":"/home/cj/.code-server","working-dir":"/var/www/dataandlogic.com","log-dir":"/home/cj/.code-server/logs/20190312210351837"} INFO Starting webserver... {"host":"0.0.0.0","port":8443} WARN No certificate specified. This could be insecure. WARN Documentation on securing your setup: https://coder.com/docs WARN Launched without authentication. INFO 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/cj/.code-server/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/home/cj/.code-server/Backups/workspaces.json'\n at Timeout.eval [as _onTimeout] (eval at exports.requireModule (/home/cj/vscode/code-server-1.31.0-20-x86_64-linux/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"}
I also tried version 1.31.0-100 with same results. When i try to run the docker, it also gives me the same error.
@ndom91 what does your workspaces.json file look like? I'm having trouble finding an example and am receiving a
cannot read property 'map' of undefinederror with an empty workspaces.json file.
I just created an empty one, i.e. touch /home/[user]/.code-server/Backups/workspace.json
EDIT: I just looked at it, now that I've run this once or twice, and its still empty haha