Conversation Not Exists #9096

Closed
opened 2026-02-21 18:30:34 -05:00 by yindo · 0 comments
Owner

Originally created by @imaxwen on GitHub (Mar 4, 2025).

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.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Call dify's chat api /chat-messages with an empty conversation_id first time:

my application log:

bot-api  | INFO:APIClient:Request dify app with: 
bot-api  | {
bot-api  |   "inputs": {
bot-api  |     "session_type": "private",
bot-api  |     "has_group": "no"
bot-api  |   },
bot-api  |   "query": "hi there~",
bot-api  |   "response_mode": "blocking",
bot-api  |   "conversation_id": null,
bot-api  |   "user": "TestUser_5728",
bot-api  |   "files": null
bot-api  | }

Dify's chat api response:

bot-api  |  {
  "event": "message",
  "task_id": "e0655075-f1a4-4e9b-ac2d-d182206d11bc",
  "id": "f13817ad-e923-4c6b-acbb-b0fad4ef54ed",
  "message_id": "f13817ad-e923-4c6b-acbb-b0fad4ef54ed",
  "conversation_id": "857422d9-b321-408a-95ea-b03436122c1e",
  "mode": "advanced-chat",
  "answer": "Hi, How can I assist you tody?",
  "metadata": {
    "usage": {
      "prompt_tokens": 1368,
      "prompt_unit_price": "0.0",
      "prompt_price_unit": "0.0",
      "prompt_price": "0.0",
      "completion_tokens": 60,
      "completion_unit_price": "0.0",
      "completion_price_unit": "0.0",
      "completion_price": "0.0",
      "total_tokens": 1428,
      "total_price": "0.0",
      "currency": "USD",
      "latency": 10.894286551512778
    }
  },
  "created_at": 1740985593
}

Then I cached this conversation_id into my redis instance to associate the user_id in my system with dify's conversation_id

  1. Then Another user message from my chat app comes. I continue the conversation with the conversation_id from the response.(IMPORTANT: The intervals between the two calls are very short, around 500ms. )

I got conversation_id above from my redis instance.

and the request log:

bot-api  | INFO:APIClient:Request dify app with: 
bot-api  | {
bot-api  |   "inputs": {
bot-api  |     "session_type": "private",
bot-api  |     "has_group": "no"
bot-api  |   },
bot-api  |   "query": "Please introduce yourself",
bot-api  |   "response_mode": "blocking",
bot-api  |   "conversation_id": "857422d9-b321-408a-95ea-b03436122c1e",
bot-api  |   "user": "TestUser_5728",
bot-api  |   "files": null
bot-api  | }
  1. Dify api response an Conversation Not Exists error:
bot-api  | INFO:APIClient:Dify app Response: 
bot-api  | {'code': 'not_found', 'message': 'Conversation Not Exists.', 'status': 404}

My assumption: It is possible that dify uses uuid as conversation_id. During the first session, the conversation_id returned in the response was not actually stored in dify's database. In a very short interval, I used this conversation_id to initiate subsequent sessions, which led to this 404 error.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @imaxwen on GitHub (Mar 4, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Call dify's chat api `/chat-messages` with an empty conversation_id first time: my application log: ``` bot-api | INFO:APIClient:Request dify app with: bot-api | { bot-api | "inputs": { bot-api | "session_type": "private", bot-api | "has_group": "no" bot-api | }, bot-api | "query": "hi there~", bot-api | "response_mode": "blocking", bot-api | "conversation_id": null, bot-api | "user": "TestUser_5728", bot-api | "files": null bot-api | } ``` Dify's chat api response: ``` bot-api | { "event": "message", "task_id": "e0655075-f1a4-4e9b-ac2d-d182206d11bc", "id": "f13817ad-e923-4c6b-acbb-b0fad4ef54ed", "message_id": "f13817ad-e923-4c6b-acbb-b0fad4ef54ed", "conversation_id": "857422d9-b321-408a-95ea-b03436122c1e", "mode": "advanced-chat", "answer": "Hi, How can I assist you tody?", "metadata": { "usage": { "prompt_tokens": 1368, "prompt_unit_price": "0.0", "prompt_price_unit": "0.0", "prompt_price": "0.0", "completion_tokens": 60, "completion_unit_price": "0.0", "completion_price_unit": "0.0", "completion_price": "0.0", "total_tokens": 1428, "total_price": "0.0", "currency": "USD", "latency": 10.894286551512778 } }, "created_at": 1740985593 } ``` Then I cached this `conversation_id` into my redis instance to associate the `user_id` in my system with dify's `conversation_id` 2. Then Another user message from my chat app comes. I continue the conversation with the conversation_id from the response.**(IMPORTANT: The intervals between the two calls are very short, around 500ms. )** I got `conversation_id` above from my redis instance. and the request log: ``` bot-api | INFO:APIClient:Request dify app with: bot-api | { bot-api | "inputs": { bot-api | "session_type": "private", bot-api | "has_group": "no" bot-api | }, bot-api | "query": "Please introduce yourself", bot-api | "response_mode": "blocking", bot-api | "conversation_id": "857422d9-b321-408a-95ea-b03436122c1e", bot-api | "user": "TestUser_5728", bot-api | "files": null bot-api | } ``` 3. Dify api response an `Conversation Not Exists` error: ``` bot-api | INFO:APIClient:Dify app Response: bot-api | {'code': 'not_found', 'message': 'Conversation Not Exists.', 'status': 404} ``` My assumption: It is possible that dify uses uuid as conversation_id. During the first session, the conversation_id returned in the response was not actually stored in dify's database. In a very short interval, I used this conversation_id to initiate subsequent sessions, which led to this 404 error. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:30:34 -05:00
yindo closed this issue 2026-02-21 18:30:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#9096