Serious Issue: Frequent and Critical Loss of Chat History/Logs #266

Closed
opened 2026-02-16 05:19:40 -05:00 by yindo · 1 comment
Owner

Originally created by @m-masahiro-addness on GitHub (Nov 9, 2025).

Type of Documentation Change

Error/Typo fix

Documentation Page URL or Path

No response

Current Content

We are reporting a serious and critical issue regarding the stability and reliability of the Dify platform.

We are observing that the chat history/logs are disappearing with significant frequency. This is not an isolated or rare event; it is happening consistently enough to severely impact our operation and ability to track user interactions and model performance.

Key Concerns:

Data Loss: The disappearance of history represents a critical loss of operational data and diagnostic information.

Operational Instability: The platform's perceived reliability is undermined, making it difficult to trust the system for long-term data storage.

Difficulty in Debugging/Monitoring: Without reliable logs, it is nearly impossible for us to monitor model behavior, debug issues, or conduct necessary audits.

This issue is occurring quite frequently (or "at a quite high frequency") and needs to be addressed with high priority and urgency. We request an immediate investigation into the root cause of this frequent data loss.

Suggested Changes

Suggested Changes / Requested Actions

  1. Audit Data Persistence and Retention Policy:
    • Please conduct an urgent audit of the database write operations, data retention settings, and any automated cleanup scripts related to chat history. We need to confirm that chat logs are not being accidentally or prematurely deleted.
  2. Enhance Server-Side Logging:
    • Increase the verbosity of server-side logs, specifically for database WRITE and DELETE operations on chat history tables, to help pinpoint the exact moment and reason for the data loss.
  3. Implement Immediate Write Confirmation:
    • As a short-term measure, consider implementing a verification step in the backend to ensure a new chat entry is successfully persisted to the database immediately after the response is generated.
  4. Collaboration on Diagnostics:
    • We are ready to provide specific timestamps, operational environment details, and relevant log snippets from our side (e.g., front-end network traffic) to assist your engineering team in reproducing and diagnosing the issue.

Reason for Change

Reason for Reporting / Impact of the Issue

This issue must be treated as a high-priority incident due to the following critical impacts:

  • Critical Data Loss: The frequent disappearance of chat history results in a critical loss of operational logs and diagnostic data, which are indispensable for debugging, performance monitoring, and model improvement.
  • Erosion of Trust: Consistent data loss severely undermines the reliability of the Dify platform, making it unreliable for long-term data tracking and archival purposes.
  • Operational Risk: The inability to track and reference past user interactions poses a significant risk to our own customer support, auditing processes, and the personalized user experience we aim to provide.

Code of Conduct

  • I agree to follow Dify's documentation contribution guidelines
  • 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.
Originally created by @m-masahiro-addness on GitHub (Nov 9, 2025). ### Type of Documentation Change Error/Typo fix ### Documentation Page URL or Path _No response_ ### Current Content We are reporting a serious and critical issue regarding the stability and reliability of the Dify platform. We are observing that the chat history/logs are disappearing with significant frequency. This is not an isolated or rare event; it is happening consistently enough to severely impact our operation and ability to track user interactions and model performance. Key Concerns: Data Loss: The disappearance of history represents a critical loss of operational data and diagnostic information. Operational Instability: The platform's perceived reliability is undermined, making it difficult to trust the system for long-term data storage. Difficulty in Debugging/Monitoring: Without reliable logs, it is nearly impossible for us to monitor model behavior, debug issues, or conduct necessary audits. This issue is occurring quite frequently (or "at a quite high frequency") and needs to be addressed with high priority and urgency. We request an immediate investigation into the root cause of this frequent data loss. ### Suggested Changes ### Suggested Changes / Requested Actions 1. **Audit Data Persistence and Retention Policy:** * Please conduct an urgent audit of the database write operations, data retention settings, and any automated cleanup scripts related to chat history. We need to confirm that chat logs are not being accidentally or prematurely deleted. 2. **Enhance Server-Side Logging:** * Increase the verbosity of server-side logs, specifically for database WRITE and DELETE operations on chat history tables, to help pinpoint the exact moment and reason for the data loss. 3. **Implement Immediate Write Confirmation:** * As a short-term measure, consider implementing a verification step in the backend to ensure a new chat entry is successfully persisted to the database immediately after the response is generated. 4. **Collaboration on Diagnostics:** * We are ready to provide specific timestamps, operational environment details, and relevant log snippets from our side (e.g., front-end network traffic) to assist your engineering team in reproducing and diagnosing the issue. ### Reason for Change ### Reason for Reporting / Impact of the Issue This issue must be treated as a high-priority incident due to the following critical impacts: * **Critical Data Loss:** The frequent disappearance of chat history results in a critical loss of operational logs and diagnostic data, which are indispensable for debugging, performance monitoring, and model improvement. * **Erosion of Trust:** Consistent data loss severely undermines the reliability of the Dify platform, making it unreliable for long-term data tracking and archival purposes. * **Operational Risk:** The inability to track and reference past user interactions poses a significant risk to our own customer support, auditing processes, and the personalized user experience we aim to provide. ### Code of Conduct - [x] I agree to follow Dify's documentation [contribution guidelines](https://github.com/langgenius/dify/blob/0277a37fcad5ad86aeb239485c27fffd5cd90043/CONTRIBUTING.md) - [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.
yindo added the documentationbug labels 2026-02-16 05:19:40 -05:00
yindo closed this issue 2026-02-16 05:19:40 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 9, 2025):

Hi @m-masahiro-addness! I'm Dosu and I’m helping the dify-docs team.

Your report highlights a critical issue with chat history/log loss in Dify. Based on a deep review of the codebase and related issues, chat history is stored in the database (conversations and messages tables), and deletion is user-driven—there are no automated cleanup scripts or retention policies that would periodically remove chat logs unless manually triggered or misconfigured by an administrator. Immediate database commits are used for write operations, but there is no explicit backend verification step or enhanced logging for chat history creation events—logging is only present for deletion operations, which could make it difficult to pinpoint the cause of silent data loss or failed writes see code see code.

There are no recent fixes or features addressing frequent chat history disappearance, and related issues focus on privacy, retention, and operational bugs rather than persistent data loss see related issue. Some platform-specific bugs (e.g., changing user IDs on iOS/macOS) can make chat logs inaccessible but do not delete the underlying data see related issue.

To address your concerns, I recommend: auditing all database write and delete operations for chat history, reviewing any custom scripts or cron jobs that might affect retention, and increasing server-side logging for both creation and deletion events. Implementing a backend verification step after each chat log write would help confirm persistence and catch silent failures. If you have specific timestamps or logs, sharing them could help correlate frontend events with backend operations and identify root causes.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Nov 9, 2025): <!-- Greeting --> Hi @m-masahiro-addness! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-docs team. <!-- Answer --> Your report highlights a critical issue with chat history/log loss in Dify. Based on a deep review of the codebase and related issues, chat history is stored in the database (`conversations` and `messages` tables), and deletion is user-driven—there are no automated cleanup scripts or retention policies that would periodically remove chat logs unless manually triggered or misconfigured by an administrator. Immediate database commits are used for write operations, but there is no explicit backend verification step or enhanced logging for chat history creation events—logging is only present for deletion operations, which could make it difficult to pinpoint the cause of silent data loss or failed writes [see code](https://github.com/langgenius/dify/blob/aa4cabdeb5b923f3275f59dfe8695f3289be430c/api/services/conversation_service.py#L31-L327) [see code](https://github.com/langgenius/dify/blob/aa4cabdeb5b923f3275f59dfe8695f3289be430c/api/tasks/delete_conversation_task.py#L16-L71). There are no recent fixes or features addressing frequent chat history disappearance, and related issues focus on privacy, retention, and operational bugs rather than persistent data loss [see related issue](https://github.com/langgenius/dify/issues/14964). Some platform-specific bugs (e.g., changing user IDs on iOS/macOS) can make chat logs inaccessible but do not delete the underlying data [see related issue](https://github.com/langgenius/dify/issues/16571). To address your concerns, I recommend: auditing all database write and delete operations for chat history, reviewing any custom scripts or cron jobs that might affect retention, and increasing server-side logging for both creation and deletion events. Implementing a backend verification step after each chat log write would help confirm persistence and catch silent failures. If you have specific timestamps or logs, sharing them could help correlate frontend events with backend operations and identify root causes. <!-- 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/4ef530f6-e315-42cc-92b7-5560a0316424?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4ef530f6-e315-42cc-92b7-5560a0316424?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4ef530f6-e315-42cc-92b7-5560a0316424?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4ef530f6-e315-42cc-92b7-5560a0316424?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4ef530f6-e315-42cc-92b7-5560a0316424?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4ef530f6-e315-42cc-92b7-5560a0316424?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4ef530f6-e315-42cc-92b7-5560a0316424?feedback_type=other)</sup>&nbsp;&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-docs/issues/515)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-docs#266