Troubleshooting¶
Solutions to common issues encountered when using Grafeo.
Installation Issues¶
Python wheel not found for my platform¶
Symptoms: uv add grafeo or pip install grafeo fails with "no matching distribution found."
Solutions:
-
Check Python version - Grafeo requires Python 3.12 or later:
-
Build from source - If no pre-built wheel exists for the platform:
-
Use conda - Sometimes conda environments resolve better:
Import error: "module 'grafeo' has no attribute..."¶
Symptoms: Import succeeds but classes are missing.
Solution: Ensure the latest version is installed:
Query Errors¶
"Property not found" error¶
Symptoms: Query fails with "property 'xyz' not found."
Cause: The query references a property that doesn't exist on the node.
Solutions:
-
Check property name - Property names are case-sensitive:
-
Use OPTIONAL - If the property might not exist:
-
Check schema - View existing properties:
"Label not found" error¶
Symptoms: Query returns empty results when matches are expected.
Solutions:
-
Check label spelling - Labels are case-sensitive:
-
View existing labels:
Syntax errors in queries¶
Symptoms: "Parse error" or "Unexpected token" messages.
Solutions:
-
Check GQL syntax - Common mistakes:
-
Escape special characters - Use backticks for unusual names:
-
Use parameterized queries - Avoid string interpolation:
Performance Issues¶
Queries are slow¶
Symptoms: Simple queries take seconds instead of milliseconds.
Solutions:
-
Create indexes for frequently queried properties:
-
Use batch operations instead of loops:
-
Add LIMIT to exploratory queries:
-
Check SIMD support - Grafeo uses SIMD for vector operations:
Out of memory errors¶
Symptoms: Process crashes or "memory allocation failed."
Solutions:
-
Use streaming for large results:
-
Use persistent storage to enable spill-to-disk:
Transaction Issues¶
"Transaction already completed" error¶
Symptoms: Operations fail after commit or rollback.
Solution: Don't reuse transactions after completion:
# Wrong
with db.begin_transaction() as tx:
tx.execute("INSERT (:Person {name: 'Alix'})")
tx.commit()
tx.execute("INSERT (:Person {name: 'Gus'})") # Error!
# Correct: Start a new transaction
with db.begin_transaction() as tx:
tx.execute("INSERT (:Person {name: 'Alix'})")
tx.commit()
with db.begin_transaction() as tx:
tx.execute("INSERT (:Person {name: 'Gus'})")
tx.commit()
Write-write conflict error¶
Symptoms: "Write conflict" when committing concurrent transactions.
Cause: Two transactions tried to modify the same entity.
Solution: Retry with exponential backoff:
import time
import random
def execute_with_retry(db, query, max_retries=3):
for attempt in range(max_retries):
try:
with db.begin_transaction() as tx:
result = tx.execute(query)
tx.commit()
return result
except Exception as e:
if "conflict" in str(e).lower() and attempt < max_retries - 1:
time.sleep(random.uniform(0.1, 0.5) * (2 ** attempt))
continue
raise
Persistence Issues¶
Database file is locked¶
Symptoms: "Database locked" or "File in use" error.
Cause: Another process has the database open.
Solutions:
-
Close other connections:
-
Use context manager:
-
Check for zombie processes:
WAL file growing too large¶
Symptoms: .wal file becomes very large.
Solution: Force a checkpoint:
Or configure automatic checkpointing via wal_checkpoint() intervals.
Common Error Messages¶
| Error | Cause | Solution |
|---|---|---|
NodeNotFound | Node ID doesn't exist | Check ID is valid with db.get_node(id) |
EdgeNotFound | Edge ID doesn't exist | Check ID is valid with db.get_edge(id) |
TypeMismatch | Property type doesn't match expected | Check property types in schema |
ParseError | Invalid query syntax | Check GQL syntax documentation |
TransactionAborted | Transaction was rolled back | Check for conflicts or errors |
IoError | File system issue | Check permissions and disk space |
Getting Help¶
If an issue persists:
- Check the documentation at grafeo.dev
- Search existing issues at GitHub Issues
- Open a new issue with:
- Grafeo version (
uv pip show grafeoorpip show grafeo) - Python version (
python --version) - Operating system
- Minimal code to reproduce
- Full error message and stack trace
FAQ¶
Can I use Grafeo in production?¶
Grafeo is currently at version 0.5.x (beta) and approaching production readiness. It's suitable for:
- Embedded analytics applications
- Data science workflows
- Microservices with local graph state
- Applications with controlled deployment environments
- AI/ML workloads with vector and text search
How do I migrate from Neo4j?¶
See the Migration Guide for step-by-step instructions.
Does Grafeo support clustering?¶
Not yet. Grafeo is currently single-node only. Distributed deployment is planned for future versions.
What's the maximum graph size?¶
Grafeo can handle graphs with billions of edges on a single machine, limited primarily by available RAM. With persistent storage, it can spill to disk for larger-than-memory workloads.
Is Grafeo thread-safe?¶
Yes. The Python API uses internal locking to ensure thread safety. Multiple threads can query the same database concurrently.