Websocket error log cannot be disabled #1206

Closed
opened 2026-02-20 08:08:15 -05:00 by deekerman · 1 comment
Owner

Originally created by @pichouk on GitHub (Jan 24, 2022).

Websocket error log cannot be disabled

When I set the variable LOG_LEVEL = "off" I still have log messages because of websocket malformed requests.

Encountered an error: WebSocket Protocol Error: Unable to parse WebSocket key.                                                                                                                                                                             Enable a logger to see more information.

Deployment environment

I deployed Vaultwarden using Kubernetes, on AWS. I use the container image vaultwarden/server:1.23.1.
I expose Vaultwarden using a AWS Application Load Balancer, which regularly send healtchecks to the container. Those healthchecks does not support Websocket, and I can't disable them. So I have malformed requests on the Websocket port.

I just want to hide the error message generated by the container when receiving a bad request on Websocket port.

Steps to reproduce

Start a Vaultwarden server with LOG_LEVEL="off" and send an HTTP request (using curl) to the websocket port.

Expected behaviour

I think those error logs should not be present when using the LOG_LEVEL="off" configuration.

Actual behaviour

I still have this messages

Encountered an error: WebSocket Protocol Error: Unable to parse WebSocket key.                                                                                                                                                                             Enable a logger to see more information.
Originally created by @pichouk on GitHub (Jan 24, 2022). ### Websocket error log cannot be disabled When I set the variable `LOG_LEVEL = "off"` I still have log messages because of websocket malformed requests. ``` Encountered an error: WebSocket Protocol Error: Unable to parse WebSocket key. Enable a logger to see more information. ``` ### Deployment environment I deployed Vaultwarden using Kubernetes, on AWS. I use the container image `vaultwarden/server:1.23.1`. I expose Vaultwarden using a AWS Application Load Balancer, which regularly send healtchecks to the container. Those healthchecks does not support Websocket, and I can't disable them. So I have malformed requests on the Websocket port. I just want to hide the error message generated by the container when receiving a bad request on Websocket port. ### Steps to reproduce Start a Vaultwarden server with `LOG_LEVEL="off"` and send an HTTP request (using curl) to the websocket port. ### Expected behaviour I think those error logs should not be present when using the `LOG_LEVEL="off"` configuration. ### Actual behaviour I still have this messages ``` Encountered an error: WebSocket Protocol Error: Unable to parse WebSocket key. Enable a logger to see more information. ```
deekerman 2026-02-20 08:08:15 -05:00
  • closed this issue
  • added the
    wontfix
    label
Author
Owner

@BlackDex commented on GitHub (Jan 24, 2022):

This is not something we can fix, since this is build-in into the library used for the websockets.
github.com/paritytech/ws-rs@24511a9d4b/src/handler.rs (L63-L70)

Also, if you see this error, then you probably have configured your reverse proxy incorrect, or, if not using a reverse proxy you need to disable websockets at all via WEBSOCKET_ENABLED=FALSE.

Also see: https://github.com/dani-garcia/vaultwarden/wiki/Enabling-WebSocket-notifications
And https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples

@BlackDex commented on GitHub (Jan 24, 2022): This is not something we can fix, since this is build-in into the library used for the websockets. https://github.com/paritytech/ws-rs/blob/24511a9d4ba5e485f625b9c90d0e4d5b2ec01243/src/handler.rs#L63-L70 Also, if you see this error, then you probably have configured your reverse proxy incorrect, or, if not using a reverse proxy you need to disable websockets at all via `WEBSOCKET_ENABLED=FALSE`. Also see: https://github.com/dani-garcia/vaultwarden/wiki/Enabling-WebSocket-notifications And https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#1206
No description provided.