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

Suddenly refresh the page during the chat and ask again for an error #13750

Open
5 tasks done
xingwenkai opened this issue Feb 14, 2025 · 4 comments
Open
5 tasks done
Labels
🐞 bug Something isn't working

Comments

@xingwenkai
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

main

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When the chat assistant asks the model, the model gives a reply and suddenly refreshes the page. At this time, there will be a blank chat box (if the knowledge base is mounted, there will still be a knowledge base file under the blank chat box). At this time, ask the model again and an error will be reported

Image

✔️ Expected Behavior

If you suddenly refresh the page, the blank chat box will not appear

❌ Actual Behavior

When the chat assistant asks the model, the model gives a reply and suddenly refreshes the page. At this time, there will be a blank chat box (if the knowledge base is mounted, there will still be a knowledge base file under the blank chat box). At this time, ask the model again and an error will be reported

Copy link

dosubot bot commented Feb 14, 2025

Hey @xingwenkai! 👋 I'm here to help you with bugs, questions, and becoming a contributor. Feel free to ask for assistance while waiting for a human maintainer.

The issue you're experiencing with the blank chat box and the "Request param content len should not be 0" error after a page refresh is likely related to session management and input validation in Dify.

  1. Session Management: Dify uses a conversation_id to maintain chat state persistence across page refreshes. Ensure that the conversation_id is correctly maintained and included in subsequent API calls to avoid losing the chat state [1][2].

  2. Input Validation: The error message "Request param content len should not be 0" indicates that the API request is being sent with an empty content parameter. This could happen if the chat input is not properly captured or sent after a page refresh. Make sure that the input field is correctly populated before making the API request.

To resolve the issue, you may need to check the implementation of how the conversation_id is managed and ensure that the input content is correctly captured and validated before sending the request.

To continue talking to Dosu, mention @dosu.


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

@dosubot dosubot bot added the 🐞 bug Something isn't working label Feb 14, 2025
@xingwenkai
Copy link
Author

I deployed it using docker, how should I manage conversation_id

Copy link

dosubot bot commented Feb 14, 2025

To manage conversation_id when deploying Dify using Docker, follow these steps:

  1. Starting a New Conversation: Omit the conversation_id field in your initial API request. The system will generate and return a new conversation_id.

  2. Continuing a Conversation: Use the system-generated conversation_id from your initial request in subsequent API calls to maintain the conversation flow. Ensure that the conversation_id is included in future interactions to continue the dialogue.

  3. Handling Existing Sessions: When a previous conversation_id is passed, any new inputs will be ignored, and only the query is processed for the ongoing conversation.

Avoid using custom or user-defined conversation_id values, as this will result in a 'conversation not exists' error. You can also manage dynamic variables during the session using conversation variables to adjust the bot's behavior or responses [1][2].

To continue talking to Dosu, mention @dosu.


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

@xingwenkai
Copy link
Author

But I didn't use his api, I just ran it, all the chats are based on their own pages, and I can't capture the conversation_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant