# Websocket connection to admin console (adminws) is failing

**URL:** <https://forum.collaboraonline.com/t/websocket-connection-to-admin-console-adminws-is-failing/475>\
**Category:** User Support\
**Created:** [July 18, 2021, 12:44pm UTC](https://forum.collaboraonline.com/t/websocket-connection-to-admin-console-adminws-is-failing/475 "2021-07-18T12:44:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thk](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thk](https://forum.collaboraonline.com/u/thk)\
**Post date:** [July 18, 2021, 12:44pm UTC](https://forum.collaboraonline.com/t/websocket-connection-to-admin-console-adminws-is-failing/475/1 "2021-07-18T12:44:42Z")

</div>

I enabled the Admin console and open it at `https://$MYSERVER/loleaflet/dist/admin/admin.html`. I get the error message “Der Server wurde heruntergefahren, bitte laden Sie die Seite neu.” (“Server has been shut down; please reload the page.”).

In the browser console (Chromium, Debian Testing) I see:

`WebSocket connection to 'wss://$MYSERVER/lool/adminws/' failed`

I also tried incognito mode and Firefox.

I installed the CODE Debian packages, loolwsd has version 6.4.10-4. The Apache config is exactly as described for Apache (terminating):  
[https://sdk.collaboraonline.com/docs/installation/Proxy\_settings.html#reverse-proxy-settings-in-apache2-config-ssl-termination](https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html#reverse-proxy-settings-in-apache2-config-ssl-termination)

The Apache access log shows a 400 HTTP error:

`"GET /lool/adminws/ HTTP/1.1" 400 717 "-"`

loolwsl.xml (stripped and redacted):

```auto
<ssl>
  <enable>false</enable>
  <termination>true</termination>
  <cert_file_path relative="false">/etc/loolwsd/cert.pem</cert_file_path>
  <key_file_path relative="false">/etc/loolwsd/key.pem</key_file_path>
  <ca_file_path relative="false">/etc/loolwsd/ca-chain.cert.pem</ca_file_path>
  <cipher_list />
  <hpkp enable="false" report_only="false">
    <max_age enable="true">1000</max_age>
    <report_uri enable="false"/>
    <pins>
      <pin/>
    </pins>
  </hpkp>
</ssl>
<admin_console>
  <enable>true</enable>
  <enable_pam>false</enable_pam>
  <username>REDACTED</username>
  <password />
  <secure_password>REDACTED</secure_password>
</admin_console>

```

This is shown in the loolwsd logs when the websocket request comes in:

```auto
[websrv_poll] INF #30: Client HTTP Request: GET /lool/adminws/ HTTP/1.1 / Host: $MYHOST/REDACTED / Pragma: no-cache / Cache-Control: no-cache / User-Agent: REDACTED / Origin: $MYHOST/REDACTED / Sec-WebSocket-Version: 13 / Accept-Encoding: gzip, deflate, br / Accept-Language: de,en-US;q=0.9,en;q=0.8,ro;q=0.7 / Sec-WebSocket-Key: REDACTED / Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits / X-Forwarded-For: REDACTED / X-Forwarded-Host: REDACTED / X-Forwarded-Server: REDACTED / Connection: Keep-Alive| net/Socket.cpp:903
[websrv_poll] INF Handling request: /lool/adminws/| wsd/LOOLWSD.cpp:2557
[websrv_poll] INF Admin request: /lool/adminws/| wsd/LOOLWSD.cpp:2596
[websrv_poll] INF Admin::handleInitialRequest bad request| wsd/Admin.cpp:378

```

So this if condition in [wsd/Admin.cpp#L364](https://github.com/CollaboraOnline/online/blob/2afbc5269e89662100bef8e3cada087f027a75a8/wsd/Admin.cpp#L364) is not true:

`if (request.find("Upgrade") != request.end() && Util::iequal(request["Upgrade"], "websocket"))`

However I double checked in the Browser console that the request sends the Upgrade header (with uppercase ‘U’) with value “websocket”. I even changed the Apache config to explicitly set the Upgrade header in case it gets lost:

```auto
  <Location "/lool/adminws">
    ProxyPass ws://127.0.0.1:9980/lool/adminws
    RequestHeader set Upgrade websocket
  </Location>

```

The websocket requests to `/lool/(.*)/ws/lool/(.*)/ws` work.

---

<div class="post-metadata">

**Author:** ![thk](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thk](https://forum.collaboraonline.com/u/thk)\
**Post date:** [July 18, 2021, 1:20pm UTC](https://forum.collaboraonline.com/t/websocket-connection-to-admin-console-adminws-is-failing/475/2 "2021-07-18T13:20:04Z")

</div>

Duplicate issue report in this forum:

> [@Code: Cannot launch admin console after update](https://forum.collaboraonline.com/t/code-cannot-launch-admin-console-after-update/477):
>
> Hi Community, On my Ubuntu 20.04 device I have installed collabora code with the apt-get paket manager - based on this [wiki](https://www.linuxbabe.com/ubuntu/integrate-collabora-onlinenextcloud-without-docker) . All worked fine. Now I have performed an update, which also affected collabora code - its now given in version: LOOLWSD 6.4.10 LOKit Collabora Office 6.4-44 The update made some mods on the t/etc/loolwsd/loolwsd.xml so I repeated the following config commands, which I already executed when I installed this initially: loolconfig set ssl.enable false loolconfig set ss…

I opened a GitHub issue:

> <https://github.com/CollaboraOnline/online/issues/2910>
>
> The bug is described here:
> https://forum.collaboraonline.com/t/websocket-connec…tion-to-admin-console-adminws-is-failing/475
> 
> Duplicate issue:
> https://forum.collaboraonline.com/t/code-cannot-launch-admin-console-after-update/477
> 
> TL;DR:
> \- Error message: “Server has been shut down; please reload the page.”
> \- websocket connection failing
> \- log: \`Admin::handleInitialRequest bad request| wsd/Admin.cpp:378\`
> \- This if should be true but isn't:
> \`if (request.find("Upgrade") != request.end() && Util::iequal(request\["Upgrade"\], "websocket"))\`
> \- This commit touched the line recently: https://github.com/CollaboraOnline/online/commit/54a10729f3b5ac5913a051a0b810214e30a5b83a

---

<div class="post-metadata">

**Author:** ![bearon](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@bearon](https://forum.collaboraonline.com/u/bearon)\
**Post date:** [October 14, 2021, 6:20pm UTC](https://forum.collaboraonline.com/t/websocket-connection-to-admin-console-adminws-is-failing/475/3 "2021-10-14T18:20:08Z")

</div>

Adding a piece of detail from the linked issue here: it seems that Apache version 2.4.51 fixed the regression causing this bug.
