Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS-Code starts blank in our JupyterHub setup (websocket failure) #16

Open
nthiery opened this issue May 12, 2020 · 5 comments
Open

VS-Code starts blank in our JupyterHub setup (websocket failure) #16

nthiery opened this issue May 12, 2020 · 5 comments

Comments

@nthiery
Copy link
Contributor

nthiery commented May 12, 2020

This is presumably an issue in our local setup rather than vscode-binder,
but here is hopefully a reasonable location to keep a record; also in case
this rings a bell.

Setup

Jupyterhub 0.8.1 running on a single server with DockerSpawner.
Image configuration from: https://gitlab.in2p3.fr/jupyterhub-paris-saclay/image/
(see the Dockerfile and environment.yml; docker image available from
Packages -> Container Registry).

Symptoms

The installation of vscode and the jupyter proxy presumably went smoothly.
VS Code appears as expected in the jupyter(lab) menu/launcher.
When running the docker container locally, VS Code works correctly.

However when launching VS Code in the same way from our JupyterHub, I get a blank screen.
In the JavaScript console, I get:

findTextAreas: running over 1 textareas.js:38:26
 INFO Error while creating indexedDB log provider. Falling back to in-memory log provider. log.ts:184:11
  ERR DOMException: "A mutation operation was attempted on a database that did not allow mutations." log.ts:196:11
Firefox ne peut établir de connexion avec le serveur à l’adresse wss://jupytercloud.lal.in2p3.fr/jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/?reconnectionToken=787a1474-2047-42e1-a477-144beb66bfce&reconnection=false&skipWebSocketFrames=false. browserSocketFactory.ts:162:30
  ERR [remote-connection][Management   ][787a1…][initial][jupytercloud.lal.in2p3.fr:80] socketFactory.connect() failed. Error: log.ts:196:11
  ERR Error: "WebSocket close with status code 1006"
    s remoteAuthorityResolver.ts:55
    l browserSocketFactory.ts:129
log.ts:196:11
  ERR [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error: log.ts:196:11
  ERR Error: "WebSocket close with status code 1006"
    s remoteAuthorityResolver.ts:55
    l browserSocketFactory.ts:129
log.ts:196:11
  ERR Error: "WebSocket close with status code 1006"
    s remoteAuthorityResolver.ts:55
    l browserSocketFactory.ts:129
log.ts:196:11

In the Jupyter log, I get:

[I 2020-05-12 06:55:05.407 SingleUserNotebookApp log:174] 302 GET /jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/ -> /jupyter/hub/api/oauth2/authorize?client_id=user-nicolas.thiery-at-u-psud.fr&redirect_uri=%2Fjupyter%2Fuser%2Fnicolas.thiery-at-u-psud.fr%2Foauth_callback&response_type=code&state=[secret] (@127.0.0.1) 1.43ms
[E 2020-05-12 06:55:05.407 SingleUserNotebookApp web:1792] Uncaught exception GET /jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/ (127.0.0.1)
    HTTPServerRequest(protocol='http', host='jupytercloud.lal.in2p3.fr', method='GET', uri='/jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/tornado/web.py", line 1703, in _execute
        result = await result
      File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/websocket.py", line 97, in get
        return await self.http_get(*args, **kwargs)
      File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 534, in http_get
        return await self.proxy(self.port, path)
    TypeError: object NoneType can't be used in 'await' expression
[I 2020-05-12 06:55:05.418 SingleUserNotebookApp log:174] 302 GET /jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/static-/out/vs/workbench/workbench.web.api.js -> /jupyter/hub/api/oauth2/authorize?client_id=user-nicolas.thiery-at-u-psud.fr&redirect_uri=%2Fjupyter%2Fuser%2Fnicolas.thiery-at-u-psud.fr%2Foauth_callback&response_type=code&state=[secret] (@127.0.0.1) 1.20ms
[E 2020-05-12 06:55:05.418 SingleUserNotebookApp web:1792] Uncaught exception GET /jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/static-/out/vs/workbench/workbench.web.api.js (127.0.0.1)
    HTTPServerRequest(protocol='http', host='jupytercloud.lal.in2p3.fr', method='GET', uri='/jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/static-/out/vs/workbench/workbench.web.api.js', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/tornado/web.py", line 1703, in _execute
        result = await result
      File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/websocket.py", line 97, in get
        return await self.http_get(*args, **kwargs)
      File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 534, in http_get
        return await self.proxy(self.port, path)
    TypeError: object NoneType can't be used in 'await' expression
[I 2020-05-12 06:55:05.420 SingleUserNotebookApp log:174] 302 GET /jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/static-/out/vs/workbench/workbench.web.api.nls.js -> /jupyter/hub/api/oauth2/authorize?client_id=user-nicolas.thiery-at-u-psud.fr&redirect_uri=%2Fjupyter%2Fuser%2Fnicolas.thiery-at-u-psud.fr%2Foauth_callback&response_type=code&state=[secret] (@127.0.0.1) 1.10ms
[E 2020-05-12 06:55:05.420 SingleUserNotebookApp web:1792] Uncaught exception GET /jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/static-/out/vs/workbench/workbench.web.api.nls.js (127.0.0.1)
    HTTPServerRequest(protocol='http', host='jupytercloud.lal.in2p3.fr', method='GET', uri='/jupyter/user/nicolas.thiery-at-u-psud.fr/vscode/static-/out/vs/workbench/workbench.web.api.nls.js', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/tornado/web.py", line 1703, in _execute
        result = await result
      File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/websocket.py", line 97, in get
        return await self.http_get(*args, **kwargs)
      File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 534, in http_get
        return await self.proxy(self.port, path)
    TypeError: object NoneType can't be used in 'await' expression
@betatim
Copy link
Owner

betatim commented May 12, 2020

I think the networking part/firewall is fine. This is often a problem with websockets but seems to work here.

Seems more like someone changed/broke something in the jupyter-server-proxy we use or at least that is where this error is occuring. Do you know which version of it you are using? Probably worth reporting in their GitHub repo.

@betatim
Copy link
Owner

betatim commented May 12, 2020

I just refreshed this repositories image on mybinder.org. This means it is using the latest and greatest jupyter-server-proxy available on conda-forge. This is v1.4.0 released ~3 days ago according to https://anaconda.org/conda-forge/jupyter-server-proxy

As far as I can tell it works on mybinder.org. Can you try if it also works for you and then see what happens locally if you upgrade/change to the same versions?

@nthiery
Copy link
Contributor Author

nthiery commented May 12, 2020

jovyan@7eb3ed476be7:~$ conda list | grep proxy
configurable-http-proxy   4.2.1           node13_he01fd0c_0    conda-forge
jupyter-server-proxy      1.4.0                      py_0    conda-forge
jupyter-vscode-proxy      0.1                      pypi_0    pypi
jovyan@7eb3ed476be7:~$ pip list | grep proxy
jupyter-server-proxy              1.4.0
jupyter-vscode-proxy              0.1

@nthiery
Copy link
Contributor Author

nthiery commented May 12, 2020

Thanks @betatim for the feedback!

The fact that things work if I use the docker image directly but don't in our JupyterHub may point more to a setup problem than a version problem. Although certain versions may have different use of the setup ...

@wzrzt
Copy link

wzrzt commented Jul 3, 2020

In my case, vscode icon shows in jupyterlab launcher, but not jupyterhub's. Is there any instruction about making vscode show in jupyterhub launcher ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants