vosk-server icon indicating copy to clipboard operation
vosk-server copied to clipboard

ERROR:websockets.server:Error in connection handler

Open ch930410 opened this issue 1 year ago • 8 comments

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 105, in read data = await reader(2) File "/usr/lib/python3.9/asyncio/streams.py", line 723, in readexactly await self._wait_for_data('readexactly') File "/usr/lib/python3.9/asyncio/streams.py", line 517, in _wait_for_data await self._waiter asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/websockets/server.py", line 191, in handler await self.ws_handler(self, path) File "/opt/vosk-server/websocket/./asr_server.py", line 38, in recognize message = await websocket.recv() File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 509, in recv await self.ensure_open() File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 812, in ensure_open raise self.connection_closed_exc() websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason INFO:root:Connection from ('172.17.0.1', 37984) INFO:root:Config {'sample_rate': 8000} INFO:root:Connection from ('172.17.0.1', 37988) INFO:root:Config {'sample_rate': 8000} INFO:root:Connection from ('172.17.0.1', 37992) INFO:root:Config {'sample_rate': 8000} INFO:root:Connection from ('172.17.0.1', 37996) INFO:root:Connection from ('172.17.0.1', 38000)

ch930410 avatar Apr 26 '23 02:04 ch930410

Some client closes the connection. What is the issue exactly?

nshmyrev avatar Apr 26 '23 07:04 nshmyrev

after I click on the connection, I will give you an error like this image

ch930410 avatar Apr 26 '23 07:04 ch930410

Feels like no permission to record audio in the browser, did you check that, it is in the address line

nshmyrev avatar Apr 26 '23 08:04 nshmyrev

audio permissions are enabled. image

ch930410 avatar Apr 26 '23 08:04 ch930410

I see, you can not stream from localhost that is a chrome restriction. You need https connection.

nshmyrev avatar Apr 26 '23 08:04 nshmyrev

according to google official instructions, localhost is considered a security source on HTTP; I don't quite understand why this is the case; Thank you very much; I will deploy the project to the server and take a look;

ch930410 avatar Apr 26 '23 08:04 ch930410

There is "chrome://flags/#unsafely-treat-insecure-origin-as-secure" i believe

https://www.chromium.org/Home/chromium-security/deprecating-powerful-features-on-insecure-origins/

nshmyrev avatar Apr 26 '23 08:04 nshmyrev

I have already configured it, it's useless image

ch930410 avatar Apr 26 '23 08:04 ch930410