-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
websockets.server:Error in connection handler #231
Comments
'Incorrect masking' error means you are using wrong libks, you need our fork with a fix. |
I'm using the official docker image, so there might be a bug there then it's worth fixing. @nshmyrev Could you please tell me where it can be downloaded and if it can be used in docker? |
|
You need to solve masking issue |
Can you see it now? |
You need to install libks on freeswitch side, not on the vosk side. Freeswitch links with libks for websocket. connection. |
I compiled the lib on a separate server, git clone --branch vosk-fix --single-branch https://github.com/alphacep/libks cmake . copied the libks.so.1 library to Freeswitch mv /usr/lib/libks.so.1 /usr/lib/libks.so.1.bak ls -l | grep lib service freeswitch restart I checked the performance, I did not notice any changes in the work. I looked at the changes, there are practically no corrections Tell me, maybe I compiled it somehow wrong, maybe I need to use some keys or do it directly on the freeswitch server? |
Do you still see |
Unfortunately, after replacing the library and restarting Freeswitch, the situation did not change at all: INFO:root:Connection from ('10.1.2.2', 42846) The above exception was the direct cause of the following exception: Traceback (most recent call last): |
I see masking issue went away. It should be better now. Do you get recognition results in freeswitch or what? |
I'll check. In the evening I will upload this library to the rest of FS and look at the results. cat detected_speech.lua cat dialplan.lua |
I replaced the lib (libks.so.1), unfortunately there is an error in the log: INFO:root:Connection from ('10.2.1.2', 39046) The above exception was the direct cause of the following exception: Traceback (most recent call last): |
You have masking message again. I'm sorry I will not repeat myself |
I use alphacep/kaldi together with freeswitch mod_vosk every time when freeswich accesses kaldi this error pops up, while the module fulfills the request. But it seems to me that due to the fact that the load is quite high, this service loads the processor very much. Is there any way to fix this problem, or mute the error.
Is it possible somewhere in the settings to reduce the time for one session. As far as I know the time is 60 seconds, is it possible to do for example 30 seconds?
uname -a
Linux dk02 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f7bc1b08479 alphacep/kaldi-ru:latest "python3 ./asr_serve…" 2 months ago Up 21 minutes 0.0.0.0:2700->2700/tcp, :::2700->2700/tcp nifty_tharp
tail -f /var/lib/docker/containers/5f7bc1b08479f4e14c632462938df6b1e60c3c0a61db43d51b54d16fd44db1ca/5f7bc1b08479f4e14c632462938df6b1e60c3c0a61db43d51b54d16fd44db1ca-json.log
{"log":"INFO:root:Connection from ('10.3.0.9', 41660)\n","stream":"stderr","time":"2023-07-14T18:40:00.855462379Z"}
{"log":"ERROR:websockets.server:Error in connection handler\n","stream":"stderr","time":"2023-07-14T18:40:20.107813533Z"}
{"log":"Traceback (most recent call last):\n","stream":"stderr","time":"2023-07-14T18:40:20.107854279Z"}
{"log":" File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 827, in transfer_data\n","stream":"stderr","time":"2023-07-14T18:40:20.107860284Z"}
{"log":" message = await self.read_message()\n","stream":"stderr","time":"2023-07-14T18:40:20.107864689Z"}
{"log":" File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 895, in read_message\n","stream":"stderr","time":"2023-07-14T18:40:20.107868311Z"}
{"log":" frame = await self.read_data_frame(max_size=self.max_size)\n","stream":"stderr","time":"2023-07-14T18:40:20.107872012Z"}
{"log":" File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 971, in read_data_frame\n","stream":"stderr","time":"2023-07-14T18:40:20.107890052Z"}
{"log":" frame = await self.read_frame(max_size)\n","stream":"stderr","time":"2023-07-14T18:40:20.107894352Z"}
{"log":" File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 1047, in read_frame\n","stream":"stderr","time":"2023-07-14T18:40:20.107897758Z"}
{"log":" frame = await Frame.read(\n","stream":"stderr","time":"2023-07-14T18:40:20.107901397Z"}
{"log":" File "/usr/lib/python3/dist-packages/websockets/framing.py", line 116, in read\n","stream":"stderr","time":"2023-07-14T18:40:20.107904452Z"}
{"log":" raise ProtocolError("incorrect masking")\n","stream":"stderr","time":"2023-07-14T18:40:20.107907699Z"}
{"log":"websockets.exceptions.ProtocolError: incorrect masking\n","stream":"stderr","time":"2023-07-14T18:40:20.108038092Z"}
{"log":"\n","stream":"stderr","time":"2023-07-14T18:40:20.108044721Z"}
{"log":"The above exception was the direct cause of the following exception:\n","stream":"stderr","time":"2023-07-14T18:40:20.108047779Z"}
{"log":"\n","stream":"stderr","time":"2023-07-14T18:40:20.108051066Z"}
{"log":"Traceback (most recent call last):\n","stream":"stderr","time":"2023-07-14T18:40:20.108054064Z"}
{"log":" File "/usr/lib/python3/dist-packages/websockets/server.py", line 191, in handler\n","stream":"stderr","time":"2023-07-14T18:40:20.108057295Z"}
{"log":" await self.ws_handler(self, path)\n","stream":"stderr","time":"2023-07-14T18:40:20.10811902Z"}
{"log":" File "/opt/vosk-server/websocket/./asr_server.py", line 38, in recognize\n","stream":"stderr","time":"2023-07-14T18:40:20.108129606Z"}
{"log":" message = await websocket.recv()\n","stream":"stderr","time":"2023-07-14T18:40:20.108133162Z"}
{"log":" File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 509, in recv\n","stream":"stderr","time":"2023-07-14T18:40:20.108136303Z"}
{"log":" await self.ensure_open()\n","stream":"stderr","time":"2023-07-14T18:40:20.108139497Z"}
{"log":" File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 803, in ensure_open\n","stream":"stderr","time":"2023-07-14T18:40:20.108142811Z"}
{"log":" raise self.connection_closed_exc()\n","stream":"stderr","time":"2023-07-14T18:40:20.108218495Z"}
{"log":"websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason\n","stream":"stderr","time":"2023-07-14T18:40:20.108229049Z"}
The text was updated successfully, but these errors were encountered: