mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #7560] Configurations via Environment Variables not precedent over configs in the database #53458
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @justbert on GitHub (Dec 2, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7560
Bug Report
Installation Method
open-webui Helm chart via ArgoCD on OpenShift.
Environment
Confirmation:
Expected Behavior:
Configurations via environment variables should take precedence over state in database.
Actual Behavior:
Once a configuration has been set and stored in the database by interacting with the admin panel, they take priority from then on and cannot be configured via environment variables.
Description
Bug Summary:
When setting configurations via environment variables, persisted configurations in the database take precedence.
Generally, when it comes to configuring applications, environment variables take precedence over saved state at startup since these allow for managing an application programmatically. [https://12factor.net/config]
Reproduction Details
Steps to Reproduce:
Logs and Screenshots
Docker Container Logs:
Fresh Install:
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
Interacted with admin panel:
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [open_webui.env] 'ENABLE_OLLAMA_API' loaded from the latest database entry
INFO [open_webui.env] 'OLLAMA_BASE_URLS' loaded from the latest database entry
INFO [open_webui.env] 'OLLAMA_API_CONFIGS' loaded from the latest database entry
INFO [open_webui.env] 'ENABLE_OPENAI_API' loaded from the latest database entry
INFO [open_webui.env] 'OPENAI_API_KEYS' loaded from the latest database entry
INFO [open_webui.env] 'OPENAI_API_BASE_URLS' loaded from the latest database entry
INFO [open_webui.env] 'OPENAI_API_CONFIGS' loaded from the latest database entry
INFO [open_webui.env] 'DEFAULT_LOCALE' loaded from the latest database entry
INFO [open_webui.env] 'DEFAULT_PROMPT_SUGGESTIONS' loaded from the latest database entry
@tjbck commented on GitHub (Dec 2, 2024):
Intended behaviour here. env vars will only be used during initialization. However, I'd be open to accepting PRs for this!
@justbert commented on GitHub (Dec 2, 2024):
Ooof, gotcha. It doesn't follow general industry patterns and it doesn't seem to be well documented.
In the docs it states:
It might be best to state that ...to provide Open WebUI with an initialization configuration
@tjbck commented on GitHub (Dec 2, 2024):
@justbert Agreed, there are some env vars that don't get saved to the database which might add to the confusion. I'm open to accepting PR for this (both the code, and the doc)!
@justbert commented on GitHub (Dec 2, 2024):
Sounds good! Just to clarify, in regards to a PR, would this be to update the docs or to re-align functionality to use set Env Vars as precedent?
@justbert commented on GitHub (Dec 4, 2024):
Oh! I hadn't seen the
RESET_CONFIG_ON_STARTenv var. This should do nicely!