Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

CQLAI Troubleshooting

Common issues and solutions when using CQLAI.


Symptom: CQLAI fails to connect with timeout or connection refused errors.

Diagnosis:

Terminal window
# Test basic connectivity
nc -zv <cassandra-host> 9042
# Try with explicit host
cqlai --host <cassandra-host> --port 9042

Solutions:

CauseSolution
Wrong host/portVerify connection parameters
Firewall blockingOpen port 9042
Cassandra not runningCheck nodetool status
SSL requiredAdd --ssl flag

Symptom: AuthenticationException or access denied errors.

Solutions:

Terminal window
# Connect with credentials
cqlai --username cassandra --password cassandra
# Or use environment variables
export CQLAI_USERNAME=cassandra
export CQLAI_PASSWORD=cassandra
cqlai

Symptom: SSL handshake failures or certificate errors.

Solutions:

Terminal window
# Enable SSL
cqlai --ssl
# With custom certificate
cqlai --ssl --ssl-ca-cert /path/to/ca.crt
# Skip certificate verification (development only)
cqlai --ssl --ssl-skip-verify

Symptom: .ai commands hang or timeout.

Diagnosis:

Terminal window
# Check API key is set
echo $OPENAI_API_KEY
echo $ANTHROPIC_API_KEY
# Test provider connectivity
curl -I https://api.openai.com

Solutions:

CauseSolution
Missing API keySet appropriate environment variable
Network issuesCheck firewall/proxy settings
Rate limitingWait and retry, or use different provider
Invalid API keyRegenerate key from provider dashboard

Symptom: AI generates incorrect or suboptimal CQL queries.

Solutions:

  1. Ensure schema is loaded: Run .schema to verify CQLAI knows the current schema
  2. Be more specific: Add column names and conditions to the request
  3. Use a different model: Try GPT-4 or Claude for complex queries
  4. Review and edit: Always review generated queries before execution

Symptom: Cannot connect to local Ollama instance.

Solutions:

Terminal window
# Verify Ollama is running
curl http://localhost:11434/api/tags
# Check model is available
ollama list
# Set correct endpoint (both variable names are supported)
export CQLAI_OLLAMA_HOST=http://localhost:11434
# or
export OLLAMA_URL=http://localhost:11434

Symptom: CQL syntax errors when executing queries.

Solutions:

  • Check for missing semicolons
  • Verify keyspace/table names are correct
  • Use .schema to check available tables and columns
  • Quote identifiers with special characters

Symptom: Query times out before completing.

Solutions:

Terminal window
# Increase timeout (value in seconds)
cqlai --request-timeout 60
# For large result sets, use paging
cqlai --page-size 100

Symptom: Memory issues or slow display with large results.

Solutions:

Terminal window
# Limit results
SELECT * FROM table LIMIT 100;
# Enable paging
cqlai --page-size 1000
# Export to file instead
.export table results.csv

Symptom: Parquet export command fails with errors.

Diagnosis:

Terminal window
# Check disk space
df -h .
# Verify write permissions
touch test.parquet && rm test.parquet

Solutions:

CauseSolution
Insufficient disk spaceFree up space or export to different location
Permission deniedCheck write permissions
Invalid queryTest query first before export
Memory exhaustedReduce batch size or use streaming

Symptom: Exported Parquet files cannot be read.

Solutions:

  1. Re-run the export with --overwrite
  2. Check for disk errors
  3. Verify sufficient disk space during entire export
  4. Try exporting smaller batches

Symptom: Results display incorrectly or are hard to read.

Solutions:

Terminal window
# Switch output format
.format json
.format table
.format vertical
# Adjust column width
.width 120

Symptom: Special characters display as question marks or boxes.

Solutions:

  • Set terminal encoding to UTF-8
  • Use a terminal that supports Unicode
  • Check LANG and LC_ALL environment variables

Symptom: CQLAI takes a long time to start.

Solutions:

  • Check network connectivity to Cassandra
  • Disable auto-schema loading if not needed
  • Verify DNS resolution is working

Symptom: CQLAI consumes excessive memory.

Solutions:

  • Use paging for large queries
  • Export large results to files
  • Close and restart for long-running sessions

Symptom: Settings from config file are ignored.

Diagnosis:

Terminal window
# Check config file locations
ls -la ~/.cqlai.json ~/.config/cqlai/config.json ./cqlai.json
# Verify JSON syntax
cat ~/.config/cqlai/config.json | python3 -m json.tool

Solutions:

  1. Ensure config file is valid JSON
  2. Check file permissions
  3. Use explicit config path: cqlai --config-file /path/to/config.json

Symptom: Environment variables are ignored.

Solutions:

Terminal window
# Verify variables are exported
env | grep CQLAI
# Check for typos in variable names
export CQLAI_HOST=localhost # Correct
export CQLAIHOST=localhost # Wrong

Terminal window
# Show version
cqlai --version
# Show help
cqlai --help
# Show available dot commands
.help
# Enable debug logging
cqlai --debug

When reporting issues, include:

  1. CQLAI version (cqlai --version)
  2. Cassandra version
  3. Operating system
  4. Full error message
  5. Steps to reproduce

Report issues at: github.com/axonops/cqlai/issues