[GH-ISSUE #21422] issue: Database Migration Error #90216

Closed
opened 2026-05-15 15:23:50 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @bran1210 on GitHub (Feb 14, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21422

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.8.1

Ollama Version (if applicable)

v0.16.1

Operating System

Windows 11

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

SQLite database upgrade from v0.7.2 to v.0.8.1.

Actual Behavior

Filed to migrate database, closing the containing after each start attempt.

Steps to Reproduce

  1. upgraded container from v.0.7.2 to v.0.8.1.
  2. Ran container, pointing to existing volume.
  3. During startup, fatal database migration errors.
  4. Attempted suggested fixes in previously closed issued, and updates from website to attempt manual migration.
  5. Set environmental variables, allows alembic commands to work. Not all steps to verify version were successful, and manual migration failed when creating chat table.
  6. Logs provided from container.

Logs & Screenshots

root@684d040bf15d:/app/backend/open_webui# alembic current -v
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Current revision(s) for sqlite:////app/backend/data/webui.db:
Rev: 374d2f66af06
Parent: c440947495f3
Path: /app/backend/open_webui/migrations/versions/374d2f66af06_add_prompt_history_table.py

Add prompt history table

Revision ID: 374d2f66af06
Revises: c440947495f3
Create Date: 2026-01-23 17:15:00.000000

root@684d040bf15d:/app/backend/open_webui# alembic heads
b2c3d4e5f6a7 (head)
root@684d040bf15d:/app/backend/open_webui# alembic history
a1b2c3d4e5f6 -> b2c3d4e5f6a7 (head), add scim column to user table
f1e2d3c4b5a6 -> a1b2c3d4e5f6, Add skill table
8452d01d26d7 -> f1e2d3c4b5a6, Add access_grant table
374d2f66af06 -> 8452d01d26d7, Add chat_message table
c440947495f3 -> 374d2f66af06, Add prompt history table
81cc2ce44d79 -> c440947495f3, Add chat_file table
6283dc0e4d8d -> 81cc2ce44d79, Update channel file and knowledge table
3e0e00844bb0 -> 6283dc0e4d8d, Add channel file table
90ef40d4714e -> 3e0e00844bb0, Add knowledge_file table
b10670c03dd5 -> 90ef40d4714e, Update channel and channel members table
2f1211949ecc -> b10670c03dd5, Update user table
37f288994c47 -> 2f1211949ecc, Update messages and channel member table
a5c220713937 -> 37f288994c47, add_group_member_table
38d63c18f30f -> a5c220713937, Add reply_to_id column to message
3af16a1c9fb6 -> 38d63c18f30f, Add oauth_session table
018012973d35 -> 3af16a1c9fb6, update user table
d31026856c01 -> 018012973d35, Add indexes
9f0c9cd09105 -> d31026856c01, Update folder table data
3781e22d8b01 -> 9f0c9cd09105, Add note table
7826ab40b532 -> 3781e22d8b01, Update message & channel tables
57c599a3cb57 -> 7826ab40b532, Update file table
922e7a387820 -> 57c599a3cb57, Add channel table
4ace53fd72c8 -> 922e7a387820, Add group table
af906e964978 -> 4ace53fd72c8, Update folder table and change DateTime to BigInteger for timestamp fields
c29facfe716b -> af906e964978, Add feedback table
c69f45358db4 -> c29facfe716b, Update file table path
3ab32c4b8f59 -> c69f45358db4, Add folder table
1af9b942657b -> 3ab32c4b8f59, Update tags
242a2047eae0 -> 1af9b942657b, Migrate tags
6a39f3d8e55c -> 242a2047eae0, Update chat table
c0fbf31ca0db -> 6a39f3d8e55c, Add knowledge table
ca81bd47c050 -> c0fbf31ca0db, Update file table
7e5b5dc7342b -> ca81bd47c050, Add config table

-> 7e5b5dc7342b, init root@684d040bf15d:/app/backend/open_webui# alembic upgrade head --sql | head -30 INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Generating static SQL INFO [alembic.runtime.migration] Will assume non-transactional DDL. CREATE TABLE alembic_version ( version_num VARCHAR(32) NOT NULL, CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num) );

INFO [alembic.runtime.migration] Running upgrade -> 7e5b5dc7342b, init
-- Running upgrade -> 7e5b5dc7342b

Traceback (most recent call last):
File "/usr/local/bin/alembic", line 10, in
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 1047, in main
CommandLine(prog=prog).main(argv=argv)
File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 1037, in main
self.run_cmd(cfg, options)
File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 971, in run_cmd
fn(
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 "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/app/backend/open_webui/migrations/env.py", line 106, in
run_migrations_offline()
File "/app/backend/open_webui/migrations/env.py", line 55, in run_migrations_offline
context.run_migrations()
File "", 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/7e5b5dc7342b_init.py", line 26, in upgrade
existing_tables = set(get_existing_tables())
^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/../open_webui/migrations/util.py", line 7, in get_existing_tables
inspector = Inspector.from_engine(con)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 2, in from_engine
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 386, in warned
return fn(*args, **kwargs) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/reflection.py", line 309, in from_engine
return cls._construct(cls._init_legacy, bind)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/reflection.py", line 246, in _construct
init(self, bind)
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/reflection.py", line 253, in _init_legacy
self._init_engine(bind)
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/reflection.py", line 257, in _init_engine
engine.connect().close()
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MockConnection' object has no attribute 'close'
root@684d040bf15d:/app/backend/open_webui# alembic branches
root@684d040bf15d:/app/backend/open_webui# alembic upgrade head
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
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 "/usr/local/bin/alembic", line 10, in
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 1047, in main
CommandLine(prog=prog).main(argv=argv)
File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 1037, in main
self.run_cmd(cfg, options)
File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 971, in run_cmd
fn(
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 "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/app/backend/open_webui/migrations/env.py", line 108, in
run_migrations_online()
File "/app/backend/open_webui/migrations/env.py", line 102, in run_migrations_online
context.run_migrations()
File "", 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 "", line 8, in create_table
File "", 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)

Additional Information

No response

Originally created by @bran1210 on GitHub (Feb 14, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/21422 ### 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.8.1 ### Ollama Version (if applicable) v0.16.1 ### Operating System Windows 11 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior SQLite database upgrade from v0.7.2 to v.0.8.1. ### Actual Behavior Filed to migrate database, closing the containing after each start attempt. ### Steps to Reproduce 1. upgraded container from v.0.7.2 to v.0.8.1. 2. Ran container, pointing to existing volume. 3. During startup, fatal database migration errors. 4. Attempted suggested fixes in previously closed issued, and updates from website to attempt manual migration. 5. Set environmental variables, allows alembic commands to work. Not all steps to verify version were successful, and manual migration failed when creating chat table. 6. Logs provided from container. ### Logs & Screenshots root@684d040bf15d:/app/backend/open_webui# alembic current -v INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. Current revision(s) for sqlite:////app/backend/data/webui.db: Rev: 374d2f66af06 Parent: c440947495f3 Path: /app/backend/open_webui/migrations/versions/374d2f66af06_add_prompt_history_table.py Add prompt history table Revision ID: 374d2f66af06 Revises: c440947495f3 Create Date: 2026-01-23 17:15:00.000000 root@684d040bf15d:/app/backend/open_webui# alembic heads b2c3d4e5f6a7 (head) root@684d040bf15d:/app/backend/open_webui# alembic history a1b2c3d4e5f6 -> b2c3d4e5f6a7 (head), add scim column to user table f1e2d3c4b5a6 -> a1b2c3d4e5f6, Add skill table 8452d01d26d7 -> f1e2d3c4b5a6, Add access_grant table 374d2f66af06 -> 8452d01d26d7, Add chat_message table c440947495f3 -> 374d2f66af06, Add prompt history table 81cc2ce44d79 -> c440947495f3, Add chat_file table 6283dc0e4d8d -> 81cc2ce44d79, Update channel file and knowledge table 3e0e00844bb0 -> 6283dc0e4d8d, Add channel file table 90ef40d4714e -> 3e0e00844bb0, Add knowledge_file table b10670c03dd5 -> 90ef40d4714e, Update channel and channel members table 2f1211949ecc -> b10670c03dd5, Update user table 37f288994c47 -> 2f1211949ecc, Update messages and channel member table a5c220713937 -> 37f288994c47, add_group_member_table 38d63c18f30f -> a5c220713937, Add reply_to_id column to message 3af16a1c9fb6 -> 38d63c18f30f, Add oauth_session table 018012973d35 -> 3af16a1c9fb6, update user table d31026856c01 -> 018012973d35, Add indexes 9f0c9cd09105 -> d31026856c01, Update folder table data 3781e22d8b01 -> 9f0c9cd09105, Add note table 7826ab40b532 -> 3781e22d8b01, Update message & channel tables 57c599a3cb57 -> 7826ab40b532, Update file table 922e7a387820 -> 57c599a3cb57, Add channel table 4ace53fd72c8 -> 922e7a387820, Add group table af906e964978 -> 4ace53fd72c8, Update folder table and change DateTime to BigInteger for timestamp fields c29facfe716b -> af906e964978, Add feedback table c69f45358db4 -> c29facfe716b, Update file table path 3ab32c4b8f59 -> c69f45358db4, Add folder table 1af9b942657b -> 3ab32c4b8f59, Update tags 242a2047eae0 -> 1af9b942657b, Migrate tags 6a39f3d8e55c -> 242a2047eae0, Update chat table c0fbf31ca0db -> 6a39f3d8e55c, Add knowledge table ca81bd47c050 -> c0fbf31ca0db, Update file table 7e5b5dc7342b -> ca81bd47c050, Add config table <base> -> 7e5b5dc7342b, init root@684d040bf15d:/app/backend/open_webui# alembic upgrade head --sql | head -30 INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Generating static SQL INFO [alembic.runtime.migration] Will assume non-transactional DDL. CREATE TABLE alembic_version ( version_num VARCHAR(32) NOT NULL, CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num) ); INFO [alembic.runtime.migration] Running upgrade -> 7e5b5dc7342b, init -- Running upgrade -> 7e5b5dc7342b Traceback (most recent call last): File "/usr/local/bin/alembic", line 10, in <module> sys.exit(main()) ^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 1047, in main CommandLine(prog=prog).main(argv=argv) File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 1037, in main self.run_cmd(cfg, options) File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 971, in run_cmd fn( 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 106, in <module> run_migrations_offline() File "/app/backend/open_webui/migrations/env.py", line 55, in run_migrations_offline 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/7e5b5dc7342b_init.py", line 26, in upgrade existing_tables = set(get_existing_tables()) ^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/../open_webui/migrations/util.py", line 7, in get_existing_tables inspector = Inspector.from_engine(con) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<string>", line 2, in from_engine File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 386, in warned return fn(*args, **kwargs) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/reflection.py", line 309, in from_engine return cls._construct(cls._init_legacy, bind) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/reflection.py", line 246, in _construct init(self, bind) File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/reflection.py", line 253, in _init_legacy self._init_engine(bind) File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/reflection.py", line 257, in _init_engine engine.connect().close() ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'MockConnection' object has no attribute 'close' root@684d040bf15d:/app/backend/open_webui# alembic branches root@684d040bf15d:/app/backend/open_webui# alembic upgrade head 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 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 "/usr/local/bin/alembic", line 10, in <module> sys.exit(main()) ^^^^^^ File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 1047, in main CommandLine(prog=prog).main(argv=argv) File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 1037, in main self.run_cmd(cfg, options) File "/usr/local/lib/python3.11/site-packages/alembic/config.py", line 971, in run_cmd fn( 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) ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-15 15:23:50 -05:00
Author
Owner

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

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

<!-- gh-comment-id:3902383024 --> @Classic298 commented on GitHub (Feb 14, 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#90216