ruvnet/RuView · error · anyhow::Error
failed to initialize ruvector index: {error}
Error message
failed to initialize ruvector index: {error} What it means
Anyhow error in open_recorder (compiled with the `ruvector` feature): RuvectorSemanticIndex::new(100_000) failed. That constructor builds an in-memory ruvector VectorDB with DbOptions{dimensions: EMBEDDING_DIM, cosine distance, HNSW m=16, ef_construction=100, ef_search=50, max_elements: 100_000} -- no disk is touched (storage is ':memory:'), so failures come from the underlying VectorDB::new rejecting the HNSW options or from resource exhaustion allocating a 100k-capacity index.
Source
Thrown at v2/crates/homecore-server/src/main.rs:460
.register("HassCancelAll", r"^cancel all automations$", "*")
.await?;
let mut pipeline = AssistPipeline::new(recognizer);
pipeline.register_handler(HassTurnOn);
pipeline.register_handler(HassTurnOff);
pipeline.register_handler(HassLightSet);
pipeline.register_handler(HassNevermind);
pipeline.register_handler(HassCancelAll);
Ok(pipeline)
}
#[cfg(feature = "ruvector")]
async fn open_recorder(path: &str) -> anyhow::Result<Recorder> {
use homecore_recorder::{RuvectorSemanticIndex, SemanticIndex};
use tokio::sync::RwLock;
let index = RuvectorSemanticIndex::new(100_000)
.map_err(|error| anyhow::anyhow!("failed to initialize ruvector index: {error}"))?;
let semantic: std::sync::Arc<RwLock<dyn SemanticIndex>> =
std::sync::Arc::new(RwLock::new(index));
Ok(Recorder::open_with_index(path, semantic).await?)
}
fn init_tracing() {
tracing_subscriber::fmt()
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| {
"info,homecore=debug,homecore_server=debug,tower_http=info".into()
}),
)
.init();
}
/// Register a representative set of built-in services so `/api/services`
/// is non-empty on first boot. Each handler simply echoes the call back
/// as a JSON acknowledgement — integrations override these byView on GitHub (pinned to 4685618388)
Solutions
- Read the wrapped {error} text -- it comes from VectorDB::new and states the exact rejected option or allocation failure
- Free memory or raise the container/host memory limit before retrying (the 100k-element HNSW graph is allocated up front)
- If the capacity is the problem, lower the hardcoded 100_000 in open_recorder (main.rs) to fit the host's budget
- If you do not need semantic history search, build/run without the ruvector feature to skip the index entirely
Example fix
// before (v2/crates/homecore-server/src/main.rs)
let index = RuvectorSemanticIndex::new(100_000)
.map_err(|error| anyhow::anyhow!("failed to initialize ruvector index: {error}"))?;
// after
let capacity = std::env::var("HOMECORE_INDEX_CAPACITY")
.ok().and_then(|v| v.parse().ok()).unwrap_or(100_000);
let index = RuvectorSemanticIndex::new(capacity)
.map_err(|error| anyhow::anyhow!("failed to initialize ruvector index: {error}"))?; Defensive patterns
Strategy: try-catch
Validate before calling
// preflight: check available memory roughly covers the index before starting
let avail = std::fs::read_to_string('/proc/meminfo')
.ok()
.and_then(|s| s.lines().find(|l| l.starts_with('MemAvailable:')))
.and_then(|l| l.split_whitespace().nth(1)?.parse::<u64>().ok())
.unwrap_or(0);
if avail < REQUIRED_INDEX_BYTES { bail!("not enough memory for ruvector index"); } Try / catch
let recorder = match open_recorder(path).await {
Ok(r) => r,
Err(e) if e.to_string().contains('ruvector index') => {
tracing::warn!("semantic index unavailable ({e}); recording without semantic search");
Recorder::open(path).await? // non-semantic fallback if acceptable
}
Err(e) => return Err(e),
}; Prevention
- Run the ruvector build on hosts with headroom for a 100k-element HNSW graph
- Surface the wrapped VectorDB::new error verbatim in ops dashboards
- Pin ruvector-core versions between host and docs; retest after any vector-db upgrade
When it happens
Trigger: Starting homecore-server with the ruvector feature enabled when VectorDB::new returns an error -- e.g. allocation failure / OOM for the HNSW graph at 100k elements, or a ruvector-core version rejecting one of the hardcoded HNSW parameters; also seen on memory-capped containers where the index allocation exceeds the cgroup limit.
Common situations: Small-RAM hosts or constrained containers running the semantic recorder; ruvector-core upgraded with stricter config validation; swap disabled on the host amplifying allocation failure; dev machines already running training workloads.
Related errors
- wifi_densepose.aether is not in the binary wheels yet (see r
- wifi_densepose.mat is not in the binary wheels yet (see ruvn
- wifi_densepose.meridian is not in the binary wheels yet (see
- HAP was requested but this binary was built without the `hap
- HOMECORE_TOKENS is required; use --insecure-dev-auth only fo
AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16).
Data as JSON: /api/errors/967fbd8b84238f1c.
Report an issue: GitHub.