Skip to content
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

ERROR:websockets.server:Error in connection handler #223

Open
ch930410 opened this issue Apr 26, 2023 · 8 comments
Open

ERROR:websockets.server:Error in connection handler #223

ch930410 opened this issue Apr 26, 2023 · 8 comments

Comments

@ch930410
Copy link

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)

@nshmyrev
Copy link
Contributor

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

@ch930410
Copy link
Author

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

@nshmyrev
Copy link
Contributor

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

@ch930410
Copy link
Author

audio permissions are enabled.
image

@nshmyrev
Copy link
Contributor

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

@ch930410
Copy link
Author

ch930410 commented Apr 26, 2023

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;

@nshmyrev
Copy link
Contributor

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/

@ch930410
Copy link
Author

ch930410 commented Apr 26, 2023

I have already configured it, it's useless
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants