zeroclaw-labs/zeroclaw · error
Failed to query devices
Error message
Failed to query devices
What it means
Fatal error in the pairing DeviceRegistry constructor while loading existing devices from the devices table: the SELECT/query failed or a row could not be read into DeviceInfo. This indicates a corrupt or schema-incompatible devices.db (e.g. written by a different version) at gateway startup. The registry treats an unreadable device store as unrecoverable. Delete or repair devices.db to reinitialize pairing state.
Solutions
- Check database integrity and retry; restart the gateway if the connection was lost.
- Recreate the device registry database if corruption persists.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/zeroclaw-gateway/src/api_pairing.rs:101 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/50d79641fc5ece2c.
Report an issue: GitHub.
Appendix: source
Thrown at crates/zeroclaw-gateway/src/api_pairing.rs:101
.map(|dt| dt.with_timezone(&Utc))
.unwrap_or_else(|_| Utc::now());
let capabilities = capabilities_json
.as_deref()
.and_then(|s| serde_json::from_str::<Vec<String>>(s).ok());
Ok((
token_hash,
DeviceInfo {
id,
name,
device_type,
paired_at,
last_seen,
ip_address,
capabilities,
},
))
})
.expect("Failed to query devices");
for (hash, info) in rows.flatten() {
cache.insert(hash, info);
}
Self {
cache: Mutex::new(cache),
db_path,
}
}
#[cfg(test)]
pub(crate) fn with_db_path(db_path: PathBuf) -> Self {
Self {
cache: Mutex::new(HashMap::new()),
db_path,
}
}
View on GitHub (pinned to 88bb9c8533)