[GH-ISSUE #21945] issue: Open WebUI Backend Required after updating from 0.7.2 to 0.8.x #90360

Closed
opened 2026-05-15 15:36:18 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Oatu4396 on GitHub (Feb 27, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21945

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

v0.7.2, v0.8.0 - v0.8.5

Ollama Version (if applicable)

No response

Operating System

6.1.96-102.177.amzn2023.x86_64 GNU/Linux; Windows 11, version 25H2

Browser (if applicable)

Chrome, Safari

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

After updating from v0.7.2 to `v0.8.x', the database will update and migrate automatically. The instance should boot without any error.

Actual Behavior

Reproduce with both Linux and Windows docker:
The instance works perfect on v0.7.2.
After update to version v0.8.0 and v0.8.1, the docker instance will quit automatically with Error code 3.
After update to version v0.8.2 and above, the webpage shows the Open WebUI Backend Required error and cannot login.

Steps to Reproduce

  1. Start with a database from v0.7.2 or older;
  2. Choose an arbitrary platform;
  3. Deploy the instance with docker using the default deploy command from the documentation, docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:v0.x.x;
  4. Login to webui through localhost:3000.

Logs & Screenshots

The following log is from a v0.8.2 instance:

Loading WEBUI_SECRET_KEY from file, not provided as an environment variable.
Generating WEBUI_SECRET_KEY
Loading WEBUI_SECRET_KEY from .webui_secret_key
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 374d2f66af06 -> 8452d01d26d7, Add chat_message table
ERROR [open_webui.env] Error running migrations: (sqlite3.OperationalError) table chat_message already exists
[SQL:
CREATE TABLE chat_message (
        id TEXT NOT NULL,
        chat_id TEXT NOT NULL,
        user_id TEXT,
        role TEXT NOT NULL,
        parent_id TEXT,
        content JSON,
        output JSON,
        model_id TEXT,
        files JSON,
        sources JSON,
        embeds JSON,
        done BOOLEAN,
        status_history JSON,
        error JSON,
        usage JSON,
        created_at BIGINT,
        updated_at BIGINT,
        PRIMARY KEY (id),
        FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: table chat_message already exists

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/backend/open_webui/config.py", line 68, in run_migrations
    command.upgrade(alembic_cfg, "head")
  File "/usr/local/lib/python3.11/site-packages/alembic/command.py", line 483, in upgrade
    script.run_env()
  File "/usr/local/lib/python3.11/site-packages/alembic/script/base.py", line 545, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 116, in load_python_file
    module = load_module_py(module_id, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 136, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/backend/open_webui/migrations/env.py", line 108, in <module>
    run_migrations_online()
  File "/app/backend/open_webui/migrations/env.py", line 102, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/local/lib/python3.11/site-packages/alembic/runtime/environment.py", line 969, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/local/lib/python3.11/site-packages/alembic/runtime/migration.py", line 626, in run_migrations
    step.migration_fn(**kw)
  File "/app/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py", line 27, in upgrade
    op.create_table(
  File "<string>", line 8, in create_table
  File "<string>", line 3, in create_table
  File "/usr/local/lib/python3.11/site-packages/alembic/operations/ops.py", line 1331, in create_table
    return operations.invoke(op)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/alembic/operations/base.py", line 452, in invoke
    return fn(self, operation)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/alembic/operations/toimpl.py", line 140, in create_table
    operations.impl.create_table(table, **kw)
  File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 440, in create_table
    self._exec(schema.CreateTable(table, **kw))
  File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 256, in _exec
    return conn.execute(construct, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
    return meth(
           ^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 187, in _execute_on_connection
    return connection._execute_ddl(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1530, in _execute_ddl
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table chat_message already exists
[SQL:
CREATE TABLE chat_message (
        id TEXT NOT NULL,
        chat_id TEXT NOT NULL,
        user_id TEXT,
        role TEXT NOT NULL,
        parent_id TEXT,
        content JSON,
        output JSON,
        model_id TEXT,
        files JSON,
        sources JSON,
        embeds JSON,
        done BOOLEAN,
        status_history JSON,
        error JSON,
        usage JSON,
        created_at BIGINT,
        updated_at BIGINT,
        PRIMARY KEY (id),
        FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
WARNI [open_webui.env] ⚠️  SECURITY WARNING: JWT_EXPIRES_IN is set to '-1'
    See: https://docs.openwebui.com/getting-started/env-configuration

WARNI [open_webui.env]

WARNING: CORS_ALLOW_ORIGIN IS SET TO '*' - NOT RECOMMENDED FOR PRODUCTION DEPLOYMENTS.

WARNI [langchain_community.utils.user_agent] USER_AGENT environment variable not set, consider setting it to identify your requests.

 ██████╗ ██████╗ ███████╗███╗   ██╗    ██╗    ██╗███████╗██████╗ ██╗   ██╗██╗
██╔═══██╗██╔══██╗██╔════╝████╗  ██║    ██║    ██║██╔════╝██╔══██╗██║   ██║██║
██║   ██║██████╔╝█████╗  ██╔██╗ ██║    ██║ █╗ ██║█████╗  ██████╔╝██║   ██║██║
██║   ██║██╔═══╝ ██╔══╝  ██║╚██╗██║    ██║███╗██║██╔══╝  ██╔══██╗██║   ██║██║
╚██████╔╝██║     ███████╗██║ ╚████║    ╚███╔███╔╝███████╗██████╔╝╚██████╔╝██║
 ╚═════╝ ╚═╝     ╚══════╝╚═╝  ╚═══╝     ╚══╝╚══╝ ╚══════╝╚═════╝  ╚═════╝ ╚═╝


v0.8.2 - building the best AI user interface.

https://github.com/open-webui/open-webui

INFO:     Started server process [1]
INFO:     Waiting for application startup.
2026-02-27 22:51:35.206 | INFO     | open_webui.utils.logger:start_logger:165 - GLOBAL_LOG_LEVEL: INFO
2026-02-27 22:51:35.206 | INFO     | open_webui.main:lifespan:617 - Installing external dependencies of functions and tools...
2026-02-27 22:51:35.219 | INFO     | open_webui.utils.plugin:install_frontmatter_requirements:423 - No requirements found in frontmatter.
2026-02-27 22:51:35.221 | INFO     | open_webui.routers.openai:get_all_models:490 - get_all_models()
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: access_grant

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 694, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/main.py", line 642, in lifespan
    await get_all_models(
  File "/app/backend/open_webui/utils/models.py", line 150, in get_all_models
    custom_models = Models.get_all_models()
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/models.py", line 184, in get_all_models
    return [
           ^
  File "/app/backend/open_webui/models/models.py", line 185, in <listcomp>
    self._to_model_model(model, db=db) for model in db.query(Model).all()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/models.py", line 151, in _to_model_model
    model_data["access_grants"] = self._get_access_grants(model_data["id"], db=db)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/models.py", line 145, in _get_access_grants
    return AccessGrants.get_grants_by_resource("model", model_id, db=db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/access_grants.py", line 455, in get_grants_by_resource
    .all()
     ^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2704, in all
    return self._iter().all()  # type: ignore
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2857, in _iter
    result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
                                                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2351, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2249, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 306, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
    return meth(
           ^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 527, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: access_grant
[SQL: SELECT access_grant.id AS access_grant_id, access_grant.resource_type AS access_grant_resource_type, access_grant.resource_id AS access_grant_resource_id, access_grant.principal_type AS access_grant_principal_type, access_grant.principal_id AS access_grant_principal_id, access_grant.permission AS access_grant_permission, access_grant.created_at AS access_grant_created_at
FROM access_grant
WHERE access_grant.resource_type = ? AND access_grant.resource_id = ?]
[parameters: ('model', 'gpt-3.5-turbo-0125')]
(Background on this error at: https://sqlalche.me/e/20/e3q8)

Application startup failed. Exiting.
Loading WEBUI_SECRET_KEY from file, not provided as an environment variable.
Loading WEBUI_SECRET_KEY from .webui_secret_key
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 374d2f66af06 -> 8452d01d26d7, Add chat_message table
ERROR [open_webui.env] Error running migrations: (sqlite3.OperationalError) table chat_message already exists
[SQL:
CREATE TABLE chat_message (
        id TEXT NOT NULL,
        chat_id TEXT NOT NULL,
        user_id TEXT,
        role TEXT NOT NULL,
        parent_id TEXT,
        content JSON,
        output JSON,
        model_id TEXT,
        files JSON,
        sources JSON,
        embeds JSON,
        done BOOLEAN,
        status_history JSON,
        error JSON,
        usage JSON,
        created_at BIGINT,
        updated_at BIGINT,
        PRIMARY KEY (id),
        FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: table chat_message already exists

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/backend/open_webui/config.py", line 68, in run_migrations
    command.upgrade(alembic_cfg, "head")
  File "/usr/local/lib/python3.11/site-packages/alembic/command.py", line 483, in upgrade
    script.run_env()
  File "/usr/local/lib/python3.11/site-packages/alembic/script/base.py", line 545, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 116, in load_python_file
    module = load_module_py(module_id, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 136, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/backend/open_webui/migrations/env.py", line 108, in <module>
    run_migrations_online()
  File "/app/backend/open_webui/migrations/env.py", line 102, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/local/lib/python3.11/site-packages/alembic/runtime/environment.py", line 969, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/local/lib/python3.11/site-packages/alembic/runtime/migration.py", line 626, in run_migrations
    step.migration_fn(**kw)
  File "/app/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py", line 27, in upgrade
    op.create_table(
  File "<string>", line 8, in create_table
  File "<string>", line 3, in create_table
  File "/usr/local/lib/python3.11/site-packages/alembic/operations/ops.py", line 1331, in create_table
    return operations.invoke(op)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/alembic/operations/base.py", line 452, in invoke
    return fn(self, operation)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/alembic/operations/toimpl.py", line 140, in create_table
    operations.impl.create_table(table, **kw)
  File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 440, in create_table
    self._exec(schema.CreateTable(table, **kw))
  File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 256, in _exec
    return conn.execute(construct, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
    return meth(
           ^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 187, in _execute_on_connection
    return connection._execute_ddl(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1530, in _execute_ddl
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table chat_message already exists
[SQL:
CREATE TABLE chat_message (
        id TEXT NOT NULL,
        chat_id TEXT NOT NULL,
        user_id TEXT,
        role TEXT NOT NULL,
        parent_id TEXT,
        content JSON,
        output JSON,
        model_id TEXT,
        files JSON,
        sources JSON,
        embeds JSON,
        done BOOLEAN,
        status_history JSON,
        error JSON,
        usage JSON,
        created_at BIGINT,
        updated_at BIGINT,
        PRIMARY KEY (id),
        FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
WARNI [open_webui.env] ⚠️  SECURITY WARNING: JWT_EXPIRES_IN is set to '-1'
    See: https://docs.openwebui.com/getting-started/env-configuration

WARNI [open_webui.env]

WARNING: CORS_ALLOW_ORIGIN IS SET TO '*' - NOT RECOMMENDED FOR PRODUCTION DEPLOYMENTS.

WARNI [langchain_community.utils.user_agent] USER_AGENT environment variable not set, consider setting it to identify your requests.

 ██████╗ ██████╗ ███████╗███╗   ██╗    ██╗    ██╗███████╗██████╗ ██╗   ██╗██╗
██╔═══██╗██╔══██╗██╔════╝████╗  ██║    ██║    ██║██╔════╝██╔══██╗██║   ██║██║
██║   ██║██████╔╝█████╗  ██╔██╗ ██║    ██║ █╗ ██║█████╗  ██████╔╝██║   ██║██║
██║   ██║██╔═══╝ ██╔══╝  ██║╚██╗██║    ██║███╗██║██╔══╝  ██╔══██╗██║   ██║██║
╚██████╔╝██║     ███████╗██║ ╚████║    ╚███╔███╔╝███████╗██████╔╝╚██████╔╝██║
 ╚═════╝ ╚═╝     ╚══════╝╚═╝  ╚═══╝     ╚══╝╚══╝ ╚══════╝╚═════╝  ╚═════╝ ╚═╝


v0.8.2 - building the best AI user interface.

https://github.com/open-webui/open-webui

INFO:     Started server process [1]
INFO:     Waiting for application startup.
2026-02-27 22:54:05.821 | INFO     | open_webui.utils.logger:start_logger:165 - GLOBAL_LOG_LEVEL: INFO
2026-02-27 22:54:05.821 | INFO     | open_webui.main:lifespan:617 - Installing external dependencies of functions and tools...
2026-02-27 22:54:05.834 | INFO     | open_webui.utils.plugin:install_frontmatter_requirements:423 - No requirements found in frontmatter.
2026-02-27 22:54:05.836 | INFO     | open_webui.routers.openai:get_all_models:490 - get_all_models()
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: access_grant

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 694, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/main.py", line 642, in lifespan
    await get_all_models(
  File "/app/backend/open_webui/utils/models.py", line 150, in get_all_models
    custom_models = Models.get_all_models()
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/models.py", line 184, in get_all_models
    return [
           ^
  File "/app/backend/open_webui/models/models.py", line 185, in <listcomp>
    self._to_model_model(model, db=db) for model in db.query(Model).all()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/models.py", line 151, in _to_model_model
    model_data["access_grants"] = self._get_access_grants(model_data["id"], db=db)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/models.py", line 145, in _get_access_grants
    return AccessGrants.get_grants_by_resource("model", model_id, db=db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/access_grants.py", line 455, in get_grants_by_resource
    .all()
     ^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2704, in all
    return self._iter().all()  # type: ignore
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2857, in _iter
    result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
                                                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2351, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2249, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 306, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
    return meth(
           ^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 527, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: access_grant
[SQL: SELECT access_grant.id AS access_grant_id, access_grant.resource_type AS access_grant_resource_type, access_grant.resource_id AS access_grant_resource_id, access_grant.principal_type AS access_grant_principal_type, access_grant.principal_id AS access_grant_principal_id, access_grant.permission AS access_grant_permission, access_grant.created_at AS access_grant_created_at
FROM access_grant
WHERE access_grant.resource_type = ? AND access_grant.resource_id = ?]
[parameters: ('model', 'gpt-3.5-turbo-0125')]
(Background on this error at: https://sqlalche.me/e/20/e3q8)

Application startup failed. Exiting.
Loading WEBUI_SECRET_KEY from file, not provided as an environment variable.
Loading WEBUI_SECRET_KEY from .webui_secret_key
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 374d2f66af06 -> 8452d01d26d7, Add chat_message table
ERROR [open_webui.env] Error running migrations: (sqlite3.OperationalError) table chat_message already exists
[SQL:
CREATE TABLE chat_message (
        id TEXT NOT NULL,
        chat_id TEXT NOT NULL,
        user_id TEXT,
        role TEXT NOT NULL,
        parent_id TEXT,
        content JSON,
        output JSON,
        model_id TEXT,
        files JSON,
        sources JSON,
        embeds JSON,
        done BOOLEAN,
        status_history JSON,
        error JSON,
        usage JSON,
        created_at BIGINT,
        updated_at BIGINT,
        PRIMARY KEY (id),
        FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: table chat_message already exists

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/backend/open_webui/config.py", line 68, in run_migrations
    command.upgrade(alembic_cfg, "head")
  File "/usr/local/lib/python3.11/site-packages/alembic/command.py", line 483, in upgrade
    script.run_env()
  File "/usr/local/lib/python3.11/site-packages/alembic/script/base.py", line 545, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 116, in load_python_file
    module = load_module_py(module_id, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 136, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/backend/open_webui/migrations/env.py", line 108, in <module>
    run_migrations_online()
  File "/app/backend/open_webui/migrations/env.py", line 102, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/local/lib/python3.11/site-packages/alembic/runtime/environment.py", line 969, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/local/lib/python3.11/site-packages/alembic/runtime/migration.py", line 626, in run_migrations
    step.migration_fn(**kw)
  File "/app/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py", line 27, in upgrade
    op.create_table(
  File "<string>", line 8, in create_table
  File "<string>", line 3, in create_table
  File "/usr/local/lib/python3.11/site-packages/alembic/operations/ops.py", line 1331, in create_table
    return operations.invoke(op)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/alembic/operations/base.py", line 452, in invoke
    return fn(self, operation)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/alembic/operations/toimpl.py", line 140, in create_table
    operations.impl.create_table(table, **kw)
  File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 440, in create_table
    self._exec(schema.CreateTable(table, **kw))
  File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 256, in _exec
    return conn.execute(construct, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
    return meth(
           ^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 187, in _execute_on_connection
    return connection._execute_ddl(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1530, in _execute_ddl
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table chat_message already exists
[SQL:
CREATE TABLE chat_message (
        id TEXT NOT NULL,
        chat_id TEXT NOT NULL,
        user_id TEXT,
        role TEXT NOT NULL,
        parent_id TEXT,
        content JSON,
        output JSON,
        model_id TEXT,
        files JSON,
        sources JSON,
        embeds JSON,
        done BOOLEAN,
        status_history JSON,
        error JSON,
        usage JSON,
        created_at BIGINT,
        updated_at BIGINT,
        PRIMARY KEY (id),
        FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
WARNI [open_webui.env] ⚠️  SECURITY WARNING: JWT_EXPIRES_IN is set to '-1'
    See: https://docs.openwebui.com/getting-started/env-configuration

WARNI [open_webui.env]

WARNING: CORS_ALLOW_ORIGIN IS SET TO '*' - NOT RECOMMENDED FOR PRODUCTION DEPLOYMENTS.

WARNI [langchain_community.utils.user_agent] USER_AGENT environment variable not set, consider setting it to identify your requests.

 ██████╗ ██████╗ ███████╗███╗   ██╗    ██╗    ██╗███████╗██████╗ ██╗   ██╗██╗
██╔═══██╗██╔══██╗██╔════╝████╗  ██║    ██║    ██║██╔════╝██╔══██╗██║   ██║██║
██║   ██║██████╔╝█████╗  ██╔██╗ ██║    ██║ █╗ ██║█████╗  ██████╔╝██║   ██║██║
██║   ██║██╔═══╝ ██╔══╝  ██║╚██╗██║    ██║███╗██║██╔══╝  ██╔══██╗██║   ██║██║
╚██████╔╝██║     ███████╗██║ ╚████║    ╚███╔███╔╝███████╗██████╔╝╚██████╔╝██║
 ╚═════╝ ╚═╝     ╚══════╝╚═╝  ╚═══╝     ╚══╝╚══╝ ╚══════╝╚═════╝  ╚═════╝ ╚═╝


v0.8.2 - building the best AI user interface.

https://github.com/open-webui/open-webui

INFO:     Started server process [1]
INFO:     Waiting for application startup.
2026-02-27 23:14:59.940 | INFO     | open_webui.utils.logger:start_logger:165 - GLOBAL_LOG_LEVEL: INFO
2026-02-27 23:14:59.940 | INFO     | open_webui.main:lifespan:617 - Installing external dependencies of functions and tools...
2026-02-27 23:14:59.953 | INFO     | open_webui.utils.plugin:install_frontmatter_requirements:423 - No requirements found in frontmatter.
2026-02-27 23:14:59.955 | INFO     | open_webui.routers.openai:get_all_models:490 - get_all_models()
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: access_grant

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 694, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan
    async with original_context(app) as maybe_original_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/main.py", line 642, in lifespan
    await get_all_models(
  File "/app/backend/open_webui/utils/models.py", line 150, in get_all_models
    custom_models = Models.get_all_models()
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/models.py", line 184, in get_all_models
    return [
           ^
  File "/app/backend/open_webui/models/models.py", line 185, in <listcomp>
    self._to_model_model(model, db=db) for model in db.query(Model).all()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/models.py", line 151, in _to_model_model
    model_data["access_grants"] = self._get_access_grants(model_data["id"], db=db)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/models.py", line 145, in _get_access_grants
    return AccessGrants.get_grants_by_resource("model", model_id, db=db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/access_grants.py", line 455, in get_grants_by_resource
    .all()
     ^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2704, in all
    return self._iter().all()  # type: ignore
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2857, in _iter
    result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
                                                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2351, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2249, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 306, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
    return meth(
           ^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 527, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: access_grant
[SQL: SELECT access_grant.id AS access_grant_id, access_grant.resource_type AS access_grant_resource_type, access_grant.resource_id AS access_grant_resource_id, access_grant.principal_type AS access_grant_principal_type, access_grant.principal_id AS access_grant_principal_id, access_grant.permission AS access_grant_permission, access_grant.created_at AS access_grant_created_at
FROM access_grant
WHERE access_grant.resource_type = ? AND access_grant.resource_id = ?]
[parameters: ('model', 'gpt-3.5-turbo-0125')]
(Background on this error at: https://sqlalche.me/e/20/e3q8)

Application startup failed. Exiting.

Additional Information

The instance is able to boot without attaching the database from the older versions. The problem may caused by the migration part of the newer versions.

Originally created by @Oatu4396 on GitHub (Feb 27, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/21945 ### 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 v0.7.2, v0.8.0 - v0.8.5 ### Ollama Version (if applicable) _No response_ ### Operating System 6.1.96-102.177.amzn2023.x86_64 GNU/Linux; Windows 11, version 25H2 ### Browser (if applicable) Chrome, Safari ### 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 After updating from `v0.7.2` to `v0.8.x', the database will update and migrate automatically. The instance should boot without any error. ### Actual Behavior Reproduce with both Linux and Windows docker: The instance works perfect on `v0.7.2`. After update to version `v0.8.0` and `v0.8.1`, the docker instance will quit automatically with Error code `3`. After update to version `v0.8.2` and above, the webpage shows the Open WebUI Backend Required error and cannot login. ### Steps to Reproduce 1. Start with a database from `v0.7.2` or older; 2. Choose an arbitrary platform; 3. Deploy the instance with docker using the default deploy command from the documentation, `docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:v0.x.x`; 4. Login to webui through localhost:3000. ### Logs & Screenshots The following log is from a `v0.8.2` instance: ``` Loading WEBUI_SECRET_KEY from file, not provided as an environment variable. Generating WEBUI_SECRET_KEY Loading WEBUI_SECRET_KEY from .webui_secret_key INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. INFO [alembic.runtime.migration] Running upgrade 374d2f66af06 -> 8452d01d26d7, Add chat_message table ERROR [open_webui.env] Error running migrations: (sqlite3.OperationalError) table chat_message already exists [SQL: CREATE TABLE chat_message ( id TEXT NOT NULL, chat_id TEXT NOT NULL, user_id TEXT, role TEXT NOT NULL, parent_id TEXT, content JSON, output JSON, model_id TEXT, files JSON, sources JSON, embeds JSON, done BOOLEAN, status_history JSON, error JSON, usage JSON, created_at BIGINT, updated_at BIGINT, PRIMARY KEY (id), FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE ) ] (Background on this error at: https://sqlalche.me/e/20/e3q8) Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: table chat_message already exists The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/backend/open_webui/config.py", line 68, in run_migrations command.upgrade(alembic_cfg, "head") File "/usr/local/lib/python3.11/site-packages/alembic/command.py", line 483, in upgrade script.run_env() File "/usr/local/lib/python3.11/site-packages/alembic/script/base.py", line 545, in run_env util.load_python_file(self.dir, "env.py") File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 116, in load_python_file module = load_module_py(module_id, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 136, in load_module_py spec.loader.exec_module(module) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/app/backend/open_webui/migrations/env.py", line 108, in <module> run_migrations_online() File "/app/backend/open_webui/migrations/env.py", line 102, in run_migrations_online context.run_migrations() File "<string>", line 8, in run_migrations File "/usr/local/lib/python3.11/site-packages/alembic/runtime/environment.py", line 969, in run_migrations self.get_context().run_migrations(**kw) File "/usr/local/lib/python3.11/site-packages/alembic/runtime/migration.py", line 626, in run_migrations step.migration_fn(**kw) File "/app/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py", line 27, in upgrade op.create_table( File "<string>", line 8, in create_table File "<string>", line 3, in create_table File "/usr/local/lib/python3.11/site-packages/alembic/operations/ops.py", line 1331, in create_table return operations.invoke(op) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/operations/base.py", line 452, in invoke return fn(self, operation) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/operations/toimpl.py", line 140, in create_table operations.impl.create_table(table, **kw) File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 440, in create_table self._exec(schema.CreateTable(table, **kw)) File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 256, in _exec return conn.execute(construct, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute return meth( ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 187, in _execute_on_connection return connection._execute_ddl( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1530, in _execute_ddl ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context self._handle_dbapi_exception( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table chat_message already exists [SQL: CREATE TABLE chat_message ( id TEXT NOT NULL, chat_id TEXT NOT NULL, user_id TEXT, role TEXT NOT NULL, parent_id TEXT, content JSON, output JSON, model_id TEXT, files JSON, sources JSON, embeds JSON, done BOOLEAN, status_history JSON, error JSON, usage JSON, created_at BIGINT, updated_at BIGINT, PRIMARY KEY (id), FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE ) ] (Background on this error at: https://sqlalche.me/e/20/e3q8) WARNI [open_webui.env] ⚠️ SECURITY WARNING: JWT_EXPIRES_IN is set to '-1' See: https://docs.openwebui.com/getting-started/env-configuration WARNI [open_webui.env] WARNING: CORS_ALLOW_ORIGIN IS SET TO '*' - NOT RECOMMENDED FOR PRODUCTION DEPLOYMENTS. WARNI [langchain_community.utils.user_agent] USER_AGENT environment variable not set, consider setting it to identify your requests. ██████╗ ██████╗ ███████╗███╗ ██╗ ██╗ ██╗███████╗██████╗ ██╗ ██╗██╗ ██╔═══██╗██╔══██╗██╔════╝████╗ ██║ ██║ ██║██╔════╝██╔══██╗██║ ██║██║ ██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ █╗ ██║█████╗ ██████╔╝██║ ██║██║ ██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║███╗██║██╔══╝ ██╔══██╗██║ ██║██║ ╚██████╔╝██║ ███████╗██║ ╚████║ ╚███╔███╔╝███████╗██████╔╝╚██████╔╝██║ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚══╝╚══╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ v0.8.2 - building the best AI user interface. https://github.com/open-webui/open-webui INFO: Started server process [1] INFO: Waiting for application startup. 2026-02-27 22:51:35.206 | INFO | open_webui.utils.logger:start_logger:165 - GLOBAL_LOG_LEVEL: INFO 2026-02-27 22:51:35.206 | INFO | open_webui.main:lifespan:617 - Installing external dependencies of functions and tools... 2026-02-27 22:51:35.219 | INFO | open_webui.utils.plugin:install_frontmatter_requirements:423 - No requirements found in frontmatter. 2026-02-27 22:51:35.221 | INFO | open_webui.routers.openai:get_all_models:490 - get_all_models() Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: no such table: access_grant The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 694, in lifespan async with self.lifespan_context(app) as maybe_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/main.py", line 642, in lifespan await get_all_models( File "/app/backend/open_webui/utils/models.py", line 150, in get_all_models custom_models = Models.get_all_models() ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/models.py", line 184, in get_all_models return [ ^ File "/app/backend/open_webui/models/models.py", line 185, in <listcomp> self._to_model_model(model, db=db) for model in db.query(Model).all() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/models.py", line 151, in _to_model_model model_data["access_grants"] = self._get_access_grants(model_data["id"], db=db) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/models.py", line 145, in _get_access_grants return AccessGrants.get_grants_by_resource("model", model_id, db=db) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/access_grants.py", line 455, in get_grants_by_resource .all() ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2704, in all return self._iter().all() # type: ignore ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2857, in _iter result: Union[ScalarResult[_T], Result[_T]] = self.session.execute( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2351, in execute return self._execute_internal( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2249, in _execute_internal result: Result[Any] = compile_state_cls.orm_execute_statement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 306, in orm_execute_statement result = conn.execute( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute return meth( ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 527, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context self._handle_dbapi_exception( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: access_grant [SQL: SELECT access_grant.id AS access_grant_id, access_grant.resource_type AS access_grant_resource_type, access_grant.resource_id AS access_grant_resource_id, access_grant.principal_type AS access_grant_principal_type, access_grant.principal_id AS access_grant_principal_id, access_grant.permission AS access_grant_permission, access_grant.created_at AS access_grant_created_at FROM access_grant WHERE access_grant.resource_type = ? AND access_grant.resource_id = ?] [parameters: ('model', 'gpt-3.5-turbo-0125')] (Background on this error at: https://sqlalche.me/e/20/e3q8) Application startup failed. Exiting. Loading WEBUI_SECRET_KEY from file, not provided as an environment variable. Loading WEBUI_SECRET_KEY from .webui_secret_key INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. INFO [alembic.runtime.migration] Running upgrade 374d2f66af06 -> 8452d01d26d7, Add chat_message table ERROR [open_webui.env] Error running migrations: (sqlite3.OperationalError) table chat_message already exists [SQL: CREATE TABLE chat_message ( id TEXT NOT NULL, chat_id TEXT NOT NULL, user_id TEXT, role TEXT NOT NULL, parent_id TEXT, content JSON, output JSON, model_id TEXT, files JSON, sources JSON, embeds JSON, done BOOLEAN, status_history JSON, error JSON, usage JSON, created_at BIGINT, updated_at BIGINT, PRIMARY KEY (id), FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE ) ] (Background on this error at: https://sqlalche.me/e/20/e3q8) Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: table chat_message already exists The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/backend/open_webui/config.py", line 68, in run_migrations command.upgrade(alembic_cfg, "head") File "/usr/local/lib/python3.11/site-packages/alembic/command.py", line 483, in upgrade script.run_env() File "/usr/local/lib/python3.11/site-packages/alembic/script/base.py", line 545, in run_env util.load_python_file(self.dir, "env.py") File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 116, in load_python_file module = load_module_py(module_id, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 136, in load_module_py spec.loader.exec_module(module) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/app/backend/open_webui/migrations/env.py", line 108, in <module> run_migrations_online() File "/app/backend/open_webui/migrations/env.py", line 102, in run_migrations_online context.run_migrations() File "<string>", line 8, in run_migrations File "/usr/local/lib/python3.11/site-packages/alembic/runtime/environment.py", line 969, in run_migrations self.get_context().run_migrations(**kw) File "/usr/local/lib/python3.11/site-packages/alembic/runtime/migration.py", line 626, in run_migrations step.migration_fn(**kw) File "/app/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py", line 27, in upgrade op.create_table( File "<string>", line 8, in create_table File "<string>", line 3, in create_table File "/usr/local/lib/python3.11/site-packages/alembic/operations/ops.py", line 1331, in create_table return operations.invoke(op) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/operations/base.py", line 452, in invoke return fn(self, operation) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/operations/toimpl.py", line 140, in create_table operations.impl.create_table(table, **kw) File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 440, in create_table self._exec(schema.CreateTable(table, **kw)) File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 256, in _exec return conn.execute(construct, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute return meth( ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 187, in _execute_on_connection return connection._execute_ddl( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1530, in _execute_ddl ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context self._handle_dbapi_exception( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table chat_message already exists [SQL: CREATE TABLE chat_message ( id TEXT NOT NULL, chat_id TEXT NOT NULL, user_id TEXT, role TEXT NOT NULL, parent_id TEXT, content JSON, output JSON, model_id TEXT, files JSON, sources JSON, embeds JSON, done BOOLEAN, status_history JSON, error JSON, usage JSON, created_at BIGINT, updated_at BIGINT, PRIMARY KEY (id), FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE ) ] (Background on this error at: https://sqlalche.me/e/20/e3q8) WARNI [open_webui.env] ⚠️ SECURITY WARNING: JWT_EXPIRES_IN is set to '-1' See: https://docs.openwebui.com/getting-started/env-configuration WARNI [open_webui.env] WARNING: CORS_ALLOW_ORIGIN IS SET TO '*' - NOT RECOMMENDED FOR PRODUCTION DEPLOYMENTS. WARNI [langchain_community.utils.user_agent] USER_AGENT environment variable not set, consider setting it to identify your requests. ██████╗ ██████╗ ███████╗███╗ ██╗ ██╗ ██╗███████╗██████╗ ██╗ ██╗██╗ ██╔═══██╗██╔══██╗██╔════╝████╗ ██║ ██║ ██║██╔════╝██╔══██╗██║ ██║██║ ██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ █╗ ██║█████╗ ██████╔╝██║ ██║██║ ██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║███╗██║██╔══╝ ██╔══██╗██║ ██║██║ ╚██████╔╝██║ ███████╗██║ ╚████║ ╚███╔███╔╝███████╗██████╔╝╚██████╔╝██║ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚══╝╚══╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ v0.8.2 - building the best AI user interface. https://github.com/open-webui/open-webui INFO: Started server process [1] INFO: Waiting for application startup. 2026-02-27 22:54:05.821 | INFO | open_webui.utils.logger:start_logger:165 - GLOBAL_LOG_LEVEL: INFO 2026-02-27 22:54:05.821 | INFO | open_webui.main:lifespan:617 - Installing external dependencies of functions and tools... 2026-02-27 22:54:05.834 | INFO | open_webui.utils.plugin:install_frontmatter_requirements:423 - No requirements found in frontmatter. 2026-02-27 22:54:05.836 | INFO | open_webui.routers.openai:get_all_models:490 - get_all_models() Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: no such table: access_grant The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 694, in lifespan async with self.lifespan_context(app) as maybe_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/main.py", line 642, in lifespan await get_all_models( File "/app/backend/open_webui/utils/models.py", line 150, in get_all_models custom_models = Models.get_all_models() ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/models.py", line 184, in get_all_models return [ ^ File "/app/backend/open_webui/models/models.py", line 185, in <listcomp> self._to_model_model(model, db=db) for model in db.query(Model).all() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/models.py", line 151, in _to_model_model model_data["access_grants"] = self._get_access_grants(model_data["id"], db=db) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/models.py", line 145, in _get_access_grants return AccessGrants.get_grants_by_resource("model", model_id, db=db) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/access_grants.py", line 455, in get_grants_by_resource .all() ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2704, in all return self._iter().all() # type: ignore ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2857, in _iter result: Union[ScalarResult[_T], Result[_T]] = self.session.execute( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2351, in execute return self._execute_internal( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2249, in _execute_internal result: Result[Any] = compile_state_cls.orm_execute_statement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 306, in orm_execute_statement result = conn.execute( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute return meth( ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 527, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context self._handle_dbapi_exception( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: access_grant [SQL: SELECT access_grant.id AS access_grant_id, access_grant.resource_type AS access_grant_resource_type, access_grant.resource_id AS access_grant_resource_id, access_grant.principal_type AS access_grant_principal_type, access_grant.principal_id AS access_grant_principal_id, access_grant.permission AS access_grant_permission, access_grant.created_at AS access_grant_created_at FROM access_grant WHERE access_grant.resource_type = ? AND access_grant.resource_id = ?] [parameters: ('model', 'gpt-3.5-turbo-0125')] (Background on this error at: https://sqlalche.me/e/20/e3q8) Application startup failed. Exiting. Loading WEBUI_SECRET_KEY from file, not provided as an environment variable. Loading WEBUI_SECRET_KEY from .webui_secret_key INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. INFO [alembic.runtime.migration] Running upgrade 374d2f66af06 -> 8452d01d26d7, Add chat_message table ERROR [open_webui.env] Error running migrations: (sqlite3.OperationalError) table chat_message already exists [SQL: CREATE TABLE chat_message ( id TEXT NOT NULL, chat_id TEXT NOT NULL, user_id TEXT, role TEXT NOT NULL, parent_id TEXT, content JSON, output JSON, model_id TEXT, files JSON, sources JSON, embeds JSON, done BOOLEAN, status_history JSON, error JSON, usage JSON, created_at BIGINT, updated_at BIGINT, PRIMARY KEY (id), FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE ) ] (Background on this error at: https://sqlalche.me/e/20/e3q8) Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: table chat_message already exists The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/backend/open_webui/config.py", line 68, in run_migrations command.upgrade(alembic_cfg, "head") File "/usr/local/lib/python3.11/site-packages/alembic/command.py", line 483, in upgrade script.run_env() File "/usr/local/lib/python3.11/site-packages/alembic/script/base.py", line 545, in run_env util.load_python_file(self.dir, "env.py") File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 116, in load_python_file module = load_module_py(module_id, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 136, in load_module_py spec.loader.exec_module(module) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/app/backend/open_webui/migrations/env.py", line 108, in <module> run_migrations_online() File "/app/backend/open_webui/migrations/env.py", line 102, in run_migrations_online context.run_migrations() File "<string>", line 8, in run_migrations File "/usr/local/lib/python3.11/site-packages/alembic/runtime/environment.py", line 969, in run_migrations self.get_context().run_migrations(**kw) File "/usr/local/lib/python3.11/site-packages/alembic/runtime/migration.py", line 626, in run_migrations step.migration_fn(**kw) File "/app/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py", line 27, in upgrade op.create_table( File "<string>", line 8, in create_table File "<string>", line 3, in create_table File "/usr/local/lib/python3.11/site-packages/alembic/operations/ops.py", line 1331, in create_table return operations.invoke(op) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/operations/base.py", line 452, in invoke return fn(self, operation) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/operations/toimpl.py", line 140, in create_table operations.impl.create_table(table, **kw) File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 440, in create_table self._exec(schema.CreateTable(table, **kw)) File "/usr/local/lib/python3.11/site-packages/alembic/ddl/impl.py", line 256, in _exec return conn.execute(construct, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute return meth( ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 187, in _execute_on_connection return connection._execute_ddl( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1530, in _execute_ddl ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context self._handle_dbapi_exception( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table chat_message already exists [SQL: CREATE TABLE chat_message ( id TEXT NOT NULL, chat_id TEXT NOT NULL, user_id TEXT, role TEXT NOT NULL, parent_id TEXT, content JSON, output JSON, model_id TEXT, files JSON, sources JSON, embeds JSON, done BOOLEAN, status_history JSON, error JSON, usage JSON, created_at BIGINT, updated_at BIGINT, PRIMARY KEY (id), FOREIGN KEY(chat_id) REFERENCES chat (id) ON DELETE CASCADE ) ] (Background on this error at: https://sqlalche.me/e/20/e3q8) WARNI [open_webui.env] ⚠️ SECURITY WARNING: JWT_EXPIRES_IN is set to '-1' See: https://docs.openwebui.com/getting-started/env-configuration WARNI [open_webui.env] WARNING: CORS_ALLOW_ORIGIN IS SET TO '*' - NOT RECOMMENDED FOR PRODUCTION DEPLOYMENTS. WARNI [langchain_community.utils.user_agent] USER_AGENT environment variable not set, consider setting it to identify your requests. ██████╗ ██████╗ ███████╗███╗ ██╗ ██╗ ██╗███████╗██████╗ ██╗ ██╗██╗ ██╔═══██╗██╔══██╗██╔════╝████╗ ██║ ██║ ██║██╔════╝██╔══██╗██║ ██║██║ ██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ █╗ ██║█████╗ ██████╔╝██║ ██║██║ ██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║███╗██║██╔══╝ ██╔══██╗██║ ██║██║ ╚██████╔╝██║ ███████╗██║ ╚████║ ╚███╔███╔╝███████╗██████╔╝╚██████╔╝██║ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚══╝╚══╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ v0.8.2 - building the best AI user interface. https://github.com/open-webui/open-webui INFO: Started server process [1] INFO: Waiting for application startup. 2026-02-27 23:14:59.940 | INFO | open_webui.utils.logger:start_logger:165 - GLOBAL_LOG_LEVEL: INFO 2026-02-27 23:14:59.940 | INFO | open_webui.main:lifespan:617 - Installing external dependencies of functions and tools... 2026-02-27 23:14:59.953 | INFO | open_webui.utils.plugin:install_frontmatter_requirements:423 - No requirements found in frontmatter. 2026-02-27 23:14:59.955 | INFO | open_webui.routers.openai:get_all_models:490 - get_all_models() Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: no such table: access_grant The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 694, in lifespan async with self.lifespan_context(app) as maybe_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 203, in merged_lifespan async with original_context(app) as maybe_original_state: File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/main.py", line 642, in lifespan await get_all_models( File "/app/backend/open_webui/utils/models.py", line 150, in get_all_models custom_models = Models.get_all_models() ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/models.py", line 184, in get_all_models return [ ^ File "/app/backend/open_webui/models/models.py", line 185, in <listcomp> self._to_model_model(model, db=db) for model in db.query(Model).all() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/models.py", line 151, in _to_model_model model_data["access_grants"] = self._get_access_grants(model_data["id"], db=db) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/models.py", line 145, in _get_access_grants return AccessGrants.get_grants_by_resource("model", model_id, db=db) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/access_grants.py", line 455, in get_grants_by_resource .all() ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2704, in all return self._iter().all() # type: ignore ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2857, in _iter result: Union[ScalarResult[_T], Result[_T]] = self.session.execute( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2351, in execute return self._execute_internal( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2249, in _execute_internal result: Result[Any] = compile_state_cls.orm_execute_statement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 306, in orm_execute_statement result = conn.execute( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute return meth( ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 527, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context self._handle_dbapi_exception( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: access_grant [SQL: SELECT access_grant.id AS access_grant_id, access_grant.resource_type AS access_grant_resource_type, access_grant.resource_id AS access_grant_resource_id, access_grant.principal_type AS access_grant_principal_type, access_grant.principal_id AS access_grant_principal_id, access_grant.permission AS access_grant_permission, access_grant.created_at AS access_grant_created_at FROM access_grant WHERE access_grant.resource_type = ? AND access_grant.resource_id = ?] [parameters: ('model', 'gpt-3.5-turbo-0125')] (Background on this error at: https://sqlalche.me/e/20/e3q8) Application startup failed. Exiting. ``` ### Additional Information The instance is able to boot without attaching the database from the older versions. The problem may caused by the migration part of the newer versions.
GiteaMirror added the bug label 2026-05-15 15:36:18 -05:00
Author
Owner

@Classic298 commented on GitHub (Feb 28, 2026):

https://docs.openwebui.com/troubleshooting/manual-database-migration

<!-- gh-comment-id:3975817098 --> @Classic298 commented on GitHub (Feb 28, 2026): https://docs.openwebui.com/troubleshooting/manual-database-migration
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#90360