Troubleshooting Guide
Common issues and solutions for the A2A RAG Agent system.
Service Issues
Milvus Connection Problems
Issue: Cannot connect to Milvus
Symptoms:
Solutions:
-
Check if Milvus is running:
-
View Milvus logs:
-
Restart Milvus:
-
Verify Milvus health:
-
Check port availability:
Issue: Milvus fails to start
Symptoms:
Solutions:
-
Find and kill process using port:
-
Use different port:
MCP Server Issues
Issue: MCP server won't start
Symptoms:
Solutions:
-
Check if port 8000 is in use:
-
Kill existing process:
-
Use different port:
-
Check server logs:
Issue: MCP server crashes on startup
Symptoms:
Solutions:
-
Verify virtual environment:
-
Reinstall dependencies:
-
Check Python version:
Watsonx.ai Issues
Authentication Errors
Issue: Invalid API key
Symptoms:
Solutions:
-
Verify API key in
.env: -
Check API key format:
- Should start with
apikey_ - No extra spaces or quotes
-
No newlines
-
Regenerate API key:
- Go to IBM Cloud console
- Navigate to Watsonx.ai
- Generate new API key
- Update
config/.env
Issue: Project ID not found
Symptoms:
Solutions:
-
Verify project ID:
-
Check project exists:
- Log into Watsonx.ai console
- Verify project is active
-
Copy correct project ID
-
Check project permissions:
- Ensure API key has access to project
- Verify project is not archived
Model Issues
Issue: Model not found
Symptoms:
Solutions:
-
Check available models:
from ibm_watsonx_ai import APIClient, Credentials credentials = Credentials( api_key="your-key", url="https://us-south.ml.cloud.ibm.com" ) client = APIClient(credentials) client.set.default_project("your-project-id") # List available models models = client.foundation_models.get_model_specs() for model in models['resources']: print(model['model_id']) -
Use alternative model:
Issue: Token limit exceeded
Symptoms:
Solutions:
-
Reduce chunk size:
-
Reduce chunk overlap:
-
Use model with higher limit:
Document Processing Issues
Indexing Failures
Issue: Unsupported file type
Symptoms:
Solutions:
- Check supported formats:
- PDF (
.pdf) - Word (
.docx) - Text (
.txt) -
Markdown (
.md) -
Convert file to supported format:
Issue: File not found
Symptoms:
Solutions:
-
Check file path:
-
Use absolute path:
-
Verify file permissions:
Issue: PDF extraction fails
Symptoms:
Solutions:
-
Repair PDF:
-
Convert to text first:
Query Issues
No Results Returned
Issue: Query returns empty results
Symptoms:
Solutions:
-
Check if documents are indexed:
-
Lower score threshold:
-
Increase top-k:
-
Verify embeddings:
Poor Quality Responses
Issue: Irrelevant or incorrect answers
Solutions:
-
Adjust LLM temperature:
-
Increase context:
-
Improve system prompt:
-
Re-index with better chunking:
Performance Issues
Slow Query Responses
Issue: Queries take too long
Solutions:
-
Optimize Milvus index:
-
Reduce top-k:
-
Reduce max tokens:
-
Enable caching:
High Memory Usage
Issue: System uses too much memory
Solutions:
-
Use quantized index:
-
Reduce batch size:
-
Limit concurrent processing:
Testing Issues
Test Failures
Issue: Tests fail with connection errors
Solutions:
-
Ensure services are running:
-
Wait for services to be ready:
-
Check service health:
Issue: Import errors in tests
Solutions:
-
Activate virtual environment:
-
Install test dependencies:
-
Set PYTHONPATH:
Data Issues
Collection Errors
Issue: Dimension mismatch
Symptoms:
Solutions:
-
Clear collection:
-
Update dimension in config:
-
Re-index documents:
Issue: Collection not found
Symptoms:
Solutions:
-
Restart Milvus:
-
Check collection name:
-
Create collection manually:
Logging and Debugging
Enable Debug Logging
View Logs
# MCP server logs
tail -f logs/mcp_server.log
# Milvus logs
cd RAG/deployment
podman-compose logs -f milvus
# Application logs
tail -f logs/rag.log
Debug Mode
# Enable debug mode in code
import logging
logging.basicConfig(level=logging.DEBUG)
# Or set environment variable
export LOG_LEVEL=DEBUG
Getting Help
Collect Diagnostic Information
# System information
python --version
podman --version
# Service status
curl http://localhost:8000/health
curl http://localhost:9091/healthz
# Configuration
cat config/.env | grep -v API_KEY
# Logs
tail -100 logs/mcp_server.log
Report Issues
When reporting issues, include:
- Error message and stack trace
- Configuration (without sensitive data)
- Steps to reproduce
- System information
- Relevant logs
Resources
Common Error Messages
| Error | Cause | Solution |
|---|---|---|
Connection refused |
Service not running | Start services with ./scripts/start_services.sh |
401 Unauthorized |
Invalid API key | Check WATSONX_API_KEY in .env |
404 Not Found |
Wrong endpoint/model | Verify URL and model name |
422 Unprocessable Entity |
Invalid parameters | Check request body format |
500 Internal Server Error |
Server-side error | Check logs for details |
503 Service Unavailable |
Dependencies down | Check Milvus and Watsonx.ai |
Token limit exceeded |
Chunk too large | Reduce RAG_CHUNK_SIZE |
Dimension mismatch |
Wrong embedding model | Clear collection and re-index |
Collection not found |
Milvus not initialized | Restart Milvus |
File not found |
Wrong path | Check file path and permissions |