Skip to content

[Bug] ERROR:websockets.server:opening handshake failed #2638

@jingzl

Description

@jingzl

🐛 问题描述

0.8.9版本全模块docker部署,后台不定时报错,如下:
251203 20:29:28[0.8.9-00000000000000][core.utils.gc_manager]-INFO-启动全局GC管理器,间隔300秒
251203 20:29:30[0.8.9-00000000000000][core.providers.vad.silero]-INFO-SileroVAD
251203 20:29:30[0.8.9-00000000000000][core.utils.modules_initialize]-INFO-初始化组件: vad成功 VAD_SileroVAD
251203 20:29:39[0.8.9-00000000000000][core.providers.asr.fun_local]-INFO-funasr version: 1.2.7.
251203 20:29:39[0.8.9-00000000000000][core.utils.modules_initialize]-INFO-ASR模块初始化完成
251203 20:29:39[0.8.9-00000000000000][core.utils.modules_initialize]-INFO-初始化组件: asr成功 ASR_FunASR
251203 20:29:39[0.8.9-00000000000000][main]-INFO-视觉分析接口是 http://172.22.0.4:8003/mcp/vision/explain
251203 20:29:39[0.8.9-00000000000000][main]-INFO-Websocket地址是 ws://172.22.0.4:8000/xiaozhi/v1/
251203 20:29:39[0.8.9-00000000000000][main]-INFO-=======上面的地址是websocket协议地址,请勿用浏览器访问=======
251203 20:29:39[0.8.9-00000000000000][main]-INFO-如想测试websocket请用谷歌浏览器打开test目录下的test_page.html
251203 20:29:39[0.8.9-00000000000000][main]-INFO-=============================================================

ERROR:websockets.server:opening handshake failed
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/websockets/http11.py", line 138, in parse
request_line = yield from parse_line(read_line)
File "/usr/local/lib/python3.10/site-packages/websockets/http11.py", line 310, in parse_line
raise EOFError("line without CRLF")
EOFError: line without CRLF

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

Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/websockets/server.py", line 562, in parse
request = yield from Request.parse(
File "/usr/local/lib/python3.10/site-packages/websockets/http11.py", line 140, in parse
raise EOFError("connection closed while reading HTTP request line") from exc
EOFError: connection closed while reading HTTP request line

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

Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/websockets/asyncio/server.py", line 354, in conn_handler
await connection.handshake(
File "/usr/local/lib/python3.10/site-packages/websockets/asyncio/server.py", line 205, in handshake
raise self.protocol.handshake_exc
websockets.exceptions.InvalidMessage: did not receive a valid HTTP request
ERROR:websockets.server:opening handshake failed
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/websockets/http11.py", line 138, in parse
request_line = yield from parse_line(read_line)
File "/usr/local/lib/python3.10/site-packages/websockets/http11.py", line 310, in parse_line
raise EOFError("line without CRLF")
EOFError: line without CRLF

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

Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/websockets/server.py", line 562, in parse
request = yield from Request.parse(
File "/usr/local/lib/python3.10/site-packages/websockets/http11.py", line 140, in parse
raise EOFError("connection closed while reading HTTP request line") from exc
EOFError: connection closed while reading HTTP request line

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

Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/websockets/asyncio/server.py", line 354, in conn_handler
await connection.handshake(
File "/usr/local/lib/python3.10/site-packages/websockets/asyncio/server.py", line 205, in handshake
raise self.protocol.handshake_exc
websockets.exceptions.InvalidMessage: did not receive a valid HTTP request

🖥️ 环境信息

  • 部署方式: 全模块部署
  • 版本号: 例如 0.8.9

🔍 告诉我们,应该怎么复现这个问题

部署完毕后,配置完成,使用test_page正常交互几次,过段时间,查看server端日志,报错。

🤔 你原本希望是怎么样的

不报错

😯 提供一些截图

Image

📋 其他信息

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions