[bitwarden_rs::api::notifications][ERROR] when trying to enable websocket #1006

Closed
opened 2026-02-04 23:36:54 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @ghost on GitHub (Apr 7, 2021).

Subject of the issue

[bitwarden_rs::api::notifications][ERROR] when trying to enable websocket
I couldn't find the same error documented before.

Deployment environment

Deployed on docker (bitwardenrs/server:latest)
Behind the linuxserver SWAG nginx reverse proxy, bitwarden on a subfolder
Normal password syncing work flawlessly.
But websocket doesn't work (tested between web vault and firefox extension)

Steps to reproduce

This is my docker compose (I didn't open any ports because I'm trying to use upstream app.):

---
version: "3"
services:
  bitwarden:
    image: bitwardenrs/server:latest
    container_name: bitwarden
    security_opt:
      - no-new-privileges
    environment:
     - PUID=1000
     - PGID=1000
     - WEBSOCKET_ENABLED=true
     - SIGNUPS_ALLOWED=false
     - DOMAIN=https://MYDOMAIN.com/bitwarden
     - LOG_FILE=/data/bitwarden.log
     - LOG_LEVEL=warn
     - EXTENDED_LOGGING=true
    volumes:
      - /Docker/bitwarden:/data
    restart: always

This is my nginx proxy, default setting from SWAG:

location /bitwarden {
    return 301 $scheme://$host/bitwarden/;
}

location ^~ /bitwarden/ {
    include /config/nginx/proxy.conf;
    resolver 127.0.0.11 valid=30s;
    set $upstream_app bitwarden;
    set $upstream_port 80;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}

location /notifications/hub {
    include /config/nginx/proxy.conf;
    resolver 127.0.0.11 valid=30s;
    set $upstream_app bitwarden;
    set $upstream_port 3012;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}

location /notifications/hub/negotiate {
    include /config/nginx/proxy.conf;
    resolver 127.0.0.11 valid=30s;
    set $upstream_app bitwarden;
    set $upstream_port 80;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}

Expected behaviour

Expect websocket to work. For example, for a security note to sync immediately between web vault and extensions.

Actual behaviour

Doesn't work.

Troubleshooting data

When I go to https://MYDOMAIN.com/notifications/hub, it shows the message on a html page:

WebSocket Protocol Error: Unable to parse WebSocket key

Checking the docker logs:

[parity_ws::handler][ERROR] WS Error <Protocol>: Unable to parse WebSocket key.
[bitwarden_rs::api::notifications][ERROR] 
 ###########################################################
    '/notifications/hub' should be proxied to the websocket server or notifications won't work.
    Go to the Wiki for more info, or disable WebSockets setting WEBSOCKET_ENABLED=false.
###########################################################################################

Note that I have a catchall server in nginx but I don't think that's the problem.

Anyway, any help would be appreciated. Thank you!

Originally created by @ghost on GitHub (Apr 7, 2021). ### Subject of the issue [bitwarden_rs::api::notifications][ERROR] when trying to enable websocket I couldn't find the same error documented before. ### Deployment environment Deployed on docker (bitwardenrs/server:latest) Behind the linuxserver SWAG nginx reverse proxy, bitwarden on a subfolder Normal password syncing work flawlessly. But websocket doesn't work (tested between web vault and firefox extension) ### Steps to reproduce This is my docker compose (I didn't open any ports because I'm trying to use upstream app.): ``` --- version: "3" services: bitwarden: image: bitwardenrs/server:latest container_name: bitwarden security_opt: - no-new-privileges environment: - PUID=1000 - PGID=1000 - WEBSOCKET_ENABLED=true - SIGNUPS_ALLOWED=false - DOMAIN=https://MYDOMAIN.com/bitwarden - LOG_FILE=/data/bitwarden.log - LOG_LEVEL=warn - EXTENDED_LOGGING=true volumes: - /Docker/bitwarden:/data restart: always ``` This is my nginx proxy, default setting from SWAG: ``` location /bitwarden { return 301 $scheme://$host/bitwarden/; } location ^~ /bitwarden/ { include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_app bitwarden; set $upstream_port 80; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; } location /notifications/hub { include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_app bitwarden; set $upstream_port 3012; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; } location /notifications/hub/negotiate { include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_app bitwarden; set $upstream_port 80; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; } ``` ### Expected behaviour Expect websocket to work. For example, for a security note to sync immediately between web vault and extensions. ### Actual behaviour Doesn't work. ### Troubleshooting data When I go to https://MYDOMAIN.com/notifications/hub, it shows the message on a html page: `WebSocket Protocol Error: Unable to parse WebSocket key` Checking the docker logs: ``` [parity_ws::handler][ERROR] WS Error <Protocol>: Unable to parse WebSocket key. [bitwarden_rs::api::notifications][ERROR] ########################################################### '/notifications/hub' should be proxied to the websocket server or notifications won't work. Go to the Wiki for more info, or disable WebSockets setting WEBSOCKET_ENABLED=false. ########################################################################################### ``` Note that I have a catchall server in nginx but I don't think that's the problem. Anyway, any help would be appreciated. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1006