"Conversation Not Exists" and "UAUTHORIZED" #15880

Closed
opened 2026-02-21 19:23:48 -05:00 by yindo · 5 comments
Owner

Originally created by @Richie666888 on GitHub (Aug 4, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.7.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Follow the steps on the official website to update.

https://docs.dify.ai/zh-hans/getting-started/install-self-hosted/docker-compose

✔️ Expected Behavior

1.System variables can be customized, for example: user_id
2.Can view the history of conversations.

Actual Behavior

1.You can view the historical conversations. Clicking on the link will show "Conversation Not Exists".
2.When embedding the webpage, modifying the system variable "user_id" results in displaying "UAUTHORIZED".

Originally created by @Richie666888 on GitHub (Aug 4, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.7.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Follow the steps on the official website to update. https://docs.dify.ai/zh-hans/getting-started/install-self-hosted/docker-compose ### ✔️ Expected Behavior 1.System variables can be customized, for example: user_id 2.Can view the history of conversations. ### ❌ Actual Behavior 1.You can view the historical conversations. Clicking on the link will show "Conversation Not Exists". 2.When embedding the webpage, modifying the system variable "user_id" results in displaying "UAUTHORIZED".
yindo added the 🐞 bug label 2026-02-21 19:23:48 -05:00
yindo closed this issue 2026-02-21 19:23:48 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 4, 2025):

Hi @Richie666888! I'm Dosu and I’m helping the dify team.

Both issues are related to recent changes in how Dify handles user/session identification and authorization.

For the "Conversation Not Exists" error: this usually happens if the user parameter (often sys.user_id) does not match the user who owns the conversation, or if you use a custom conversation_id instead of the system-generated one. Make sure you always use the conversation_id returned by the API when starting a conversation, and that the user parameter matches the from_end_user_id in the conversations table. If you’re accessing conversations via the API, you cannot retrieve those created via the web interface unless the user context matches exactly. Double-check that you’re not mixing up session_id and user_id, as this can also cause the error. The combination of user and conversation_id is the unique key for access—if either is wrong, you’ll see this error. More details and examples are here: "Conversation Not Exists" root causes and solutions, user/session mismatch.

For the "UAUTHORIZED" error when embedding and customizing user_id: starting from v1.7.0, Dify treats the passed user_id as a session_id and tries to match it to an existing EndUser. If it doesn’t find a match, it creates a new anonymous user, but if the session isn’t recognized, you get a 401 error and are redirected to login. To avoid this, the user_id you pass must exactly match an existing EndUser’s session_id for the same app and tenant. There’s no config to restore the old (pre-1.7.0) behavior. The best workaround is to ensure user_id is unique, stable, and consistent for each user, and that your app’s access mode is set to PUBLIC. If you pass a new or mismatched user_id, you’ll see repeated anonymous user creation and authorization failures. See the full explanation and workarounds here: "UAUTHORIZED" and embedding changes in 1.7.x.

If you’re still seeing issues, check your backend logs for more details on the failed requests, and verify the mapping between user/session IDs in your database. If you need persistent user identification in embedding, make sure the user_id you pass matches an existing session_id for your app.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 4, 2025): <!-- Greeting --> Hi @Richie666888! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Both issues are related to recent changes in how Dify handles user/session identification and authorization. For the "Conversation Not Exists" error: this usually happens if the user parameter (often sys.user_id) does not match the user who owns the conversation, or if you use a custom conversation_id instead of the system-generated one. Make sure you always use the conversation_id returned by the API when starting a conversation, and that the user parameter matches the from_end_user_id in the conversations table. If you’re accessing conversations via the API, you cannot retrieve those created via the web interface unless the user context matches exactly. Double-check that you’re not mixing up session_id and user_id, as this can also cause the error. The combination of user and conversation_id is the unique key for access—if either is wrong, you’ll see this error. More details and examples are here: ["Conversation Not Exists" root causes and solutions](https://github.com/langgenius/dify/issues/20149), [user/session mismatch](https://github.com/langgenius/dify/issues/15916). For the "UAUTHORIZED" error when embedding and customizing user_id: starting from v1.7.0, Dify treats the passed user_id as a session_id and tries to match it to an existing EndUser. If it doesn’t find a match, it creates a new anonymous user, but if the session isn’t recognized, you get a 401 error and are redirected to login. To avoid this, the user_id you pass must exactly match an existing EndUser’s session_id for the same app and tenant. There’s no config to restore the old (pre-1.7.0) behavior. The best workaround is to ensure user_id is unique, stable, and consistent for each user, and that your app’s access mode is set to PUBLIC. If you pass a new or mismatched user_id, you’ll see repeated anonymous user creation and authorization failures. See the full explanation and workarounds here: ["UAUTHORIZED" and embedding changes in 1.7.x](https://github.com/langgenius/dify/issues/23234). If you’re still seeing issues, check your backend logs for more details on the failed requests, and verify the mapping between user/session IDs in your database. If you need persistent user identification in embedding, make sure the user_id you pass matches an existing session_id for your app. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/34e8eb04-d851-4909-af87-ba824482c01c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/34e8eb04-d851-4909-af87-ba824482c01c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/34e8eb04-d851-4909-af87-ba824482c01c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/34e8eb04-d851-4909-af87-ba824482c01c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/34e8eb04-d851-4909-af87-ba824482c01c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/34e8eb04-d851-4909-af87-ba824482c01c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/34e8eb04-d851-4909-af87-ba824482c01c?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/23396)
Author
Owner

@Richie666888 commented on GitHub (Aug 5, 2025):

For the "UAUTHORIZED",I just want to simply change the system variable "user_id" to "employee number".
I think this upgrade approach is not very good. My requirement is to unify the user_id with the employee's ID number. This way, whenever they log in, they will be able to view the all historical conversations.

@Richie666888 commented on GitHub (Aug 5, 2025): For the "UAUTHORIZED",I just want to simply change the system variable "user_id" to "employee number". I think this upgrade approach is not very good. My requirement is to unify the user_id with the employee's ID number. This way, whenever they log in, they will be able to view the all historical conversations.
Author
Owner

@crazywoola commented on GitHub (Aug 5, 2025):

For the "UAUTHORIZED",I just want to simply change the system variable "user_id" to "employee number". I think this upgrade approach is not very good. My requirement is to unify the user_id with the employee's ID number. This way, whenever they log in, they will be able to view the all historical conversations.

This will be fixed in the next version.

@crazywoola commented on GitHub (Aug 5, 2025): > For the "UAUTHORIZED",I just want to simply change the system variable "user_id" to "employee number". I think this upgrade approach is not very good. My requirement is to unify the user_id with the employee's ID number. This way, whenever they log in, they will be able to view the all historical conversations. This will be fixed in the next version.
Author
Owner

@Richie666888 commented on GitHub (Aug 5, 2025):

How to clear the system cache?

@Richie666888 commented on GitHub (Aug 5, 2025): How to clear the system cache?
Author
Owner

@Richie666888 commented on GitHub (Aug 11, 2025):

Can we add the function of allowing users to view or download the original document?

@Richie666888 commented on GitHub (Aug 11, 2025): Can we add the function of allowing users to view or download the original document?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15880