Troubleshooting Guide¶
This guide covers common issues, error messages, and their solutions when working with Uni.
Quick Diagnostics¶
# Check database info
uni query "SHOW DATABASE" --path ./storage
# Check schema
uni query "CALL uni.schema.labels() YIELD label RETURN label" --path ./storage
# Basic stats
uni query "SHOW STATISTICS" --path ./storage
# View recent logs
RUST_LOG=uni_db=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
# Create storage (embedded mode)
uni query "RETURN 1" --path ./storage
Corrupted Storage¶
Symptom:
Solution:
# Restore from snapshot (recommended)
uni snapshot list --path ./storage
uni snapshot restore <snapshot_id> --path ./storage
# Or via Cypher
uni query "CALL uni.admin.snapshot.list()" --path ./storage
uni query "CALL uni.admin.snapshot.restore('<snapshot_id>')" --path ./storage
# If no snapshot exists, re-import or rebuild the database
Out of Disk Space¶
Symptom:
Solution:
# Check disk usage
df -h ./storage
# Compact storage
uni query "CALL uni.admin.compact()" --path ./storage
# Move storage to a larger disk (stop any running processes first)
mv ./storage /larger-disk/storage
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 query "CALL uni.schema.labels() YIELD label RETURN label" --path ./storage
# Check spelling/case
# Labels are case-sensitive: Paper != paper
Symptom:
Solution:
# List properties for label
uni query "CALL uni.schema.labelInfo('Paper')" --path ./storage
# Add property to schema if needed
uni query "ALTER LABEL Paper ADD PROPERTY year INT32" --path ./storage
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:
- Embedding model mismatch: Ensure the same embedding model is used for indexing and querying.
-
If you use auto-embedding, only
fastembedis currently implemented;openai/ollamaconfigs will error at runtime. -
Dimension mismatch:
-
Index mismatch or missing index:
If you need a different distance metric, recreate the index via Rust/Python APIs (Cypher DDL uses cosine today).
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:
-
Use IVF_PQ or Flat instead of HNSW:
-
Build asynchronously after bulk load:
Or usebulk_writer().async_indexes(true).
Import Issues (CLI)¶
The CLI importer expects the Semantic Scholar demo format (vid, src_vid, dst_vid).
Missing Required Fields¶
Symptom:
Solution: Ensure your JSONL includes:
- Papers: vid, title, year, citation_count, embedding
- Citations: src_vid, dst_vid
Invalid VID References¶
Symptom:
Solution: Ensure citations reference existing paper VIDs.
Embedding Dimension Mismatch¶
Symptom:
Solution:
If you need a different dimension, create a new label/property and re-import.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: Use OS-level tools (top, htop) and PROFILE output.
Solutions:
-
Reduce cache sizes:
-
Flush L0 more frequently:
-
Use streaming queries:
Error Reference¶
Storage / IO Errors¶
| Error | Cause | Solution |
|---|---|---|
DatabaseLocked |
Another process holds the lock | Close other process or use a different path |
ReadOnly |
Write attempted on a read-only database | Open in write mode or avoid writes |
Storage |
Underlying storage failure | Check storage config/permissions |
Io |
OS I/O error (e.g., disk full) | Fix disk/permissions |
NotFound |
Database path does not exist | Create the DB or fix the path |
Query / Schema Errors¶
| Error | Cause | Solution |
|---|---|---|
Parse |
Invalid Cypher syntax | Fix query syntax |
Schema |
Invalid schema definition | Fix schema input |
LabelNotFound |
Label not in schema | Check schema or create label |
EdgeTypeNotFound |
Edge type not in schema | Check schema or create edge type |
PropertyNotFound |
Property not in schema | Check schema or fix query |
Type |
Incompatible types (e.g., vector dims mismatch) | Fix query or data types |
InvalidArgument |
Invalid procedure argument | Fix argument values |
IndexNotFound |
Index does not exist | Create index first |
Constraint |
Constraint violation | Fix data or drop constraint |
Timeout |
Query exceeded time limit | Optimize query or increase timeout |
MemoryLimitExceeded |
Memory limit exceeded | Reduce result size or increase limit |
Debugging Tips¶
Enable Verbose Logging¶
# All Uni logs at debug level
RUST_LOG=uni_db=debug uni query "..." --path ./storage
# Specific module
RUST_LOG=uni_db::storage=trace,uni_db::query=debug uni query "..."
# Include Lance logs
RUST_LOG=uni_db=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
# View on-disk schema
cat ./storage/catalog/schema.json | jq .
Memory Profiling¶
# Run with verbose logging
RUST_LOG=uni_db=debug 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/rustic-ai/uni/issues
- Discussions: https://github.com/rustic-ai/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