Troubleshooting¶
This guide provides solutions to common issues encountered when using the RAG CLI. Issues are organized by category with step-by-step resolution instructions.
Quick Diagnostics¶
Health Check Command¶
Run a comprehensive health check to identify common issues:
This command will check: - Configuration validity - Backend connectivity - Authentication status - Network connectivity - Cache health - Log accessibility
Debug Mode¶
Enable debug mode for detailed troubleshooting information:
# Enable debug for single command
./rag-cli --debug auth login
# Enable debug globally
./rag-cli config set debug true
# View debug logs
tail -f ~/.rag/logs/cli.log
Installation Issues¶
CLI Not Found or Not Executable¶
Symptoms: - command not found: rag-cli - Permission denied
Solutions:
-
Check installation path:
-
Poetry environment issues:
-
Path issues:
Python Dependencies Missing¶
Symptoms: - ModuleNotFoundError - Import errors
Solutions:
-
Reinstall dependencies:
-
Check Python version:
-
Clear Python cache:
Authentication Issues¶
Unable to Authenticate¶
Symptoms: - Authentication failed - Invalid client credentials - Browser doesn't open
Diagnostic Steps:
-
Check authentication status:
-
Verify configuration:
Solutions:
-
Fix client credentials:
-
Manual browser authentication:
-
Clear authentication cache:
Token Expired or Invalid¶
Symptoms: - Token expired - Invalid token - Authentication required for authenticated users
Solutions:
-
Refresh token:
-
Re-authenticate:
-
Check token expiration settings:
OIDC Provider Issues¶
Symptoms: - Unable to connect to OIDC provider - Invalid redirect URI - SSL/TLS errors
Solutions:
-
Check OIDC configuration:
-
SSL issues (development only):
-
Network/Proxy issues:
Connection Issues¶
Cannot Connect to Backend¶
Symptoms: - Connection refused - Backend API not running - Timeout errors
Diagnostic Steps:
-
Check backend URL:
-
Test connectivity:
Solutions:
-
Verify backend is running:
-
Fix backend URL:
-
Network troubleshooting:
-
Firewall issues:
Slow Response Times¶
Symptoms: - Commands take too long - Timeout errors - Poor performance
Solutions:
-
Adjust timeout settings:
-
Enable caching:
-
Optimize batch operations:
Command-Specific Issues¶
Collection Operations¶
Issue: Cannot create collection
Symptoms: - Collection creation failed - Vector database connection error
Solutions:
-
Check vector database status:
-
Try different vector database:
Issue: Collection not found
Solutions:
-
List available collections:
-
Check collection ID format:
Document Operations¶
Issue: Document upload fails
Symptoms: - Upload failed - Unsupported file format - File too large
Solutions:
-
Check file format:
-
Check file size limits:
-
File permissions:
Issue: Document processing stuck
Solutions:
-
Check processing status:
-
Restart processing:
-
Check backend processing queue:
Search Operations¶
Issue: No search results
Symptoms: - Empty search results - Low relevance scores - "No matches found"
Solutions:
-
Lower similarity threshold:
-
Increase max chunks:
-
Check document processing:
-
Try different query formulation:
Issue: Search performance problems
Solutions:
-
Check index health:
-
Optimize search parameters:
Configuration Issues¶
Invalid Configuration¶
Symptoms: - Configuration error - Invalid JSON syntax - Commands fail unexpectedly
Solutions:
-
Validate configuration:
-
Reset configuration:
-
Check configuration permissions:
Profile Issues¶
Issue: Profile not found
Solutions:
-
List available profiles:
-
Create missing profile:
-
Switch to existing profile:
Performance Issues¶
Slow Command Execution¶
Diagnostic Steps:
-
Enable timing information:
-
Check system resources:
Solutions:
-
Clear cache:
-
Optimize configuration:
Memory Issues¶
Symptoms: - Out of memory errors - System becomes unresponsive - Large file processing fails
Solutions:
-
Reduce batch sizes:
-
Process files individually:
-
Monitor memory usage:
Log Analysis¶
Enable Comprehensive Logging¶
# Set debug level logging
./rag-cli config set logging.level DEBUG
# Enable verbose output
./rag-cli config set output.verbose true
# Run command with maximum logging
./rag-cli --debug --verbose command args
Common Log Patterns¶
Authentication Issues:
Network Issues:
Configuration Issues:
API Errors:
Log Rotation Issues¶
Issue: Log files too large
Solutions:
# Configure log rotation
./rag-cli config set logging.max_size "10MB"
./rag-cli config set logging.backup_count 5
# Manually rotate logs
./rag-cli config rotate-logs
Environment-Specific Issues¶
Docker/Container Issues¶
Issue: CLI not working in container
Solutions:
-
Check container setup:
-
Network connectivity in container:
CI/CD Pipeline Issues¶
Issue: Authentication in automated environments
Solutions:
-
Use service account credentials:
-
Disable interactive prompts:
System Integration Issues¶
Shell Integration¶
Issue: Tab completion not working
Solutions:
-
Install completion:
-
Fix shell compatibility:
Editor Integration¶
Issue: Configuration editing problems
Solutions:
-
Use built-in editor:
-
Specify editor:
Recovery Procedures¶
Complete Reset¶
If all else fails, perform a complete reset:
#!/bin/bash
echo "๐ Performing complete RAG CLI reset..."
# 1. Backup existing configuration
if [ -f ~/.rag/config.json ]; then
cp ~/.rag/config.json ~/.rag/config.json.backup.$(date +%Y%m%d_%H%M%S)
fi
# 2. Stop any running processes
pkill -f rag-cli
# 3. Clear all CLI data
rm -rf ~/.rag/
# 4. Reinstall CLI
cd backend
poetry install --with dev,test
# 5. Initialize fresh configuration
./rag-cli config init
# 6. Test installation
./rag-cli --version
./rag-cli config test
echo "โ
Reset completed. Please reconfigure authentication:"
echo " ./rag-cli config set auth.client_id 'your-client-id'"
echo " ./rag-cli config set auth.issuer 'https://your-issuer.com'"
Selective Recovery¶
For targeted recovery of specific components:
# Reset only authentication
rm -rf ~/.rag/tokens/
./rag-cli config unset auth
./rag-cli auth login
# Reset only configuration
rm ~/.rag/config.json
./rag-cli config init
# Clear only cache
rm -rf ~/.rag/cache/
./rag-cli config set cache.enabled true
Getting Additional Help¶
Built-in Help¶
# Command help
./rag-cli --help
./rag-cli auth --help
./rag-cli collections create --help
# Show examples
./rag-cli collections create --examples
Debug Information Collection¶
When reporting issues, collect this information:
#!/bin/bash
# collect-debug-info.sh
echo "RAG CLI Debug Information"
echo "========================"
echo "Date: $(date)"
echo "System: $(uname -a)"
echo ""
echo "CLI Version:"
./rag-cli --version
echo ""
echo "Python Environment:"
python --version
poetry --version
echo ""
echo "Configuration:"
./rag-cli config show --format json
echo ""
echo "Test Results:"
./rag-cli config test --verbose
echo ""
echo "Recent Logs (last 20 lines):"
tail -20 ~/.rag/logs/cli.log
echo ""
echo "System Resources:"
df -h ~/.rag/
du -sh ~/.rag/*
Community Support¶
- GitHub Issues: rag_modulo/issues
- Documentation: Check for updated troubleshooting guides
- Debug Mode: Always include
--debug --verboseoutput in bug reports
Professional Support¶
For enterprise support and custom troubleshooting:
- Contact your system administrator
- Check internal documentation
- Escalate to technical support team
Prevention Tips¶
Regular Maintenance¶
#!/bin/bash
# maintenance.sh - Run weekly
echo "๐ง RAG CLI Maintenance"
# Update dependencies
cd backend && poetry update
# Clean cache
./rag-cli config clean-cache --older-than 7d
# Rotate logs
./rag-cli config rotate-logs
# Test configuration
./rag-cli config test
# Test connectivity
./rag-cli config test-connection
echo "โ
Maintenance completed"
Monitoring¶
#!/bin/bash
# monitoring.sh - Health check script
# Check CLI health
if ! ./rag-cli config test --quiet; then
echo "โ CLI health check failed"
# Send alert or notification
fi
# Check authentication
if ! ./rag-cli auth status --quiet; then
echo "โ ๏ธ Authentication expired"
# Send notification for renewal
fi
# Check disk space
usage=$(df ~/.rag | tail -1 | awk '{print $5}' | sed 's/%//')
if [ "$usage" -gt 80 ]; then
echo "โ ๏ธ High disk usage in ~/.rag: ${usage}%"
fi
By following this troubleshooting guide, you should be able to resolve most common issues with the RAG CLI. If problems persist, don't hesitate to seek additional help using the provided support channels.