Code-server: ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json'

Created on 8 Mar 2019  Â·  71Comments  Â·  Source: cdr/code-server

  • code-server version: v1.31.1-100
  • OS Version: Ubuntu 18.10

Steps to Reproduce

  1. use docker to start code-server, wait a while
  2. 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"}
bug needs-investigation

Most helpful comment

Please avoid me too comments in favour of using GitHub reactions.

All 71 comments

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 version then python3 -V
  • created a new folder
  • Hit File -> Open Folder and 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), :94976:31)\n at ontimeout (timers.js:498:11)\n at tryOnTimeout (timers.js:323:5)\n at Timer.listOnTimeout (timers.js:290:5)\n"}

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), :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"}

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 undefined error 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

@ndom91 I tried creating the Backups folder with an empty workspace.json but now i get this:
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/cj/vscode/code-server/code-server:468:27660), <anonymous>:77277:45)\n at <anonymous>\n at Timeout.setTimeout [as _onTimeout] (eval at exports.requireModule (/home/cj/vscode/code-server/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"}

I guess i need a proper workspaces.json? What version are you using? Does anyone know whats in that file? Even better, does anyone have a default one that they can share?

After creating a workspaces.json in the desired directory and filling it with the content

{
        "folders": [
                {
                        "path": "/home/<username_redacted>/code-server/workspace/folders"
                }
        ]
}

I get a new error:

ERROR SHARED stderr {"data":"Uncaught Exception:  Error: Cannot read property 'map' of undefined\n\nTypeError: Cannot read property 'map' of undefined\n    at pfs_1.readFile.then.contents (eval at exports.requireModule (/home/<username_redacted>/code-server/code-server-1.32.0-245-linux-x64/code-server:468:27660), <anonymous>:77278:76)\n    at <anonymous>\n    at Timeout.setTimeout [as _onTimeout] (eval at exports.requireModule (/home/<username_redacted>/code-server/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"}

Hmm strange, like I said mine worked while it was empty - as long as it was there. The full command for me was the following:

/opt/vscode-server/code-server /var/www/html -d /home/ndo/.code-server --password=####### --allow-http

OK, I never tried with --allow-http, maybe thats different then. I'll try that later and report back...

Just tried with --allow-http, same error...

Yeah sorry I should have mentioned, I only have allow http because I have it behind a reverse proxy with nginx

Windows with Docker Desktop, similar result...

$ docker run --rm -it -p 8443:8443 -v "${PWD}://root//project" codercom/code-server --allow-http --no-auth -d //root//project
INFO  code-server development
INFO  Additional documentation: http://github.com/codercom/code-server
INFO  Initializing {"data-dir":"/root/project","working-dir":"/root/project","log-dir":"/root/.cache/code-server/logs/20190314233657085"}
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/project/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/root/project/Backups/workspaces.json'\n    at Timeout.setTimeout [as _onTimeout] (eval at exports.requireModule (/usr/local/bin/code-server:468:27625), <anonymous>:57561:31)\n    at ontimeout (timers.js:498:11)\n    at tryOnTimeout (timers.js:323:5)\n    at Timer.listOnTimeout (timers.js:290:5)\n"}
^CINFO  Starting shared process [1/5]... {"error":"Exited with null"}
INFO  Connected to shared process
ERROR SHARED stderr {"data":"Uncaught Exception:  Error: ENOENT: no such file or directory, open '/root/project/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/root/project/Backups/workspaces.json'\n    at Timeout.setTimeout [as _onTimeout] (eval at exports.requireModule (/usr/local/bin/code-server:468:27625), <anonymous>:57561:31)\n    at ontimeout (timers.js:498:11)\n    at tryOnTimeout (timers.js:323:5)\n    at Timer.listOnTimeout (timers.js:290:5)\n"}

I solved this in Docker on elementaryOS (Linux Desktop)

I tried the following docker-compose setup:

  vscode:
    image: codercom/code-server
    entrypoint: sh -c "mkdir -p /root/.local/share/code-server/Backups/ && touch /root/.local/share/code-server/Backups/workspaces.json && code-server --allow-http"
    expose:
      - 8443
    volumes:
      - /home/henry/development:/root/project
    restart: always
    networks:
      - vscode
    depends_on:
      - nginx-proxy

Notice I just overrode the entrypoint to make the file in question then run code-server

  1. use directory A as workspace to mount and start the docker, not error
  2. use directory B as workspace to mount and restart the docker, ENOENT: no such file or directory, open '/root/.code-server/Backups/workspaces.json
  3. switch back to directory A as workspace to mount and restart, no error

Looks like if you use a new workspace directory, it did not correctly create the workspaces.json?

Having the same issue when using the default Dockerfile.

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>:56921:31)\n at ontimeout (timers.js:498:11)\n at tryOnTimeout (timers.js:323:5)\n at Timer.listOnTimeout (timers.js:290:5)\n"}

If I manually create /root/.local/share/code-server/Backups/workspaces.json, it gives the following error:

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 (/usr/local/bin/code-server:468:27625), <anonymous>:81639:45)\n at <anonymous>\n at Timeout.setTimeout [as _onTimeout] (eval at exports.requireModule (/usr/local/bin/code-server:468:27625), <anonymous>:56921: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 using MacOS Mojave. Running from the binary works even with the same error, so, maybe is related to another thing. 🤔

Anyone found a workaround ?? This problem still exists
Tried everything from specifying different folder to creating the file manually.

I always prefer binary file compared to docker. Seems like NO one is able to use the binary file installation.

@adithyau I don't have problems running from the binary one, but from docker. That's curious.

When using the docker command shown on the homepage, I've worked around this error by additionally mounting /root/.local to a path or a volume:

$ docker run -t -p 8443:8443 -v "$(pwd)/.coder:/root/.local" -v "$(pwd):/root/project" codercom/code-server code-server --allow-http --no-auth

Note: above command is insecure, use only for testing locally and always review the security documentation provided.

Cheers.

/root/.local/share/code-server/Backups/workspaces.json Have you tried overwriting the entire file?

This error _shouldn't_ actually cause any issues. Not sure if we should suppress it.

Originally, I couldn't load it out with black screen, but later I updated the configuration of nginx, so that vs code could be loaded out on the web page。
TIM截图20190320085839

Same error using GCP,

Ran into a similar issue, but noticed that when I opened the page in "Incognito" mode, it worked. I suspect that some state is getting saved into the browsers local storage. Clearing it seemed to solve the problem.

In Chrome you can clear a single site with: Developer Tools > Application (tab) > Clear storage

Edit: This is incorrect. As @kylecarbs pointed out below, it's related to an invalid folder. Please ignore.

@mdp that's an issue with opening an _invalid_ folder. We've fixed that on master. Will come in a release later today.

What is suppose to be in the workspace.json file? If we just set it to default params, shouldn't it work fine?

Is it not maybe an error with your firewall? (UFW or something)

@mdp that's an issue with opening an _invalid_ folder. We've fixed that on master. Will come in a release later today.

Was it released?

Thanks

Originally, I couldn't load it out with black screen, but later I updated the configuration of nginx, so that vs code could be loaded out on the web page。
TIM截图20190320085839

Tried this and it didn't work for me. My symptoms are similar to @juliosegarra's.

Capture
Still getting the same error in Linux Machine 18.04.
Updated to the new release.

same error, Ubuntu 16.04.5 LTS.
Capture

it is working now with latest docker image. Thanks!

Not working for me. I'm running using the Docker oneliner behind an nginx reverse proxy. All I get is a black screen.

docker run -t -p 127.0.0.1:5000:8443 -v "${PWD}:/root/project" codercom/code-server 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/code-server","log-dir":"/root/.cache/code-server/logs/20190328155807526"}
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] (/src/packages/server/build/bootstrap-fork.js.gz:56921:31)\n    at ontimeout (timers.js:498:11)\n    at tryOnTimeout (timers.js:323:5)\n    at Timer.listOnTimeout (timers.js:290:5)\n"}

In the browser console, I get this:

GET https://<hostname>/e5b7d1.bundle.js net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)

Pulled the latest tag after @jackalcooper's comment.

Same issue with the latest docker on centos7. Any workaround?

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 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"}

Check if the port 8443 is allowed in ufw rules

For anyone who might be interested. here is the ID of the image I pulled.

codercom/code-server                                           latest              3f11c56fcdda        2 days ago 

Capture
Still getting the same error in Linux Machine 18.04.
Updated to the new release.

Sorry for the confusion here, I am able get the code server up and running.
But even after the connection I got the above error in command line.
Despite the error try to access the link.

I have instance with Ubuntu 18.04 (LTS), installed the latest as of today Coder release which is

root@codercom:~/dev/recommended-bump# code-server --version
1.408-vsc1.32.0

And everything is working except that same error, and I'm guessing that's why my integrated terminal is black and cannot see anything?

This error doesn't actually cause any issues. I would suspect the black terminal is caused by something else

@coadler for example? It was that why just after fresh machine install and fresh code-server startup. No settings changes or anything. Any ideas to debug it?

Aaaaah, heck. Forget it, just realized to try to disable the Brave's Shields blocker :D Sometimes blocks too much, sometimes not enough.

This issue is closed, is not a bug of code-server? I noticed that the code-server running normally, should I just ignore this error for now?

@liupengf12 yes.

edit: Or at least you can add the file with this content

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

It's a default one.

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 hello, i tried your method but then i got the following error

ERROR SHARED stderr {"data":"Uncaught Exception:  Error: ENOENT: no such file or directory, scandir '/home/yusef/.code-server/User/workspaceStorage'\n\nError: ENOENT: no such file or directory, scandir '/home/yusef/.code-server/User/workspaceStorage'\n    at Timeout.setTimeout [as _onTimeout] (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz: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"}

I'm having the same issue here. I tried to launch it in DigitalOcean container,
it shows the same error and I couldn't open code-server.

it cannot be just empty file. try to put the contents that from my previous comment.

@yusef-ho try running mkdir -p /home/yusef/.code-server/User/workspaceStorage

it cannot be just empty file. try to put the contents that from my previous comment.

@tunnckoCore it's not an empty and it is as your comment of content.

@yusef-ho try running mkdir -p /home/yusef/.code-server/User/workspaceStorage
@kylecarbs yes, i did this before seeing reply, it worked perfectly, thanks

Just wanted to note that it is working for me on a fresh install via the binary now as well. Without any fooling around with folders or arguments.

This is the error I am currently getting on google cloud platform, with both Ubuntu 16 and 18
INFO Started (click the link below to open):
INFO http://localhost:80/
INFO
INFO Starting shared process [1/5]...
INFO Connected to shared process
WARN Uncaught Exception: Error: Unexpected end of JSON input
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at pfs_1.readFile.then.contents (/home/travis/build/codercom/code-server/packages/server/build/boo
tstrap-fork.js.gz:77277:45)
at
at Timeout.setTimeout [as _onTimeout] (/home/travis/build/codercom/code-server/packages/server/bui
ld/bootstrap-fork.js.gz:52540:31)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
I have tried deleted and created new vms but its not working

@okabamac what version/release of the binary are you running?

@Multishifties 1.691-vsc1.33.0

@Multishifties I also tried with 1.691-vsc1.33.0 released 14 hours ago and I am having the unexpected end of json input error
I moved code-server to my /bin folder

@okabamac what version/release of the binary are you running?

1.691-vsc1.33.0

I pushed a commit which should resolve the JSON message, but it doesn't cause any issues so you can safely ignore it until the next release.

@code-asher OK that will be amazing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

korzq picture korzq  Â·  3Comments

tecosaur picture tecosaur  Â·  3Comments

RealSlimMahdi picture RealSlimMahdi  Â·  3Comments

infogulch picture infogulch  Â·  3Comments

pchecinski picture pchecinski  Â·  3Comments