The sys.user_id obtained in the workflow is incorrect,the pg database stores the session_id. #11234

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

Originally created by @zhoujian3314 on GitHub (Mar 16, 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

I have deployed Dify locally and am trying to retrieve conversation history via the API. The user and conversation_id values are obtained from the Dify admin logs, so I am certain they are correct. However, when calling the /v1/messages API, it returns a 404 error with the message "Conversation Not Exists." Additionally, the /v1/conversations API returns an empty list, indicating no conversations exist for the user. Upon investigating the PostgreSQL database, I found that the from_end_user_id in the conversations table does not match the provided user ID, and the user ID I used matches the session_id in the end_users table, which seems incorrect and confusing.

In my Dify customer service application, I’m using an HTTP request node in the workflow to call the following API:
[http://api:5001/v1/messages?user={{#sys.user_id#}}&conversation_id={{#sys.conversation_id#}}]

However, this API call returns the following error:
json

{
"code": "not_found",
"message": "Conversation Not Exists.",
"status": 404
}

I tested the following API request as a temporary workaround:
GET http://127.0.0.1/v1/messages?user=f9a5e41c-c64b-41db-b748-b219af0ca187&conversation_id=f0303eb8-8110-4f4c-8a28-3bd6f3af65ba

Response:
json

{
"code": "not_found",
"message": "Conversation Not Exists.",
"status": 404
}

Image
Image
Image
Image
Image
Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @zhoujian3314 on GitHub (Mar 16, 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 I have deployed Dify locally and am trying to retrieve conversation history via the API. The user and conversation_id values are obtained from the Dify admin logs, so I am certain they are correct. However, when calling the /v1/messages API, it returns a 404 error with the message "Conversation Not Exists." Additionally, the /v1/conversations API returns an empty list, indicating no conversations exist for the user. Upon investigating the PostgreSQL database, I found that the from_end_user_id in the conversations table does not match the provided user ID, and the user ID I used matches the session_id in the end_users table, which seems incorrect and confusing. In my Dify customer service application, I’m using an HTTP request node in the workflow to call the following API: [http://api:5001/v1/messages?user={{#sys.user_id#}}&conversation_id={{#sys.conversation_id#}}] However, this API call returns the following error: json { "code": "not_found", "message": "Conversation Not Exists.", "status": 404 } I tested the following API request as a temporary workaround: GET http://127.0.0.1/v1/messages?user=f9a5e41c-c64b-41db-b748-b219af0ca187&conversation_id=f0303eb8-8110-4f4c-8a28-3bd6f3af65ba Response: json { "code": "not_found", "message": "Conversation Not Exists.", "status": 404 } ![Image](https://github.com/user-attachments/assets/eff4908d-e336-48a4-9039-1b1442cace1d) ![Image](https://github.com/user-attachments/assets/8d8864c8-2166-47d2-9740-dc290f45b0a2) ![Image](https://github.com/user-attachments/assets/c19eaff4-1468-4bb8-87bf-9a4d596567f0) ![Image](https://github.com/user-attachments/assets/7294a69e-4860-4543-b3a0-56870a3be63d) ![Image](https://github.com/user-attachments/assets/11fbaf35-3b08-4308-a26b-de2f5f05d26b) ![Image](https://github.com/user-attachments/assets/2f4a385a-5920-4ac9-8541-ff903eb568ea) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:57:14 -05:00
yindo closed this issue 2026-02-21 18:57:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#11234