[GH-ISSUE #20474] Chat infinitely loads when history.currentId points to orphaned/deleted message #57860

Closed
opened 2026-05-05 21:46:10 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @MacJedi42 on GitHub (Jan 7, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20474

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

0.6.43

Ollama Version (if applicable)

No response

Operating System

Ubuntu 22.04

Browser (if applicable)

Chrome 143

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

Selecting a chat in the sidebar should load the chat.

Actual Behavior

After deleting messages from a chat thread using the UI, the chat becomes inaccessible and displays an infinite loading state. The chat appears in the sidebar but never finishes loading when selected.

Steps to Reproduce

This may be difficult to reproduce as you may need to delete the right message to cause this issue to occur, you may need to know which message is the last message history.currentId is currently pointing to.

  1. Open an existing chat with multiple messages
  2. Delete several messages using the UI (particularly in a random order, i.e delete message 34 then 36 then 40.)
  3. Continue using the chat or refresh the page
  4. In some cases, the chat will fail to load

Logs & Screenshots

No errors were emitted in the docker log nor the browser console.

Additional Information

After investigating the SQLite database (webui.db), we identified the following inconsistency in the chat JSON structure:

The history.currentId field was pointing to a message ID (37a49f3b-xxxxx-yyyy-zzzz-aaaaaaaaaaaa) that had become orphaned and disconnected from the main conversation tree. This orphaned message had the following issues identified:
parentId: null
childrenIds: null
role: null
No connection to the main message chain

The UI deletion operation appears to have removed message content/links but left a stub in history.messages and also failed to update history.currentId to point to the new last valid message in the chain.

To find a orphaned chat ID I ran the following against the database:

SELECT id, title,
json_extract(chat, '$.history.currentId') as currentId
FROM chat
WHERE id = '<chat_id>';

Then check if the currentId exists in history.messages and has valid parentId/childrenIds linking it to the conversation tree

I manually resolved this myself by updating the history.currentId to point to the actual last message in the conversation chain and also removed the orphaned message from history.messages.

I have not provided logs as there was no error emitted in the docker container.

Originally created by @MacJedi42 on GitHub (Jan 7, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20474 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version 0.6.43 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu 22.04 ### Browser (if applicable) Chrome 143 ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior Selecting a chat in the sidebar should load the chat. ### Actual Behavior After deleting messages from a chat thread using the UI, the chat becomes inaccessible and displays an infinite loading state. The chat appears in the sidebar but never finishes loading when selected. ### Steps to Reproduce This may be difficult to reproduce as you may need to delete the right message to cause this issue to occur, you may need to know which message is the last message history.currentId is currently pointing to. 1. Open an existing chat with multiple messages 2. Delete several messages using the UI (particularly in a random order, i.e delete message 34 then 36 then 40.) 3. Continue using the chat or refresh the page 4. In some cases, the chat will fail to load ### Logs & Screenshots No errors were emitted in the docker log nor the browser console. ### Additional Information After investigating the SQLite database (webui.db), we identified the following inconsistency in the chat JSON structure: The history.currentId field was pointing to a message ID (37a49f3b-xxxxx-yyyy-zzzz-aaaaaaaaaaaa) that had become orphaned and disconnected from the main conversation tree. This orphaned message had the following issues identified: parentId: null childrenIds: null role: null No connection to the main message chain The UI deletion operation appears to have removed message content/links but left a stub in history.messages and also failed to update history.currentId to point to the new last valid message in the chain. To find a orphaned chat ID I ran the following against the database: SELECT id, title, json_extract(chat, '$.history.currentId') as currentId FROM chat WHERE id = '<chat_id>'; Then check if the currentId exists in history.messages and has valid parentId/childrenIds linking it to the conversation tree I manually resolved this myself by updating the history.currentId to point to the actual last message in the conversation chain and also removed the orphaned message from history.messages. I have not provided logs as there was no error emitted in the docker container.
GiteaMirror added the bug label 2026-05-05 21:46:11 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (Jan 7, 2026):

🔍 Similar Issues Found

I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:

  1. #18999 issue: Unable to load chat history
    by i-iooi-i • Nov 07, 2025 • bug

  2. #19225 issue: Chat history cannot be displayed and remains loading indefinitely
    by ShirasawaSama • Nov 17, 2025 • bug, help wanted

  3. #20414 issue: Chats can't be archived
    by Ithanil • Jan 06, 2026 • bug


💡 Tips:

  • If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
  • If you found a solution in any of these issues, please share it here to help others

This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.

<!-- gh-comment-id:3721220408 --> @owui-terminator[bot] commented on GitHub (Jan 7, 2026): 🔍 **Similar Issues Found** I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions: 1. [#18999](https://github.com/open-webui/open-webui/issues/18999) **issue: Unable to load chat history** *by i-iooi-i • Nov 07, 2025 • `bug`* 2. [#19225](https://github.com/open-webui/open-webui/issues/19225) **issue: Chat history cannot be displayed and remains loading indefinitely** *by ShirasawaSama • Nov 17, 2025 • `bug`, `help wanted`* 3. [#20414](https://github.com/open-webui/open-webui/issues/20414) **issue: Chats can't be archived** *by Ithanil • Jan 06, 2026 • `bug`* --- 💡 **Tips:** - If this is a duplicate, please consider closing this issue and adding any additional details to the existing one - If you found a solution in any of these issues, please share it here to help others *This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#57860