Common Cassandra Errors
Reference guide for frequently encountered Cassandra errors, their causes, and solutions.
Error Categories
Section titled “Error Categories”Timeout Errors
Section titled “Timeout Errors”Errors occurring when operations exceed configured time limits.
| Error | Default Timeout | Common Cause |
|---|---|---|
| ReadTimeoutException | 5000ms | Slow disk, large partitions, tombstones |
| WriteTimeoutException | 2000ms | Overloaded nodes, disk issues |
| TruncateException | 60000ms | Large table truncation |
Legacy Exception
RangeSliceTimeoutException was a Thrift-era exception. In modern Cassandra (4.0+), range scan timeouts surface as ReadTimeoutException.
Availability Errors
Section titled “Availability Errors”Errors related to replica availability.
| Error | Cause | Solution |
|---|---|---|
UnavailableException | Insufficient replicas alive | Check node status, reduce consistency level |
NoHostAvailableException | Cannot reach any coordinator | Check network, verify cluster is running |
WriteFailureException | Replica write failed | Check failing node logs |
ReadFailureException | Replica read failed | Check failing node logs |
Data Errors
Section titled “Data Errors”Errors related to data or schema.
| Error | Cause | Solution |
|---|---|---|
InvalidQueryException | CQL syntax or semantic error | Fix query syntax |
InvalidRequestException | Invalid request parameters | Check request parameters |
TombstoneOverwhelmingException | Too many tombstones | Fix data model, run compaction |
SyntaxException | CQL syntax error | Check CQL syntax |
Authentication/Authorization Errors
Section titled “Authentication/Authorization Errors”Security-related errors.
| Error | Cause | Solution |
|---|---|---|
AuthenticationException | Invalid credentials | Verify username/password |
UnauthorizedException | Insufficient permissions | Grant required permissions |
Lightweight Transaction Errors
Section titled “Lightweight Transaction Errors”Errors related to LWT (Paxos-based compare-and-set operations).
| Error | Cause | Solution |
|---|---|---|
CasWriteTimeoutException | Paxos consensus timeout | Check for contention, increase timeout |
| LWT/non-LWT mixing issues | Mixed clock domains | Use LWT consistently for all operations on same data |
| Silent operation failures | Paxos clock vs regular timestamp conflict | See LWT Troubleshooting |
Quick Diagnosis
Section titled “Quick Diagnosis”Check Cluster Health
Section titled “Check Cluster Health”# Node statusnodetool status
# Thread pools (look for blocked/dropped)nodetool tpstats
# Compaction statusnodetool compactionstatsCheck Logs
Section titled “Check Logs”# Recent errorsgrep -i "error\|exception" /var/log/cassandra/system.log | tail -50
# Specific errorgrep "TimeoutException" /var/log/cassandra/system.log | tail -20Check Table Health
Section titled “Check Table Health”# Table statisticsnodetool tablestats my_keyspace.my_table
# Key metrics to check:# - SSTable count (high = needs compaction)# - Average tombstones per read (high = data model issue)# - Partition size (large = data model issue)Error Resolution Workflow
Section titled “Error Resolution Workflow”Detailed Error Guides
Section titled “Detailed Error Guides”Timeout Errors
Section titled “Timeout Errors”- ReadTimeoutException - Read operations timing out
- WriteTimeoutException - Write operations timing out
Lightweight Transaction Errors
Section titled “Lightweight Transaction Errors”- LWT Troubleshooting - Paxos contention, LWT/non-LWT mixing, timeout handling
Playbooks for Complex Issues
Section titled “Playbooks for Complex Issues”For issues requiring multi-step resolution, see the Troubleshooting Playbooks.
Prevention
Section titled “Prevention”Monitoring
Section titled “Monitoring”Set up alerts for early warning:
| Metric | Warning Threshold | Critical Threshold |
|---|---|---|
| Read latency p99 | > 100ms | > 500ms |
| Write latency p99 | > 50ms | > 200ms |
| Pending compactions | > 20 | > 100 |
| Dropped messages | > 0 | > 10/min |
| SSTable count | > 20 per table | > 50 per table |
Best Practices
Section titled “Best Practices”- Monitor proactively - Don't wait for errors
- Run repairs regularly - Weekly for most workloads
- Keep compaction healthy - Monitor pending tasks
- Size partitions correctly - Aim for < 100MB per partition
- Avoid tombstone accumulation - Use TTLs and proper deletion patterns
Related Documentation
Section titled “Related Documentation”- Troubleshooting Overview - General troubleshooting framework
- Diagnosis Guide - Systematic diagnosis procedures
- Log Analysis - Understanding Cassandra logs
- Playbooks - Step-by-step resolution guides