rubin-dp0 / Support

Submit Github Issues related to DP0
MIT License
1 stars 3 forks source link

[BUG] Websocket connection failed in JupyterLab with Chrome #53

Closed mkelley closed 6 months ago

mkelley commented 10 months ago

Describe the bug Using Chrome on Ubuntu Linux I can open the JupyterLab portal, but cannot connect to any kernels. This has been a persistent issue for me over the past year or more. My workaround is to use Firefox on the same computer, but I prefer to use Chrome.

On the Javascript console, I find the following repeated errors:

index.js:114 WebSocket connection to 'wss://data.lsst.cloud/nb/user/msk/api/events/subscribe?token=...' failed: 
(anonymous) @   index.js:114
_subscribe  @   index.js:107
factory @   index.js:42
Poll._execute   @   index.es6.js:374
execute @   index.es6.js:313
WebSocket connection to 'wss://data.lsst.cloud/nb/user/msk/api/kernels/9f38e77e-e981-4f8e-9c00-421c675f3951/channels?session_id=...' failed: 
KernelConnection._createSocket  @   default.js:73
WebSocket connection to 'wss://data.lsst.cloud/portal/app/sticky/firefly/events?channelID=ffChan-msk-nb-1692364030-53' failed: 
NPe @   firefly-c4dab20….js:2
(anonymous) @   firefly-c4dab20….js:2
kPe @   firefly-c4dab20….js:2
t   @   firefly-c4dab20….js:2

To Reproduce Steps to reproduce the behavior:

  1. Log on to RSP with Chrome
  2. Open Notebooks
  3. Start a server (e.g., small). This seems to work fine.
  4. Wait for the JupyterLab landing page to open.
  5. Open the Javascript console and see websocket connection failed messages.
  6. Open a Notebook: see more websocket connection failed messages. The browser never connects to the kernel.
  7. Open a Console: the console tab opens. Try any command and nothing happens.
  8. Open a Terminal: the terminal tab opens and a cursor appears. I cannot type anything.

Editing files (e.g., text or python files) and browsing directories works fine.

Expected behavior That I could do anything with a python kernel.

Desktop (please complete the following information):

Additional context

This jypterlab issue might be relevant, although that report is not using wss: https://github.com/jupyterlab/jupyterlab/issues/12222

When I use Firefox on the same system, everything appears to work. There are no websocket failures on the console.

frossie commented 10 months ago

Thanks for the report. Using Chrome under Linux is something that should certainly work, a couple of our engineers use that themselves.

We're looking into it, meanwhile:

  1. Can I get you to paste the status bar of your Jupyterlab window, the one that looks like this:
Screenshot of Safari (2023-08-18, 13-47-07)
  1. Can you try disabling your Chrome extensions (temporarily) and trying from a private browser window?
frossie commented 10 months ago

One more thing - can you go to this 3rd party website https://www.piesocket.com/websocket-tester from: 1) Your Firefox which works 2) Your Chrome which does not work

click Send (their default settings are fine) and report whether you get the same behavior on both browsers, and include a screenshot of your output. This is what I would expect:

Screenshot of Safari (2023-08-18, 14-18-49)
mkelley commented 10 months ago

I have identical results in Chrome and Firefox with the piesocket tool: image

The status bar with Chrome is: image

mkelley commented 10 months ago

Also, neither disabling extensions nor private browsing mode was successful.

mkelley commented 10 months ago

The errors are different today. Now I am seeing 302 errors, e.g.,:

WebSocket connection to 'wss://data.lsst.cloud/nb/user/msk/api/events/subscribe?token=...' failed: Error during WebSocket handshake: Unexpected response code: 302
(anonymous) @ index.js:114
frossie commented 8 months ago

So we have been unable to reproduce this and the most likely (though not certain) explanation is that there is something in your configuration that is disabling websocket connections. Is there any way you could try from a different device and/or network?

mkelley commented 8 months ago

I've tried this on three different computers on three different networks, including just now from a hotel. All three computers have ubuntu, although different installations. All three use the latest google-chrome-stable from http://dl.google.com/linux/chrome/deb . My only option left for testing is to try it on an EC2 instance or something similar, unless you've already done that.

frossie commented 8 months ago

Hi I am sorry we're kinda out of ideas since we can't reproduce it any way we try. If your timezone permits can you sign up for our zoom office hour and we can try and watch what's happening? You can sign up here: https://fantastical.app/frossie/ask-square

frossie commented 8 months ago

(by the way if you're always logging onto your Chrome wit the same google account, the different computers aren't really testing anything different if you have a Chrome setting disabling websockets, but if you drop in for office hours we can check for that)

mkelley commented 6 months ago

I have been able to run a notebook from an identical version of Chrome installed on a different linux distribution, so I can now rule out Chrome version and logging into my browser as the cause. I have also successfully run notebooks with Chrome on my same computer, just using a different (fresh) user account. It clearly seems to be a problem hyper local to myself. I'll close the issue. Thanks for the help!

frossie commented 6 months ago

Ah. If you ever figure out why your (older) user account had an issue, do let us know, but glad you're up and running!