fix: upgrade looks stuck while it moves chat messages (#35054)

During a database upgrade the log only named the step that was running, and the progress lines of long steps never showed, whatever GLOBAL_LOG_LEVEL was set to. On a big install an admin saw `Running upgrade d2f86c0b41ae -> 5e7a2c9d4b13` and then nothing for minutes while the chat messages were moved, which looks like a hung upgrade and invites a restart in the middle of it. The database upgrade steps now log at the level set in GLOBAL_LOG_LEVEL, so with the default the running count of moved chats shows while the step works.

Fixes #35052
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-25 12:47:34 +04:00
1 parent fbf99c5762
commit 893584700a
1 file changed
+2 -1
+2 -1
View File
@@ -8,7 +8,7 @@ import logging.config
import alembic.context
from alembic.runtime.migration import MigrationContext
from open_webui.env import DATABASE_PASSWORD, DATABASE_SCHEMA, DATABASE_URL, LOG_FORMAT
from open_webui.env import DATABASE_PASSWORD, DATABASE_SCHEMA, DATABASE_URL, GLOBAL_LOG_LEVEL, LOG_FORMAT
from open_webui.internal.db import enable_iam_token_auth, extract_ssl_params_from_url, reattach_ssl_params_to_url
from open_webui.models.auths import Auth
from open_webui.models.calendar import Calendar, CalendarEvent, CalendarEventAttendee # noqa: F401
@@ -21,6 +21,7 @@ from sqlalchemy import create_engine, engine_from_config, inspect, pool
alembic_config = alembic.context.config
if alembic_config.config_file_name:
logging.config.fileConfig(alembic_config.config_file_name, disable_existing_loggers=False)
logging.root.setLevel(GLOBAL_LOG_LEVEL)
if LOG_FORMAT == 'json':
from open_webui.env import JSONFormatter