sevenjike opened a new issue, #12733:
URL: https://github.com/apache/apisix/issues/12733
### Current Behavior
Description:
A warning has been observed in the logs indicating a potential failure in
parsing Server-Sent Events (SSE) data at line 116 of open-base.lua. The
body_reader() function may split the data stream in such a way that an
incomplete data chunk is received, leading to a JSON decoding error.
Problem Analysis:
The log shows that the SSE data chunk is truncated mid-JSON object (at the
"delta": field), causing the JSON parser to encounter an unexpected end of data
(T_END). This suggests that the body_reader() might not be correctly handling
chunk boundaries, resulting in incomplete data being passed for parsing.
### Expected Behavior
The body_reader() should ensure that each data chunk passed to the parser is
a complete SSE data item (i.e., a full JSON object).
### Error Logs
2025/11/06 10:53:05 [warn] 50#50: *47775 [lua] openai-base.lua:118:
read_response(): failed to decode SSE data: Expected value but found T_END at
character 230
chunk: data:
{"id":"endpoint_common_815633","object":"chat.completion.chunk","created":1762396508,"model":"DeepSeek-R1-Distill-Qwen-32B","usage":{"prompt_tokens":1644,"completion_tokens":655,"total_tokens":2299},"choices":[{"index":0,"delta":,
client: 127.0.0.1,
server: _,
request: "POST /deepseek-r1/v1/chat/completions HTTP/1.1",
host: "127.0.0.1:49080"
### Steps to Reproduce
1.Start the Docker environment
2.Configure the AI-Proxy to proxy the DeepSeek-R1 model
### Environment
- APISIX version (run `apisix version`):3.14.0
- Operating system (run `uname -a`): docker 环境
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
openresty/1.27.1.2
- etcd version, if relevant (run `curl
http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant: 3.0.1
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]