Websocket 400 connection failed

Hi manics and minrk,

I have another question. Is there any test that I can try to prove that this is a proxy/firewall issue and it is not related to the JupyterHub application created ?

Thank you very much,

Alison

If you’ve got direct access to the k8s nodes you could configure the JupyterHub service to use NodePorts instead of an ingress. This would bypass any proxies on the k8s cluster, though it wouldn’t rule out something on your local system.

Thank you very much manics. I’ll try that

If I want to understand the proxy differences between the DEV/UAT Kubernetes clusters, would I need to compare the nginx.conf files ? Is there anything else I would need to compare ?

Thank you very much,

Alison

For a full comparison you’ll need to go through the whole stack. The front-end proxy (Nginx) is a likely candidate, but it could also be your Kubernetes ingress controller, or some difference in your Kubernetes cluster/networking setups. It could also be a firewall or transparent proxy blocking websockets.

Damm even I am having a similar kind of issue, I have searched all over the internet and even have posted on number of threads on different forum, no solution seems to work. I am really frustrated, can anyone of you here help me resolve this issue, I am very much tired now.

Hi,

Just to let you know a member of my team that configured all the clusters has investigated this. The following configuration step was missing for the higher environment clusters (except for DEV):

Configure rewrite_rules.app with the lines below. Replace vs-avi-test-out-dev.xmp.net.intra with the hotname of the 2nd AVI.

cd /data/apache_slab/apache/conf.d
vi rewrite_rules.app

    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /(.*)           wss://vs-avi-test-out-dev.xmp.net.intra/$1 [P,L]

The JupyterHub application is now working with this change. Thank you very much manics and minrk for all your help !!

bidenpriece I hope you can find a solution as well

1 Like

Commenting out this line in our k8s configuration resolved the websocket issue:
# service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp"

2 Likes

in my case I had to set it to " service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp", websocket connection was failing as it was set to http by default.