From 3dbb4078b361570a4aed450ef71842b99e709086 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 11 Aug 2026 06:19:41 +0200 Subject: [PATCH] fix: repair two broken logging calls, one of which makes VECTOR_DB=opengauss unusable (#27838) SRC_LOG_LEVELS became an empty dict when per-module log levels were dropped, and env.py keeps it only as a legacy name. opengauss.py is the last thing in the tree that still indexes it, at module scope, so importing the module raises KeyError: 'RAG' and any deployment on VECTOR_DB=opengauss dies the first time it touches the vector store. The factory imports it lazily, which is why nothing else trips over it. Deleting the line is the whole fix: every other vector backend takes getLogger(__name__) and inherits the root level. colbert.py passes an argument to a message with no placeholder to consume it: log.info('ColBERT: Loading model', name) At INFO, which is the default, logging evaluates 'ColBERT: Loading model' % ('colbert-ir/colbertv2.0',) and raises TypeError: not all arguments converted during string formatting. The record is swallowed by handleError, so loading a ColBERT reranker prints '--- Logging error ---' plus a traceback to stderr instead of the model name. Adding %s prints the name and drops the traceback. --- backend/open_webui/retrieval/models/colbert.py | 2 +- backend/open_webui/retrieval/vector/dbs/opengauss.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/open_webui/retrieval/models/colbert.py b/backend/open_webui/retrieval/models/colbert.py index d11bde1b09..94e6f8af5e 100644 --- a/backend/open_webui/retrieval/models/colbert.py +++ b/backend/open_webui/retrieval/models/colbert.py @@ -12,7 +12,7 @@ log = logging.getLogger(__name__) class ColBERT(BaseReranker): def __init__(self, name, **kwargs) -> None: - log.info('ColBERT: Loading model', name) + log.info('ColBERT: Loading model %s', name) self.device = 'cuda' if torch.cuda.is_available() else 'cpu' DOCKER = kwargs.get('env') == 'docker' diff --git a/backend/open_webui/retrieval/vector/dbs/opengauss.py b/backend/open_webui/retrieval/vector/dbs/opengauss.py index 900713a7a1..e11e944f3d 100644 --- a/backend/open_webui/retrieval/vector/dbs/opengauss.py +++ b/backend/open_webui/retrieval/vector/dbs/opengauss.py @@ -62,7 +62,6 @@ from open_webui.config import ( OPENGAUSS_POOL_SIZE, OPENGAUSS_POOL_TIMEOUT, ) -from open_webui.env import SRC_LOG_LEVELS from open_webui.retrieval.vector.main import ( GetResult, SearchResult, @@ -75,7 +74,6 @@ VECTOR_LENGTH = OPENGAUSS_INITIALIZE_MAX_VECTOR_LENGTH Base = declarative_base() log = logging.getLogger(__name__) -log.setLevel(SRC_LOG_LEVELS['RAG']) class DocumentChunk(Base):