vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Code Server doesn't work on jupyterhub/kubernetes

Open sa- opened this issue 1 year ago • 8 comments

  • VSCode Version: latest
  • Local OS Version: macOS
  • Remote OS Version: ubuntu
  • Remote Extension/Connection Type: Server
  • Logs: image

Steps to Reproduce:

  1. Deploy jupyterhub to kubernetes
  2. Add some sort of SSO (Single Sign-On) authentication to jupyterhub
  3. Create a jupyter server
  4. Open a terminal
  5. Run wget -O- https://aka.ms/install-vscode-server/setup.sh | sh
  6. Run sudo chmod +x /usr/local/bin/code-server
  7. Run code-server serve-local --without-connection-token --accept-server-license-terms
  8. Try to access VS Code and find only a blank page. There are some errors in the console

Does this issue occur when you try this locally?: n/a Does this issue occur when you try this locally and all extensions are disabled?: n/a

sa- avatar Jul 29 '22 07:07 sa-

^The label should be for server rather than ssh

sa- avatar Aug 01 '22 17:08 sa-

Do you have a screen recording of what you see in vscode.dev when you try to connect? Or logs from the code-server?

tanhakabir avatar Aug 18 '22 17:08 tanhakabir

Hey thanks for having a look at this.

I'm running this with the command serve-local so vscode.dev is not involved in this process. The only logs are in the screenshot that I provided, the code-server logs seem to be blank.

$ code-server serve-local --without-connection-token --accept-server-license-terms --log debug
[2022-08-29 08:22:16] debug Resolved quality Stable to e4503b30fc78200f846c62cf8091b76ff5547662
[2022-08-29 08:22:16] debug Installing and setting up VS Code Server...
[2022-08-29 08:22:16] info Found existing installation at /home/skapadia/.vscode-cli/server-stable-web/bin/e4503b30fc78200f846c62cf8091b76ff5547662
[2022-08-29 08:22:16] debug Server setup complete
[2022-08-29 08:22:16] info Starting server...
[2022-08-29 08:22:16] debug Starting server with command... Command { std: "/home/skapadia/.vscode-cli/server-stable-web/bin/e4503b30fc78200f846c62cf8091b76ff5547662/bin/code-server" "--host=127.0.0.1" "--port=8000" "--without-connection-token" "--accept-server-license-terms" "--log=debug", kill_on_drop: false }
*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
Server bound to 127.0.0.1:8000 (IPv4)
Extension host agent listening on 8000

Web UI available at http://localhost:8000/
[08:22:16] Extension host agent started.
[08:22:16] ComputeTargetPlatform: linux-x64

sa- avatar Aug 29 '22 06:08 sa-

@DonJayamanne any thoughts

tanhakabir avatar Aug 29 '22 17:08 tanhakabir

I'm encountering the same issue. Wondering if there's any update? Judging from the errors it looks like it's trying to load js from /hub, where the jupyterhub login service is, but the right path should be something like /user/<username>/code-server/...

jiyuanq avatar Sep 08 '22 10:09 jiyuanq

Yeah - not sure what https://github.com/coder/code-server does differently, but that works just fine

sa- avatar Sep 08 '22 10:09 sa-

I guess it’s about absolute path vs relative path. VS code is using absolute paths which points to /hub as root path

jiyuanq avatar Sep 08 '22 11:09 jiyuanq

@microsoft if I were you I would hire @jiyuanq

sa- avatar Sep 08 '22 11:09 sa-

You need to use the jupyter server proxy to rewrite the url:

https://jupyter-server-proxy.readthedocs.io/en/latest/server-process.html#absolute-url

jabbera avatar Nov 07 '22 14:11 jabbera

Duplicate of https://github.com/microsoft/vscode/issues/165391

aeschli avatar Dec 16 '22 09:12 aeschli