alphacep / alphacep/vosk-server

"Incorrect Masking" Error in WebSocket Communication with Vosk Server

Open
#243 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.3k
Forks
317
PR merge metrics
No merged PRs in 30d

Description

I’m reaching out regarding a recurring issue with the Vosk server when interfacing with FreeSWITCH’s mod_vosk. We have a setup where FreeSWITCH with mod_vosk is on one EC2 instance, and the Vosk server on another, both using Debian. Despite following your setup instructions, we're stuck with an "incorrect masking" error in WebSocket communications.

Here's the situation:

Real-time transcription works fine most of the time.
We often run into an "incorrect masking" error during WebSocket communication. What's puzzling is that this doesn't always happen; sometimes the WebSocket connection stays up without any issues.

Error:
ERROR:websockets.server:Error in connection handler
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 827, in transfer_data
message = await self.read_message()
File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 895, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 971, in read_data_frame
frame = await self.read_frame(max_size)
File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 1047, in read_frame
frame = await Frame.read(
File "/usr/lib/python3/dist-packages/websockets/framing.py", line 116, in read
raise ProtocolError("incorrect masking")
websockets.exceptions.ProtocolError: incorrect masking

Steps we've taken:

Compiled and installed a custom libks library from Alphacep’s vosk-fix branch, aimed at addressing WebSocket issues. We made sure mod_vosk is linked to this custom libks, which we verified using the ldd command.

Our Vosk server is set up using the standard Docker command:
docker run -d -p 2700:2700 alphacep/kaldi-en:latest

Despite these measures, the "incorrect masking" error keeps cropping up. It's hit or miss – sometimes it occurs, other times everything works smoothly. Any advice or suggestions you can provide to get past this would be appreciated. Let me know if you need logs or more details.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.