Skip to content

[Bug]: [Windows10] 本地向量后端无法正常创建并持久化向量索引 #576

@LoM-Klein

Description

@LoM-Klein

Bug Description

问题描述

0.2.6版本Windows环境本地向量后端索引创建失败,Rust引擎dump()返回负值导致向量计数恒为0、语义搜索失效
核心现象如下:

  1. 文档嵌入队列处理完成后,ov status 中对应Collection的Vector Count始终为0
  2. 集合对应的索引目录为空,未生成index_meta.json与版本化索引文件
  3. 语义搜索ov find命令无任何匹配结果返回
  4. 服务初始化/索引创建时,抛出致命异常Exception: create default index failed

根因初步定位

  1. 索引创建失败的直接原因:local_index.py 中,Rust底层引擎PersistStorebuilder.dump()方法返回负值,直接进入异常分支,抛出索引创建失败错误,索引文件完全无法生成。
  2. 已排除权限、维度配置、路径、杀毒拦截等常见用户侧问题,初步判断为Windows平台的底层引擎兼容性问题。

Steps to Reproduce

环境配置
操作系统:Windows 10
Python 版本:3.10.11(64 位)
配置修改
在ov.conf配置文件中设置向量后端为local(配置文件默认路径:C:\Users<你的用户名>.openviking\ov.conf)
在ov.conf中配置有效的嵌入模型(我使用的是豆包嵌入模型 doubao-embedding-vision-256015),并确保维度设置正确(1024 维)
操作流程
启动 OpenViking 服务(启动过程无报错)
创建名为context的新集合:ov collection create context
将任意本地文档(例如一个 markdown 文件)导入该集合:ov add -c context /path/to/your/document.md
等待嵌入任务队列执行完成(确认日志中无嵌入相关错误)

Expected Behavior

问题验证
执行ov status命令 → 查看context集合的向量计数(Vector Count)预期值:≥1
检查索引目录C:\Users<你的用户名>.openviking\data\vectordb\context\index\ → 目录有versions文件夹以及index_meta.json文件
执行语义搜索:ov find -c context "你的文档中的关键词" → 返回结果(total: 0)

Actual Behavior

执行ov status命令 → 查看context集合的向量计数(Vector Count)始终为0
检查索引目录C:\Users<你的用户名>.openviking\data\vectordb\context\index\ → 目录为空
执行语义搜索:ov find -c context "你的文档中的关键词" → 返回空结果(total: 0)
检查服务日志 → 发现如下错误:Exception: create default index failed

Minimal Reproducible Example

Error Logs

关键错误日志
2026-03-13 14:47:21,704 - openviking.storage.viking_vector_index_backend - ERROR -
Error creating collection context: create default index failed
完整异常堆栈
File "C:\Program Files\Python310\lib\site-packages\openviking\storage\vectordb\index\local_index.py",
line 536, in init
self._create_new_index(name, meta, cands_list, initial_timestamp)
File "C:\Program Files\Python310\lib\site-packages\openviking\storage\vectordb\index\local_index.py",
line 576, in _create_new_index
raise Exception("create {} index failed".format(name))
Exception: create default index failed

OpenViking Version

0.2.6

Python Version

3.10.11

Operating System

Windows

Model Backend

Volcengine (Doubao)

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions