[GH-ISSUE #17943] issue: Debug print() statements in middleware.py pollute logs #33974

Closed
opened 2026-04-25 07:51:47 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @rbb-dev on GitHub (Oct 1, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17943

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.32

Ollama Version (if applicable)

No response

Operating System

Ubuntu 24.04

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

Log output should respect the configured logging levels (e.g., only emit detailed state dumps when debug logging is enabled).

Actual Behavior

Since commit 91b6483, the following hardcoded print() statements in backend/open_webui/utils/middleware.py always execute:

print("Final form_data:", form_data)
print("Final metadata:", metadata)
print("Final events:", events)

This causes excessive and uncontrolled output to stdout, even in production. They bypass the logging configuration and flood logs with internal state that is usually only relevant for debugging.

Steps to Reproduce

Run the server with standard logging configuration (e.g., default info level).

Trigger a request that flows through middleware.py.

Observe that Final form_data, Final metadata, and Final events are printed to stdout regardless of log level.

Logs & Screenshots

As per above, due to the use of print(), logas are growing expotentially

Additional Information

No response

Originally created by @rbb-dev on GitHub (Oct 1, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/17943 ### 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 am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.32 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu 24.04 ### 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 Log output should respect the configured logging levels (e.g., only emit detailed state dumps when debug logging is enabled). ### Actual Behavior Since commit 91b6483, the following hardcoded print() statements in backend/open_webui/utils/middleware.py always execute: ```python print("Final form_data:", form_data) print("Final metadata:", metadata) print("Final events:", events) ``` This causes excessive and uncontrolled output to stdout, even in production. They bypass the logging configuration and flood logs with internal state that is usually only relevant for debugging. ### Steps to Reproduce Run the server with standard logging configuration (e.g., default info level). Trigger a request that flows through middleware.py. Observe that Final form_data, Final metadata, and Final events are printed to stdout regardless of log level. ### Logs & Screenshots As per above, due to the use of print(), logas are growing expotentially ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-25 07:51:47 -05:00
Author
Owner

@tjbck commented on GitHub (Oct 1, 2025):

Addressed in dev.

<!-- gh-comment-id:3354530155 --> @tjbck commented on GitHub (Oct 1, 2025): Addressed in dev.
Author
Owner

@rbb-dev commented on GitHub (Oct 1, 2025):

Thank you

<!-- gh-comment-id:3354680690 --> @rbb-dev commented on GitHub (Oct 1, 2025): Thank you
Author
Owner

@pdeubel commented on GitHub (Oct 2, 2025):

There are some more print statements and also logging statements that leak user data, see https://github.com/open-webui/open-webui/discussions/17939

I have fixed the code lines in my fork https://github.com/open-webui/open-webui/compare/main...pdeubel:open-webui:fix-prod-logging

It is currently based on the main branch, if you want I can rebase on dev and open a PR for it 🙂

<!-- gh-comment-id:3360281128 --> @pdeubel commented on GitHub (Oct 2, 2025): There are some more print statements and also logging statements that leak user data, see https://github.com/open-webui/open-webui/discussions/17939 I have fixed the code lines in my fork https://github.com/open-webui/open-webui/compare/main...pdeubel:open-webui:fix-prod-logging It is currently based on the `main` branch, if you want I can rebase on `dev` and open a PR for it 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#33974