# noVNC Failed to connect to server (ondemand 3.0.1)

**URL:** <https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711>\
**Category:** Get Help\
**Created:** [May 22, 2023, 4:11pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711 "2023-05-22T16:11:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 4:11pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/1 "2023-05-22T16:11:22Z")

</div>

I have installed Ondemand 3.0.1 on one of my test cluster OOD servers and I am getting this error when launching an interactive desktop from that new OOD servers. I can launch it on another test server running Ondemand 2.0.31. What should I look for? I am using pretty much the same ood-portal.yml file as the previous version with the exception of the new server-aliases variable (thanks for that). I’ve looked at the “similar topics to” but they are not for 3.0.1 and this does work on 2.0.31.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 22, 2023, 4:53pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/2 "2023-05-22T16:53:20Z")

</div>

Open your developer tools and see what the http response code is.

The older topics should still be valid. My guess is is that you don’t have `node_uri` and `rnode_uri` set in `ood_portal.yml`.

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 4:59pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/3 "2023-05-22T16:59:30Z")

</div>

Here is what I have in the ood-portal.yml file:

```
 host_regex: 't-[isg]c-[1-5][0-9][0-9][0-9]'
 node_uri: '/node'
 rnode_uri: '/rnode'

```

and the error in the console is:

Failed when connecting: Connection closed (code: 1006) rfb.js:831:21  
\_fail [https://rcportaltest.test.hpc.psu.edu/pun/sys/dashboard/noVNC-1.3.0/core/rfb.js:831](https://rcportaltest.test.hpc.psu.edu/pun/sys/dashboard/noVNC-1.3.0/core/rfb.js:831)  
\_socketClose [https://rcportaltest.test.hpc.psu.edu/pun/sys/dashboard/noVNC-1.3.0/core/rfb.js:581](https://rcportaltest.test.hpc.psu.edu/pun/sys/dashboard/noVNC-1.3.0/core/rfb.js:581)  
onclose [https://rcportaltest.test.hpc.psu.edu/pun/sys/dashboard/noVNC-1.3.0/core/websock.js:262](https://rcportaltest.test.hpc.psu.edu/pun/sys/dashboard/noVNC-1.3.0/core/websock.js:262)

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 22, 2023, 5:04pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/4 "2023-05-22T17:04:18Z")

</div>

I’m looking for this status code. Do you have anything else in front of apache like a load balancer, etc?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/d/d965c52c67a1e49a7d161f4e33c54498985758d8.png)

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 5:10pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/5 "2023-05-22T17:10:49Z")

</div>

400 Client must support ‘binary’ or ‘base64’ protocol

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 5:13pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/6 "2023-05-22T17:13:33Z")

</div>

Sorry that isn’t it. I refreshed the noVNC and got that but I do not have an error under headers.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 22, 2023, 5:15pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/7 "2023-05-22T17:15:41Z")

</div>

Is the response header `101 Switching Protocols` or something different?

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 5:34pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/8 "2023-05-22T17:34:11Z")

</div>

I cannot get the response header. I am not seeing how to do that in firefox and if I refresh the page with the network tab open it just gives me the 400 Client error that is above. Probably due to the vnc password no longer matching.

We do have an haproxy load balancer in front of the OOD servers.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 22, 2023, 5:38pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/9 "2023-05-22T17:38:40Z")

</div>

> [@rsand](#):
>
> We do have an haproxy load balancer in front of the OOD servers.

I would confirm that you can use websockets through this load balancer. Does the shell app work on the 3.0 test system?

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 6:09pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/10 "2023-05-22T18:09:13Z")

</div>

Websockets through the haproxy server works with the 2.0.31 version. The shell app does work but ssh does not go through the haproxy server.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 22, 2023, 6:17pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/11 "2023-05-22T18:17:10Z")

</div>

Maybe there’s a websockify version mismatch. We run websockfiy 0.8.0 with no issue. Did the compute node you’re getting these jobs on change as well or are the compute nodes the same for OOD 3.0 and 2.0?

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 6:18pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/12 "2023-05-22T18:18:20Z")

</div>

They are the same version. We have not upgraded the websockify version.

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 6:20pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/13 "2023-05-22T18:20:45Z")

</div>

The version we are running is also 0.8.0 on the compute nodes.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 22, 2023, 6:37pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/14 "2023-05-22T18:37:47Z")

</div>

Maybe there’s a cache issue? Can you try in a private window?

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 6:44pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/15 "2023-05-22T18:44:41Z")

</div>

Same thing happens with a private window. I can see that the websocket is there in the haproxy log file when I try to connect to it.

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 7:23pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/16 "2023-05-22T19:23:44Z")

</div>

Maybe it does have something to do with the response header I have above when I refresh the screen:

400 Client must support ‘binary’ or ‘base64’ protocol

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 7:56pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/17 "2023-05-22T19:56:35Z")

</div>

I’ve modified the websock.js file to change:  
open(uri, protocols) {  
this.attach(new WebSocket(uri, protocols));  
}  
to:  
open(uri, protocols) {  
this.attach(new WebSocket(uri, [‘binary’, ‘base64’]));  
}  
But I can’t seem to get the new code to run except in private window but it does start the websocket connection. What do I need to do in my regular browser to get the new javascript code to update?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 22, 2023, 8:15pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/18 "2023-05-22T20:15:21Z")

</div>

Clear your browsers cache.

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 22, 2023, 8:20pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/19 "2023-05-22T20:20:08Z")

</div>

Yes I just did that.

So why do I have to modify the protocols to start a new websocket in 3.0.1 and not the earlier 2.0.x versions?

---

<div class="post-metadata">

**Author:** ![rsand](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rsand/32/743_2.png) [@rsand](https://discourse.openondemand.org/u/rsand)\
**Post date:** [May 23, 2023, 12:53pm UTC](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711/20 "2023-05-23T12:53:54Z")

</div>

I am running the latest version of RHEL 8 with the latest OS updates as of two weeks ago and it is a fresh install of the OS and Open Ondemand 3.0.1.

[Next page](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server-ondemand-3-0-1/2711.md?page=2)
