[GH-ISSUE #19844] bug: logs truncated on crash in containerized setting, Dockerfile missing ENV PYTHONUNBUFFERED=1 #34546

Closed
opened 2026-04-25 08:35:11 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @wilson0x4d on GitHub (Dec 9, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/19844

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

all

Ollama Version (if applicable)

No response

Operating System

Linux

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

Logs are reliably written.

Actual Behavior

Logs are NOT reliably written.

Steps to Reproduce

In Python stdio is buffered.

If an aplication crashes, buffered writes are lost.

This manifests as truncation in logs, which we need for diagnostics and bug reporting.

This is fixed by adding the following your your containerfile(s):

ENV PYTHONUNBUFFERED=1

This ensures stdout/stderr are unbuffered so that logs contain all expected output (except the most extreme situations: network fallout, disk failure, power outage, etc.)

This is actively blocking me from submitting a useful bug report for a crashing deployment, and now my only option is to pull sources down, and either roll my own image or debug in-place ... it's a huge waste of human capital we can avoid in the future with one line of code.

Please and thank you.

Logs & Screenshots

I've limited the logs for brevity:

(server starts here)
INFO:open_webui.env:GLOBAL_LOG_LEVEL: DEBUG
INFO:open_webui.env:AUDIO_LOG_LEVEL: DEBUG
INFO:open_webui.env:COMFYUI_LOG_LEVEL: DEBUG
INFO:open_webui.env:CONFIG_LOG_LEVEL: DEBUG
INFO:open_webui.env:DB_LOG_LEVEL: DEBUG
INFO:open_webui.env:IMAGES_LOG_LEVEL: DEBUG
INFO:open_webui.env:MAIN_LOG_LEVEL: DEBUG
INFO:open_webui.env:MODELS_LOG_LEVEL: DEBUG
INFO:open_webui.env:OLLAMA_LOG_LEVEL: DEBUG
INFO:open_webui.env:OPENAI_LOG_LEVEL: DEBUG
INFO:open_webui.env:RAG_LOG_LEVEL: DEBUG
INFO:open_webui.env:WEBHOOK_LOG_LEVEL: DEBUG
INFO:open_webui.env:SOCKET_LOG_LEVEL: DEBUG
INFO:open_webui.env:OAUTH_LOG_LEVEL: DEBUG
DEBUG:open_webui.env:No WEBSOCKET_REDIS_OPTIONS provided, defaulting to None
INFO:open_webui.internal.wrappers:Connected to SQLite database
INFO:open_webui.internal.db:Starting migrations
DEBUG:peewee:('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])

--> OMITTED FOR BREVITY <-- 

DEBUG:peewee:('INSERT INTO "migratehistory" ("name", "migrated_at") VALUES (?, ?)', ['018_add_function_is_global', datetime.datetime(2025, 12, 8, 10, 31, 18, 460264)])
INFO:open_webui.internal.db:Done 018_add_function_is_global
INFO:open_webui.env:Running migrations
Creating knowledge table
Migrating data from document table to knowledge table
Converting 'chat' column to JSON
Renaming 'chat' column to 'old_chat'
Adding new 'chat' column of type JSON
Dropping 'old_chat' column
Primary Key: {'name': None, 'constrained_columns': []}
Unique Constraints: [{'name': 'uq_id_user_id', 'column_names': ['id', 'user_id']}]
Indexes: [{'name': 'tag_id', 'column_names': ['id'], 'unique': 1, 'dialect_options': {}}]
Creating new primary key with 'id' and 'user_id'.
Dropping unique constraint: uq_id_user_id
Dropping unique index: tag_id

---> YOUR MISSING LOGS GO RIGHT HERE, FOLLOWED BY INFINITE SERVICE RESTARTS <---

How about some version info, pretty, but also useless:

$ node --version
v22.21.1
$ npm --version 
10.9.4
$ python --version
3.11.9

well at least I feel better! 🤣

Additional Information

incidentally, whoever did the A1111 testing ran into this because their containerfile explicitly disables buffering via CLI. +shrug+

i would advise the ENV var so any code that might also be looking for it will find it (as opposed to only addressing this for the cpython interpreter/runtime itself.)

see also: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUNBUFFERED

also, thanks for your effort. i know how thankless the community can be. this is actually extremely valuable work.

Originally created by @wilson0x4d on GitHub (Dec 9, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/19844 ### 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 all ### Ollama Version (if applicable) _No response_ ### Operating System Linux ### 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 Logs are reliably written. ### Actual Behavior Logs are NOT reliably written. ### Steps to Reproduce In Python stdio is buffered. If an aplication crashes, buffered writes are lost. This manifests as truncation in logs, which we need for diagnostics and bug reporting. This is fixed by adding the following your your containerfile(s): ```containerfile ENV PYTHONUNBUFFERED=1 ``` This ensures stdout/stderr are unbuffered so that logs contain all expected output (except the most extreme situations: network fallout, disk failure, power outage, etc.) This is actively blocking me from submitting a useful bug report for a crashing deployment, and now my only option is to pull sources down, and either roll my own image or debug in-place ... it's a huge waste of human capital we can avoid in the future with one line of code. Please and thank you. ### Logs & Screenshots I've limited the logs for brevity: ``` (server starts here) INFO:open_webui.env:GLOBAL_LOG_LEVEL: DEBUG INFO:open_webui.env:AUDIO_LOG_LEVEL: DEBUG INFO:open_webui.env:COMFYUI_LOG_LEVEL: DEBUG INFO:open_webui.env:CONFIG_LOG_LEVEL: DEBUG INFO:open_webui.env:DB_LOG_LEVEL: DEBUG INFO:open_webui.env:IMAGES_LOG_LEVEL: DEBUG INFO:open_webui.env:MAIN_LOG_LEVEL: DEBUG INFO:open_webui.env:MODELS_LOG_LEVEL: DEBUG INFO:open_webui.env:OLLAMA_LOG_LEVEL: DEBUG INFO:open_webui.env:OPENAI_LOG_LEVEL: DEBUG INFO:open_webui.env:RAG_LOG_LEVEL: DEBUG INFO:open_webui.env:WEBHOOK_LOG_LEVEL: DEBUG INFO:open_webui.env:SOCKET_LOG_LEVEL: DEBUG INFO:open_webui.env:OAUTH_LOG_LEVEL: DEBUG DEBUG:open_webui.env:No WEBSOCKET_REDIS_OPTIONS provided, defaulting to None INFO:open_webui.internal.wrappers:Connected to SQLite database INFO:open_webui.internal.db:Starting migrations DEBUG:peewee:('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', []) --> OMITTED FOR BREVITY <-- DEBUG:peewee:('INSERT INTO "migratehistory" ("name", "migrated_at") VALUES (?, ?)', ['018_add_function_is_global', datetime.datetime(2025, 12, 8, 10, 31, 18, 460264)]) INFO:open_webui.internal.db:Done 018_add_function_is_global INFO:open_webui.env:Running migrations Creating knowledge table Migrating data from document table to knowledge table Converting 'chat' column to JSON Renaming 'chat' column to 'old_chat' Adding new 'chat' column of type JSON Dropping 'old_chat' column Primary Key: {'name': None, 'constrained_columns': []} Unique Constraints: [{'name': 'uq_id_user_id', 'column_names': ['id', 'user_id']}] Indexes: [{'name': 'tag_id', 'column_names': ['id'], 'unique': 1, 'dialect_options': {}}] Creating new primary key with 'id' and 'user_id'. Dropping unique constraint: uq_id_user_id Dropping unique index: tag_id ---> YOUR MISSING LOGS GO RIGHT HERE, FOLLOWED BY INFINITE SERVICE RESTARTS <--- ``` How about some version info, pretty, but also useless: ```sh $ node --version v22.21.1 $ npm --version 10.9.4 $ python --version 3.11.9 ``` well at least *I* feel better! 🤣 ### Additional Information incidentally, whoever did the A1111 testing ran into this because their containerfile explicitly disables buffering via CLI. +shrug+ i would advise the ENV var so any code that might also be looking for it will find it (as opposed to only addressing this for the cpython interpreter/runtime itself.) see also: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUNBUFFERED also, thanks for your effort. i know how thankless the community can be. this is actually extremely valuable work.
GiteaMirror added the bug label 2026-04-25 08:35:11 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (Dec 9, 2025):

🔍 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. #19777 issue:
    by Yaute7 • Dec 05, 2025 • bug

  2. #19563 issue:
    by naruto7g • Nov 28, 2025 • bug

  3. #19211 issue:
    by Byrnes9 • Nov 16, 2025 • bug

  4. #15638 issue:
    by PaulX1029 • Jul 11, 2025 • bug

  5. #16959 issue:
    by Te-eMster • Aug 27, 2025 • bug

Show 5 more related issues
  1. #17391 issue:
    by abxis • Sep 12, 2025 • bug

  2. #17393 issue:
    by abxis • Sep 12, 2025 • bug

  3. #17390 issue:
    by abxis • Sep 12, 2025 • bug

  4. #17388 issue:
    by abxis • Sep 12, 2025 • bug

  5. #17387 issue:
    by abxis • Sep 12, 2025 • 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:3631942002 --> @owui-terminator[bot] commented on GitHub (Dec 9, 2025): 🔍 **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. [#19777](https://github.com/open-webui/open-webui/issues/19777) **issue:** *by Yaute7 • Dec 05, 2025 • `bug`* 2. [#19563](https://github.com/open-webui/open-webui/issues/19563) **issue:** *by naruto7g • Nov 28, 2025 • `bug`* 3. [#19211](https://github.com/open-webui/open-webui/issues/19211) **issue:** *by Byrnes9 • Nov 16, 2025 • `bug`* 4. [#15638](https://github.com/open-webui/open-webui/issues/15638) **issue:** *by PaulX1029 • Jul 11, 2025 • `bug`* 5. [#16959](https://github.com/open-webui/open-webui/issues/16959) **issue:** *by Te-eMster • Aug 27, 2025 • `bug`* <details> <summary>Show 5 more related issues</summary> 6. [#17391](https://github.com/open-webui/open-webui/issues/17391) **issue:** *by abxis • Sep 12, 2025 • `bug`* 7. [#17393](https://github.com/open-webui/open-webui/issues/17393) **issue:** *by abxis • Sep 12, 2025 • `bug`* 8. [#17390](https://github.com/open-webui/open-webui/issues/17390) **issue:** *by abxis • Sep 12, 2025 • `bug`* 9. [#17388](https://github.com/open-webui/open-webui/issues/17388) **issue:** *by abxis • Sep 12, 2025 • `bug`* 10. [#17387](https://github.com/open-webui/open-webui/issues/17387) **issue:** *by abxis • Sep 12, 2025 • `bug`* </details> --- 💡 **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.
Author
Owner

@tjbck commented on GitHub (Dec 11, 2025):

4c4b9d19a1

<!-- gh-comment-id:3643376436 --> @tjbck commented on GitHub (Dec 11, 2025): 4c4b9d19a10292d02f7d880e801c59cb184dbd07
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#34546