3.0 KiB
3.0 KiB
Chat Assistant Troubleshooting Guide
Common Errors and Solutions
Error: 500 Internal Server Error
This usually indicates one of the following issues:
1. Ollama Not Running
Symptoms:
- 500 error on
/api/v1/chat - Error message mentions "connection" or "refused"
Solution:
# Check if Ollama is running in the container
docker exec be0 ps aux | grep ollama
# If not running, restart the container
docker-compose restart be0
# Or start Ollama manually
docker exec be0 ollama serve &
2. Model Not Available
Symptoms:
- Error mentions "model not found"
- Model name mismatch
Solution:
# Check available models
docker exec be0 ollama list
# Pull the required model
docker exec be0 ollama pull gemma3:270M
# Verify model is available
docker exec be0 ollama list | grep gemma3
3. Model Name Mismatch
Issue: Code uses gemma3:27b but entrypoint pulls gemma3:270M
Solution:
The code has been updated to use gemma3:270M to match the entrypoint script.
4. Network Connectivity
Symptoms:
- Connection refused errors
- Timeout errors
Solution:
# Check if Ollama is accessible from within the container
docker exec be0 curl http://localhost:11434/api/tags
# Check Ollama service status
docker exec be0 ollama list
Diagnostic Endpoints
Health Check
curl http://localhost:4402/health
This will show:
- Overall service status
- Ollama connection status
- Available models
Test Ollama Directly
# From inside the container
docker exec be0 ollama run gemma3:270M "Hello"
Debugging Steps
-
Check Backend Logs:
docker-compose logs be0 | tail -50 -
Check Chat Assistant Logs:
tail -f be0/logs/ChatAssistant.log -
Test API Endpoint:
curl -X POST http://localhost:4402/api/v1/chat \ -H "Content-Type: application/json" \ -d '{"message": "Hello"}' -
Verify Ollama Service:
docker exec be0 ollama list docker exec be0 curl http://localhost:11434/api/tags
Common Fixes
Fix 1: Restart Ollama Service
docker exec be0 pkill ollama
docker exec be0 ollama serve &
sleep 2
docker exec be0 ollama list
Fix 2: Pull Missing Model
docker exec be0 ollama pull gemma3:270M
Fix 3: Restart Container
docker-compose restart be0
Fix 4: Rebuild Container
docker-compose down
docker-compose build be0
docker-compose up be0
Expected Behavior
When working correctly:
- Health endpoint shows Ollama as "connected"
- Available models list includes
gemma3:270M - Chat endpoint returns 200 with a response
- Logs show successful message processing
Still Having Issues?
- Check the full error in logs:
docker-compose logs be0 - Verify Ollama is running:
docker exec be0 ps aux | grep ollama - Test Ollama directly:
docker exec be0 ollama run gemma3:270M "test" - Check model availability:
docker exec be0 ollama list