[GH-ISSUE #21601] issue: WebSocket collaborative editing race: AttributeError on user.get after disconnect #58197

Closed
opened 2026-05-05 22:31:24 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @JIW-roosi on GitHub (Feb 19, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21601

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

Other

Open WebUI Version

0.7.2 (relevant code unchanged in 0.8.3)

Ollama Version (if applicable)

No response

Operating System

Ubuntu (kubernetes)

Browser (if applicable)

No response

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

When a user disconnects from a collaborative note, pending debounced saves should either complete gracefully or be canceled. No AttributeError should be triggered.

Actual Behavior

After a user disconnects, a debounced save task runs, attempts to access the removed session from SESSION_POOL, receives None, and crashes when document_save_handler calls user.get('role'). This results in repeated Task exception errors (50+ in series) in the logs and slowing of the system and "page not responding" errors for users.

Steps to Reproduce

  1. Deploy Open WebUI v0.7.2 or higher with default settings (ENABLE_WEBSOCKET_SUPPORT=true by default).
  2. Log in as any user and open a note for collaborative editing.
  3. Make a change to the note to trigger a yjs document update.
  4. Immediately close the browser tab or navigate away before the 0.5s debounced save fires.
  5. Observe the container logs

Logs & Screenshots

2026-02-19 12:19:56.165 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved
future: <Task finished name='Task-254075' coro=<yjs_document_update..debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")>
Traceback (most recent call last):

File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save
await document_save_handler(
└ <function document_save_handler at 0x7e0fa04c7420>

File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler
user.get("role") != "admin"
└ None

AttributeError: 'NoneType' object has no attribute 'get'
2026-02-19 12:19:56.222 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved
future: <Task finished name='Task-254080' coro=<yjs_document_update..debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")>
Traceback (most recent call last):

File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save
await document_save_handler(
└ <function document_save_handler at 0x7e0fa04c7420>

File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler
user.get("role") != "admin"
└ None

AttributeError: 'NoneType' object has no attribute 'get'
2026-02-19 12:19:56.264 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved
future: <Task finished name='Task-254084' coro=<yjs_document_update..debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")>
Traceback (most recent call last):

File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save
await document_save_handler(
└ <function document_save_handler at 0x7e0fa04c7420>

File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler
user.get("role") != "admin"
└ None

AttributeError: 'NoneType' object has no attribute 'get'
2026-02-19 12:19:56.284 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved
future: <Task finished name='Task-254087' coro=<yjs_document_update..debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")>
Traceback (most recent call last):

File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save
await document_save_handler(
└ <function document_save_handler at 0x7e0fa04c7420>

File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler
user.get("role") != "admin"
└ None

AttributeError: 'NoneType' object has no attribute 'get'
2026-02-19 12:19:56.365 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved
future: <Task finished name='Task-254092' coro=<yjs_document_update..debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")>
Traceback (most recent call last):

File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save
await document_save_handler(
└ <function document_save_handler at 0x7e0fa04c7420>

File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler
user.get("role") != "admin"
└ None

AttributeError: 'NoneType' object has no attribute 'get'

Additional Information

No response

Originally created by @JIW-roosi on GitHub (Feb 19, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/21601 ### 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 Other ### Open WebUI Version 0.7.2 (relevant code unchanged in 0.8.3) ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu (kubernetes) ### Browser (if applicable) _No response_ ### 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 When a user disconnects from a collaborative note, pending debounced saves should either complete gracefully or be canceled. No AttributeError should be triggered. ### Actual Behavior After a user disconnects, a debounced save task runs, attempts to access the removed session from SESSION_POOL, receives None, and crashes when document_save_handler calls user.get('role'). This results in repeated Task exception errors (50+ in series) in the logs and slowing of the system and "page not responding" errors for users. ### Steps to Reproduce 1. Deploy Open WebUI v0.7.2 or higher with default settings (ENABLE_WEBSOCKET_SUPPORT=true by default). 2. Log in as any user and open a note for collaborative editing. 3. Make a change to the note to trigger a yjs document update. 4. Immediately close the browser tab or navigate away before the 0.5s debounced save fires. 5. Observe the container logs ### Logs & Screenshots 2026-02-19 12:19:56.165 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved future: <Task finished name='Task-254075' coro=<yjs_document_update.<locals>.debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")> Traceback (most recent call last): > File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save await document_save_handler( └ <function document_save_handler at 0x7e0fa04c7420> File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler user.get("role") != "admin" └ None AttributeError: 'NoneType' object has no attribute 'get' 2026-02-19 12:19:56.222 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved future: <Task finished name='Task-254080' coro=<yjs_document_update.<locals>.debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")> Traceback (most recent call last): > File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save await document_save_handler( └ <function document_save_handler at 0x7e0fa04c7420> File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler user.get("role") != "admin" └ None AttributeError: 'NoneType' object has no attribute 'get' 2026-02-19 12:19:56.264 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved future: <Task finished name='Task-254084' coro=<yjs_document_update.<locals>.debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")> Traceback (most recent call last): > File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save await document_save_handler( └ <function document_save_handler at 0x7e0fa04c7420> File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler user.get("role") != "admin" └ None AttributeError: 'NoneType' object has no attribute 'get' 2026-02-19 12:19:56.284 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved future: <Task finished name='Task-254087' coro=<yjs_document_update.<locals>.debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")> Traceback (most recent call last): > File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save await document_save_handler( └ <function document_save_handler at 0x7e0fa04c7420> File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler user.get("role") != "admin" └ None AttributeError: 'NoneType' object has no attribute 'get' 2026-02-19 12:19:56.365 | ERROR | open_webui.tasks:cleanup_task:87 - Task exception was never retrieved future: <Task finished name='Task-254092' coro=<yjs_document_update.<locals>.debounced_save() done, defined at /app/backend/open_webui/socket/main.py:622> exception=AttributeError("'NoneType' object has no attribute 'get'")> Traceback (most recent call last): > File "/app/backend/open_webui/socket/main.py", line 624, in debounced_save await document_save_handler( └ <function document_save_handler at 0x7e0fa04c7420> File "/app/backend/open_webui/socket/main.py", line 538, in document_save_handler user.get("role") != "admin" └ None AttributeError: 'NoneType' object has no attribute 'get' ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-05 22:31:24 -05:00
Author
Owner

@sourav1243 commented on GitHub (Feb 19, 2026):

I'd like to work on fixing this bug in open-webui/open-webui.

I've encountered similar issues before and have experience debugging and fixing these types of problems. I can investigate the root cause and implement a proper fix.

Could you please assign this issue to me?

<!-- gh-comment-id:3927036439 --> @sourav1243 commented on GitHub (Feb 19, 2026): I'd like to work on fixing this bug in open-webui/open-webui. I've encountered similar issues before and have experience debugging and fixing these types of problems. I can investigate the root cause and implement a proper fix. Could you please assign this issue to me?
Author
Owner

@tjbck commented on GitHub (Feb 19, 2026):

Should be addressed in dev.

<!-- gh-comment-id:3930538627 --> @tjbck commented on GitHub (Feb 19, 2026): Should be addressed in dev.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#58197