open-webui/backend/open_webui
Classic298 f4a6ea9300
fix: Milvus multitenancy scalar index creation on Milvus Lite (#26911)
Enabling ENABLE_MILVUS_MULTITENANCY_MODE with the default MILVUS_URI (embedded Milvus Lite at DATA_DIR/vector_db/milvus.db) fails on the first embedding write: _create_shared_collection calls collection.create_index(RESOURCE_ID_FIELD) with no index params. A Milvus server auto-selects a scalar index type in that case, but Milvus Lite rejects the call with "create_index missing required 'index_type' parameter", so shared collection creation raises and every embedding write 500s (memory add, file upload, knowledge writes).

Keep the parameterless call as the first attempt so behavior on Milvus servers is unchanged, fall back to an explicit INVERTED scalar index, and if that also fails log a warning and continue. The scalar index only accelerates resource_id filters; inserts and filtered queries work without it, so a missing index must not break collection creation.

Verified against embedded Milvus Lite: shared collections now create (with the warning), and memory add, file upload and memory query succeed end to end. Against a Milvus server the first attempt is identical to the current code, so nothing changes where it works today.
2026-07-10 13:29:29 -05:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal refac 2026-06-29 12:40:20 -05:00
migrations refac 2026-07-01 03:37:35 -05:00
models refac 2026-07-01 03:01:46 -05:00
retrieval fix: Milvus multitenancy scalar index creation on Milvus Lite (#26911) 2026-07-10 13:29:29 -05:00
routers refac 2026-07-09 17:59:17 -05:00
socket refac 2026-06-29 03:58:00 -05:00
static chore: format 2026-06-01 14:10:40 -07:00
storage refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
tools refac 2026-07-09 17:31:43 -05:00
utils fix: convert SecurityHeadersMiddleware to pure ASGI (#26924) 2026-07-10 13:29:14 -05:00
__init__.py refac 2026-06-17 03:01:11 +02:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-07-09 18:02:37 -05:00
constants.py refac 2026-06-29 05:46:51 -05:00
env.py refac 2026-07-09 17:28:05 -05:00
events.py refac 2026-07-09 17:28:34 -05:00
functions.py refac 2026-07-09 17:28:34 -05:00
main.py refac 2026-07-09 17:28:34 -05:00
tasks.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00