Troubleshooting Guide¶
This guide covers common issues, error messages, and their solutions when working with Uni.
Quick Diagnostics¶
# Check storage health
uni stats --path ./storage
# Validate schema
uni schema validate --path ./storage
# Check for corruption
uni check --path ./storage
# View recent logs
RUST_LOG=uni=debug uni query "RETURN 1" --path ./storage 2>&1 | tail -50
Common Issues¶
Installation Problems¶
Rust Version Incompatible¶
Symptom:
Solution:
Missing System Dependencies¶
Symptom:
Solution:
# Ubuntu/Debian
sudo apt install pkg-config libssl-dev
# macOS
brew install openssl
export OPENSSL_DIR=$(brew --prefix openssl)
# Fedora
sudo dnf install openssl-devel
Build Fails with SIMD Errors¶
Symptom:
Solution:
# Build without SIMD optimizations
cargo build --release --no-default-features
# Or specify target CPU
RUSTFLAGS="-C target-cpu=native" cargo build --release
Storage Issues¶
Cannot Open Storage¶
Symptom:
Solution:
# Check path exists
ls -la ./storage
# Initialize new storage
uni import my-data --papers data.jsonl --citations edges.jsonl --output ./storage
# Or create programmatically
let storage = StorageManager::new("./storage", schema);
Corrupted Storage¶
Symptom:
Solution:
# Check integrity
uni check --path ./storage --verbose
# Repair if possible
uni repair --path ./storage
# Rollback to previous version
uni rollback --path ./storage --version 41
# Last resort: re-import
uni import my-data --papers data.jsonl --output ./storage --force
Out of Disk Space¶
Symptom:
Solution:
# Check disk usage
df -h ./storage
# Compact storage (removes old versions)
uni compact --path ./storage --level l2
# Clean old WAL segments
uni wal clean --path ./storage --keep-count 2
# Increase disk or move storage
uni migrate --from ./storage --to /larger-disk/storage
Lock File Issues¶
Symptom:
Solution:
# Check for running processes
lsof ./storage/.lock
# Force unlock (only if no other process is actually using it!)
rm ./storage/.lock
# In code, ensure proper cleanup
drop(storage); // Explicit drop releases lock
Query Issues¶
Parse Errors¶
Symptom:
Common Causes:
-
Missing quotes around strings:
-
Wrong comparison operator:
-
Missing relationship direction:
Semantic Errors¶
Symptom:
Solution:
# List available labels
uni schema show --path ./storage
# Check spelling/case
# Labels are case-sensitive: Paper != paper
Symptom:
Solution:
# List properties for label
uni schema show --path ./storage --label Paper
# Add property to schema if needed
uni schema update --path ./storage --add-property Paper.year:Int32
Query Timeout¶
Symptom:
Solutions:
-
Add LIMIT:
-
Add filters:
-
Increase timeout:
-
Check query plan:
Out of Memory¶
Symptom:
Solutions:
-
Reduce result size:
-
Stream results:
-
Increase memory limit:
-
Reduce batch size:
Index Issues¶
Vector Search Returns Poor Results¶
Symptom: Results are not semantically similar to the query.
Causes and Solutions:
-
Wrong embedding model:
-
Dimension mismatch:
-
Low ef_search:
-
Wrong distance metric:
Index Not Being Used¶
Symptom: Query is slow despite having an index.
Diagnosis:
Common Causes:
-
Function on indexed column:
-
OR conditions:
-
Leading wildcard:
-
Low selectivity:
Index Build Fails¶
Symptom:
Solutions:
-
Reduce batch size:
-
Use IVF_PQ instead of HNSW:
-
Build incrementally:
Import Issues¶
Schema Inference Fails¶
Symptom:
Solution:
# Provide explicit schema
uni import my-data --schema schema.json ...
# Or fix source data to have consistent types
Duplicate IDs¶
Symptom:
Solutions:
-
Deduplicate source data:
-
Use merge mode:
-
Use strict mode to fail:
Embedding Dimension Mismatch¶
Symptom:
Solution:
# Check schema
uni schema show --path ./storage --label Paper
# Re-embed with correct model or update schema
uni schema update --path ./storage --property Paper.embedding:Vector[384]
# Note: This requires re-importing data
Performance Issues¶
Slow Traversals¶
Symptom: Graph traversals take >100ms.
Diagnosis:
Solutions:
-
Warm the adjacency cache:
-
Increase cache size:
-
Add LIMIT to multi-hop:
High Memory Usage¶
Symptom: Process using more memory than expected.
Diagnosis:
let stats = storage.memory_stats();
println!("Adjacency cache: {} MB", stats.adjacency_cache_mb);
println!("Property cache: {} MB", stats.property_cache_mb);
println!("L0 buffer: {} MB", stats.l0_buffer_mb);
Solutions:
-
Reduce cache sizes:
-
Flush L0 more frequently:
-
Use streaming queries:
Error Reference¶
Storage Errors¶
| Error | Cause | Solution |
|---|---|---|
StorageLocked |
Another process holds lock | Wait or force unlock |
CorruptedManifest |
Invalid manifest file | Rollback or repair |
WalCorrupted |
WAL corruption detected | Truncate WAL, may lose recent writes |
DiskFull |
No space available | Free space or compact |
VersionNotFound |
Requested version doesn't exist | Use valid version number |
Query Errors¶
| Error | Cause | Solution |
|---|---|---|
ParseError |
Invalid Cypher syntax | Fix query syntax |
UnknownLabel |
Label not in schema | Check schema or fix query |
UnknownProperty |
Property not in schema | Check schema or fix query |
TypeMismatch |
Incompatible types | Fix query or data types |
Timeout |
Query exceeded time limit | Optimize query or increase timeout |
OutOfMemory |
Memory limit exceeded | Reduce result size or increase limit |
Index Errors¶
| Error | Cause | Solution |
|---|---|---|
IndexNotFound |
Index doesn't exist | Create index first |
IndexBuildFailed |
Build process failed | Check logs, retry with smaller batch |
DimensionMismatch |
Vector size doesn't match | Use correct embedding dimensions |
MetricMismatch |
Distance metric incompatible | Use matching metric |
Debugging Tips¶
Enable Verbose Logging¶
# All Uni logs at debug level
RUST_LOG=uni=debug uni query "..." --path ./storage
# Specific module
RUST_LOG=uni::storage=trace,uni::query=debug uni query "..."
# Include Lance logs
RUST_LOG=uni=debug,lance=info uni query "..."
Query Profiling¶
# Get execution profile
uni query "PROFILE MATCH (p:Paper) WHERE p.year > 2020 RETURN COUNT(p)" --path ./storage
# Output shows:
# - Time per operator
# - Rows processed
# - Index usage
# - Memory usage
Storage Inspection¶
# List all datasets
ls -la ./storage/vertices/
ls -la ./storage/edges/
ls -la ./storage/adjacency/
# Check Lance dataset info
uni inspect --path ./storage/vertices/Paper
# View manifest
cat ./storage/manifest.json | jq .
Memory Profiling¶
# Run with memory tracking
RUST_LOG=uni=debug UNI_TRACK_MEMORY=1 uni query "..."
# Use heaptrack (Linux)
heaptrack uni query "..."
heaptrack_gui heaptrack.uni.*.gz
Getting Help¶
Resources¶
- Documentation: https://uni.dev/docs
- GitHub Issues: https://github.com/dragonscale/uni/issues
- Discussions: https://github.com/dragonscale/uni/discussions
Reporting Bugs¶
When reporting issues, include:
- Uni version:
uni --version - Rust version:
rustc --version - OS and version
- Minimal reproduction steps
- Error messages (full output)
- Query plan (if query-related):
EXPLAIN ... - Storage stats:
uni stats --path ./storage
Next Steps¶
- Configuration Reference — All configuration options
- Performance Tuning — Optimization strategies
- Glossary — Terminology reference