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: Peer Closed Connection Without Sending Complete Message Body in Claude 3.5 (Sonnet 20240620) #12802

Open
5 tasks done
MitraSafarinejad opened this issue Jan 16, 2025 · 1 comment
Labels
🐞 bug Something isn't working outdated version smaller than 0.13.2

Comments

@MitraSafarinejad
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I encountered two issues while using the Dify platform with an agent powered by Claude 3.5 (Sonnet 20240620).

To reproduce this issue, I created an agent using Claude 3.5 (Sonnet 20240620) on the Dify platform. I initiated a conversation with the agent by sending a text message and continued exchanging messages. The conversation proceeded normally for the first 14 messages. In normal operation, the message field contains structured content, such as:

message: [{role: "user",...}, {role: "assistant",...}, {role: "user",...}, {role: "assistant",...}, {role: "user",...},...]

However, on the 14th message, the system stopped responding, and the following error was returned with an empty message field:

[anthropic] Error: peer closed connection without sending complete message body (incomplete chunked read)
message: ""
status: "error"

Attempting to continue the conversation by sending another message resulted in a second error instead of recovery:

[anthropic] Bad Request Error, Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.29: all messages must have non-empty content except for the optional final assistant message'}}

✔️ Expected Behavior

The agent should respond consistently without interruptions or errors.

❌ Actual Behavior

error occurred:

[anthropic] Error: peer closed connection without sending complete message body (incomplete chunked read)

[anthropic] Bad Request Error, Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.29: all messages must have non-empty content except for the optional final assistant message'}}

Copy link

dosubot bot commented Jan 16, 2025

I found a similar open issue titled "[azure_openai] Error: peer closed connection without sending complete message body (incomplete chunked read)" which might be related to the problem you're experiencing [1]. However, there is no solution found in the comments of that issue.

Additionally, there is a related discussion titled "Bug of Use Claude" that might provide some insights, but it remains unsolved [2].

Regarding the "peer closed connection" error, there isn't specific information available in the repository about the known causes or how the Dify platform handles message chunking that could lead to an incomplete chunked read. Similarly, for the "invalid_request_error," there are no specific requirements for message content documented in the repository.

For the Bad Request Error with code 400, the Dify platform has several error handling mechanisms in place, such as CompletionRequestError and ProviderNotInitializeError, which provide specific feedback and guidance on resolving issues [3][4][5]. However, these do not directly address the "invalid_request_error" you encountered.

You might want to check if there are any updates or patches available for the Dify platform that address these issues, or consider reaching out to the maintainers for further assistance.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the 🐞 bug Something isn't working label Jan 16, 2025
@crazywoola crazywoola added the outdated version smaller than 0.13.2 label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working outdated version smaller than 0.13.2
Projects
None yet
Development

No branches or pull requests

2 participants