Symptom: Containers fail to start or exit immediately
Check container status:
docker compose psView error logs:
docker compose logs backend
docker compose logs frontendSolution:
# Rebuild containers
docker compose down
docker compose up -d --buildSymptom: Frontend shows "Failed to connect" or network errors
Check backend health:
curl http://localhost:8000/healthExpected response:
{"status":"healthy","service":"Document Summarization Service","version":"2.0.0","llm_provider":"Enterprise Inference (Keycloak)"}Solution:
- Verify backend container is running:
docker compose ps - Check backend logs:
docker compose logs backend -f - Restart backend:
docker compose restart backend
Symptom: Text/PDF summarization fails with authentication errors
Error: Authentication error or Failed to resolve 'api.example.com'
Solution:
- Check Keycloak credentials in
backend/.env:BASE_URL(enterprise inference endpoint)KEYCLOAK_REALMKEYCLOAK_CLIENT_IDKEYCLOAK_CLIENT_SECRET
- Verify enterprise inference endpoint is accessible
- Test authentication:
curl -X POST https://your-api.example.com/token \
-d "grant_type=client_credentials" \
-d "client_id=your-client-id" \
-d "client_secret=your-client-secret"Error: Connection timeout
Solution:
- Verify
BASE_URLis correct inbackend/.env - Check network connectivity to enterprise endpoint
- Verify firewall settings allow HTTPS connections
Symptom: PDF upload fails or returns empty text
Error: Failed to extract text from PDF
Causes:
- Scanned PDF without text layer (image-only PDF)
- Password-protected PDF
- Corrupted PDF file
- PDF with complex formatting
Solution:
- For scanned PDFs, ensure OCR was run during scanning
- Remove password protection before uploading
- Try re-saving PDF with Adobe Reader or similar tool
- Check backend logs for specific error details
- Maximum PDF size: 50MB
Symptom: Browser shows blank page or cannot connect to localhost:5173
Check frontend status:
docker compose ps frontendCheck frontend logs:
docker compose logs frontend -fSolution:
- Clear browser cache and hard refresh (Ctrl+F5)
- Verify port 5173 is not in use:
netstat -ano | findstr :5173(Windows) - Kill conflicting process if port is occupied
- Restart frontend:
docker compose restart frontend - Check firewall settings allow localhost:5173
Error: Port 5173 is already allocated or Port 8000 is already allocated
Find process using port:
# Windows
netstat -ano | findstr :5173
netstat -ano | findstr :8000
# Linux/Mac
lsof -i :5173
lsof -i :8000Solution:
- Stop the conflicting process
- Or change ports in
docker-compose.yml:ports: - "8001:8000" # Change 8000 to 8001 - "5174:80" # Change 5173 to 5174
Symptom: Container crashes or backend becomes unresponsive
Check logs:
docker compose logs backend | grep -i "memory\|killed"Solution:
- Reduce file sizes (use smaller PDFs)
- Reduce
max_tokensin LLM requests - Increase Docker memory limit in Docker Desktop settings (minimum 4GB recommended)
- Process one file at a time instead of multiple concurrent requests
Symptom: 502 Bad Gateway or 503 Service Unavailable
Check backend:
docker compose logs backend --tail=50Common causes:
- Backend still starting (wait 30-60 seconds after start)
- Configuration error in
.envfile - Enterprise inference endpoint unreachable
- Keycloak authentication failing
- Python dependency issues
Solution:
# Restart backend
docker compose restart backend
# If issues persist, rebuild
docker compose down
docker compose up -d --build backendSymptom: Backend fails to start with configuration errors
Check required variables in backend/.env:
For text/PDF/DOCX summarization:
BASE_URL=https://api.example.com
KEYCLOAK_REALM=master
KEYCLOAK_CLIENT_ID=api
KEYCLOAK_CLIENT_SECRET=your_client_secret
INFERENCE_MODEL_ENDPOINT=Llama-3.1-8B-Instruct
INFERENCE_MODEL_NAME=meta-llama/Llama-3.1-8B-InstructCommon mistakes:
- Missing required Keycloak variables
- Extra spaces in variable names
- Wrong endpoint format (missing https://)
- Quotes around values (not needed in .env files)
- Using placeholder values like "api.example.com" or "your_client_secret"
Maximum file sizes:
- PDF/DOCX documents: 50 MB
Configured in backend/config.py:
MAX_PDF_SIZE = 52428800 # 50MB in bytesEdit backend/.env:
LOG_LEVEL=DEBUGRestart backend:
docker compose restart backend
docker compose logs backend -fTest text summarization:
curl -X POST http://localhost:8000/v1/docsum \
-F "type=text" \
-F "messages=This is a test document about artificial intelligence and machine learning." \
-F "max_tokens=100" \
-F "stream=false"Test PDF summarization:
curl -X POST http://localhost:8000/v1/docsum \
-F "type=text" \
-F "files=@test.pdf" \
-F "max_tokens=100" \
-F "stream=false"Access backend container shell:
docker compose exec backend /bin/bashCheck Python environment:
docker compose exec backend pip list
docker compose exec backend python -c "import pypdf; print('pypdf installed')"Verify environment variables:
docker compose exec backend env | grep -E "BASE_URL|KEYCLOAK"If issues persist, clean Docker completely:
# Stop and remove containers
docker compose down -v
# Remove unused images
docker system prune -a
# Rebuild from scratch
docker compose up -d --buildSymptom: All summarization fails (text, PDF)
Required for: ALL summarization operations
Check configuration:
- Verify
BASE_URLpoints to your enterprise inference endpoint - Confirm Keycloak credentials are correct
- Test Keycloak authentication separately
- Verify network access to enterprise endpoint
- Check if model name matches available models
If issues persist after following this guide:
-
Collect Information:
- Docker logs:
docker compose logs > logs.txt - Docker status:
docker compose ps - Environment check:
docker compose config
- Docker logs:
-
Check Configuration:
- Review
backend/.envfile (remove sensitive data before sharing) - Verify Keycloak credentials with your admin
- Review
-
Try Minimal Setup:
- Start with text summarization (simple, no files)
- Then test PDF processing
- This helps isolate which component is failing
-
System Information:
- Docker version:
docker --version - Docker Compose version:
docker compose version - Operating system and version
- Available memory and disk space
- Docker version: