code-server: SyntaxError: Unexpected end of JSON input

  • code-server version: 1.691-vsc1.33.0
  • OS Version: Ubuntu 18.04 LTS Minimal, Google Cloud

Description

When I tried to run the code-server command, it gives me this error:

WARN Uncaught Exception: Error: Unexpected end of JSON input

SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at pfs_1.readFile.then.contents (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:76703:45) at <anonymous> at Timeout.setTimeout [as _onTimeout] (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:53086:31) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5)

Also, when I tried to connect the website ignoring the error, I received the error x.x.x.x refused to connect. (Okay. This is a different issue. I need to specify the specific IP address for the code-server to run on instead of 0.0.0.0)

Steps to Reproduce

  1. Extract the code-server and put it in bin.
  2. Run command sudo code-server -p 80

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 12
  • Comments: 25 (4 by maintainers)

Most upvoted comments

Also getting the same error with Ubuntu 18.04 code-sever 1.691-vsc1.33.0

When it will be available in any release file?

Same issue:

Using Ubuntu 18.04 on Digital Ocean and running code-server binary

SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at pfs_1.readFile.then.contents (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:76703:45) at <anonymous> at Timeout.setTimeout [as _onTimeout] (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:53086:31) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5)

When are expecting a fix for this? I’ve got the same problem with GCP, Digital Ocean and Vultr running Ubuntu 16/18 and it sure seems it is coming from code-server

Just pushed a commit that should permanently resolve the JSON message, but it’s very unlikely to have caused any issues (it’s just about trying to read the backup workspaces JSON file in order to delete empty workspace storage).

I also made the port scanning message more explicit. It now says “Port scanning will not be available because netstat is not installed” and it’s been downgraded to a warning. We’ll probably need to add some documentation on why we have port scanning and what you lose if you don’t have it (assuming we don’t replace it: https://github.com/codercom/code-server/issues/382).

same error in my Ubuntu18.04.

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at pfs_1.readFile.then.contents (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:76703:45)
    at <anonymous>
    at Timeout.setTimeout [as _onTimeout] (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:53086:31)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)

Same issue:

Using Ubuntu 18.04 on Digital Ocean and running code-server binary

SyntaxError: Unexpected end of JSON input at JSON.parse () at pfs_1.readFile.then.contents (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:76703:45) at at Timeout.setTimeout [as _onTimeout] (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:53086:31) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5)

same

I get same error

code-server v1.604-vsc1.32.0 OS version: Debian GNU/Linux 9.8 (stretch)

Just made a release that contains the fix.

Same problem here in ArchLinux as self hosting. code-server v1.691-vsc1.33.0

I can access the IDE pointing at localhost:8443 but it doesn’t start up on the right directory and I don’t seem to be able open any other directory but the current one (which happens to be the one where the vscode-server binary file is).