Code-server: Does not work on Openshift

Created on 9 Apr 2019  路  12Comments  路  Source: cdr/code-server

Here's the log


INFO  code-server development
--
聽 | INFO  Additional documentation: http://github.com/codercom/code-server
聽 | INFO  Initializing {"data-dir":"/root/.local/share/code-server","extensions-dir":"/root/.local/share/code-server/extensions","working-dir":"/root/project","log-dir":"/root/.cache/code-server/logs/20190409084844096"}
聽 | 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://github.com/codercom/code-server/blob/master/doc/security/ssl.md
聽 | INFO
聽 | INFO  Password: 81f48f2a6e2b68ad4b1b5767
聽 | INFO
聽 | INFO  Started (click the link below to open):
聽 | INFO  http://localhost:8443/
聽 | INFO
聽 | INFO  Connected to shared process
聽 | 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 (/src/packages/server/build/bootstrap-fork.js.gz:95779:45)
聽 | at <anonymous>
聽 | at Timeout.setTimeout [as _onTimeout] (/src/packages/server/build/bootstrap-fork.js.gz:71026:31)
聽 | at ontimeout (timers.js:498:11)
聽 | at tryOnTimeout (timers.js:323:5)
聽 | at Timer.listOnTimeout (timers.js:290:5)


bug

Most helpful comment

Alrighty! Closing since I think we fixrd this a long time ago

All 12 comments

Getting this too when running in Docker on Ubuntu 18.04:

$ docker run -t -p 127.0.0.1:5000:8443 -v "${PWD}:/root/project" codercom/code-server:1.621 code-serve
r --allow-http --no-auth
Unable to find image 'codercom/code-server:1.621' locally
1.621: Pulling from codercom/code-server
898c46f3b1a1: Pull complete
63366dfa0a50: Pull complete
041d4cd74a92: Pull complete
6e1bee0f8701: Pull complete
bded34074f32: Pull complete
156845bb53a2: Pull complete
3f6111b92a78: Pull complete
605216ff0bff: Pull complete
0f0611023061: Pull complete
50412cf69c67: Pull complete
Digest: sha256:a591ca010a45af44f6f0a3807698e4c4e82e97e457e2949795ae006bdad02126
Status: Downloaded newer image for codercom/code-server:1.621
INFO  code-server development
INFO  Additional documentation: http://github.com/codercom/code-server
INFO  Initializing {"data-dir":"/home/coder/.local/share/code-server","extensions-dir":"/home/coder/.local/share/code-server/extensions","working-dir":"/home/coder/project/code-server","log-dir":"/home/coder/.cache/code-server/logs/20190409121823231"}
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://github.com/codercom/code-server/blob/master/doc/security/ssl.md
WARN  Launched without authentication.
INFO
INFO  Started (click the link below to open):
INFO  http://localhost:8443/
INFO
INFO  Connected to shared process
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 (/src/packages/server/build/bootstrap-fork.js.gz:91619:45)
    at <anonymous>
    at Timeout.setTimeout [as _onTimeout] (/src/packages/server/build/bootstrap-fork.js.gz:66934:31)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)

This works fine on macOS Mojave, though:

docker run -it -p 127.0.0.1:5000:8443 -v "${PWD}:/home/coder/project" codercom/code-server:1.621 --allow-http --no-auth

Please be noted I made a OpenShift-compatible image. You can check it out here @amalic

docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server:1.621 --allow-http --no-auth

Getting this too when running in Docker on CentOS:

INFO  code-server development
INFO  Additional documentation: http://github.com/codercom/code-server
INFO  Initializing {"data-dir":"/home/coder/.local/share/code-server","extensions-dir":"/home/coder/.local/share/code-server/extensions","working-dir":"/home/coder/project","log-dir":"/home/coder/.cache/code-server/logs/20190410001328997"}
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://github.com/codercom/code-server/blob/master/doc/security/ssl.md
WARN  Launched without authentication.
INFO
INFO  Started (click the link below to open):
INFO  http://localhost:8443/
INFO
INFO  Connected to shared process
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 (/src/packages/server/build/bootstrap-fork.js.gz:91619:45)
    at <anonymous>
    at Timeout.setTimeout [as _onTimeout] (/src/packages/server/build/bootstrap-fork.js.gz:66934:31)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)

@smalike I don't think that should be of your concern - that's minor and its unrelated to this issue.

We have another issue for this specific error. And @code-asher already has a PR for this.

Relevant thread is here https://github.com/codercom/code-server/issues/453

See #223 as well for a progress check for OpenShift compatibility

Recommending closure. We can't really do this upstream but feel free to use my images if you want to use Coder in OpenShift.

Please be noted I made a OpenShift-compatible image. You can check it out here @amalic

works out of the box! well done. would make sense if this could make it into the main project ;)

I couldn't save anything. I guess i need to mount some storage into the pod.

@amalic yes you need to mount a PVC first since the image is only making emptydirs for the volume mounts.

@sr229 still working on PVC's. I already got PV's working. Think will be able to let you know soon.

@sr229 Fixed the issue with saving files. It was actually a MTU issue on the router node that prevented uploads larter than 284 Byte.

Container works totally fine. Thanks

Alrighty! Closing since I think we fixrd this a long time ago

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grant picture grant  路  3Comments

infogulch picture infogulch  路  3Comments

avelino picture avelino  路  3Comments

pchecinski picture pchecinski  路  3Comments

korzq picture korzq  路  3Comments