Troubleshooting
This page covers common issues you may encounter when running KaaS, along with their possible causes and solutions.
LLM Connection Failed
Symptoms: Compilation fails immediately with connection errors; logs show LLM request failed or timeout messages.
Possible Causes:
- Incorrect or missing API key
- Wrong
base_urlconfiguration - Network issues (firewall, proxy, DNS)
Solution:
Verify your environment variables are set correctly:
bashecho $KAAS_LLM_API_KEY echo $KAAS_LLM_BASE_URLTest connectivity to the LLM endpoint directly:
bashcurl -s -o /dev/null -w "%{http_code}" \ -H "Authorization: Bearer $KAAS_LLM_API_KEY" \ "$KAAS_LLM_BASE_URL/models"A
200response confirms the endpoint is reachable.If behind a proxy, ensure
HTTP_PROXY/HTTPS_PROXYare configured.Check that your API key has not expired or hit its rate limit.
Compilation Stuck / No Progress
Symptoms: The compilation process appears to hang; no new articles are generated for an extended period.
Possible Causes:
- Circuit breaker tripped due to repeated LLM failures
- Worker lease expired (worker timed out waiting for LLM response)
- LLM endpoint is responding extremely slowly
Solution:
Check the backend logs for circuit breaker messages:
bashdocker logs kaas-backend 2>&1 | grep -i "circuit"If the circuit breaker has tripped, it will reset automatically after the cooldown period. You can adjust these settings:
toml[compiler] cb_failure_threshold = 5 # failures before tripping cb_cooldown_sec = 60 # seconds before retryVerify the LLM endpoint is still responsive (see LLM Connection Failed).
If workers have timed out, restart the compilation:
bashkaas compile --resume
MCP Connection Refused
Symptoms: MCP clients cannot connect to KaaS; errors like connection refused on the MCP port.
Possible Causes:
KAAS_MCP_ENABLEDenvironment variable not set totrue- Incorrect port configuration or port not exposed
- Token mismatch between client and server
Solution:
Ensure MCP is enabled in your configuration:
bashexport KAAS_MCP_ENABLED=trueVerify the MCP port is correctly mapped (default:
8081):bash# If using Docker docker ps --format "table {{.Ports}}" | grep kaasTest the MCP endpoint:
bashcurl -v http://localhost:8081/healthConfirm the token matches between your MCP client config and KaaS:
bashecho $KAAS_MCP_TOKENThe token in your client's MCP configuration must match this value exactly.
Docker Container Won't Start
Symptoms: docker compose up exits immediately or the container enters a restart loop.
Possible Causes:
- Port conflict (another service is using port 8080 or 8081)
- Missing required environment variables
- Volume mount permission issues
Solution:
Check container logs for the specific error:
bashdocker logs kaas-backendCheck for port conflicts:
bashlsof -i :8080 lsof -i :8081If another process occupies the port, stop it or change KaaS's port mapping in
docker-compose.yml.Ensure all required environment variables are set. At minimum:
bashKAAS_LLM_API_KEY=your-key KAAS_LLM_BASE_URL=https://api.openai.com/v1Verify data directory permissions:
bashls -la ./data/ # The directory must be writable by the container user (UID 1000) chmod -R 755 ./data/
Wiki Is Empty After Compilation
Symptoms: Compilation reports success but no articles appear in the wiki; the knowledge base has zero entries.
Possible Causes:
- Source content too short to extract meaningful knowledge
- Wrong
kb_dirpath configured - Compilation actually failed silently (partial failure)
Solution:
Check the Status page or API for compilation results:
bashcurl http://localhost:8080/api/v1/statusVerify the data directory contains generated markdown files:
bashls ./data/*.md 2>/dev/null | wc -lCheck backend logs for extraction warnings:
bashdocker logs kaas-backend 2>&1 | grep -i "skip\|empty\|too short"Ensure
kb_dirin your config points to the correct source directory:toml[compiler] kb_dir = "./data"If source documents are very short (< 100 characters), KaaS may skip them. Consider consolidating small documents.
Chat Returns "No relevant articles found"
Symptoms: The chat interface responds with "No relevant articles found" even for topics that should be covered.
Possible Causes:
- Wiki has not been compiled yet
- Master index is missing or corrupted
- Query is too vague or uses different terminology than the source material
Solution:
Confirm compilation has completed successfully:
bashcurl http://localhost:8080/api/v1/status # Look for "compilation_status": "completed"Verify the data directory has markdown files and a master index:
bashls ./data/*.md ls ./data/master-index*If the index is missing, re-run compilation:
bashkaas compileTry a more specific query that uses terms directly from your source documents.
Slow Compilation Performance
Symptoms: Compilation takes much longer than expected; progress is very slow but not stuck.
Possible Causes:
- Model too large or slow for available hardware (when using local LLM)
- Too few extraction workers configured
- High network latency to the LLM API
Solution:
Increase the number of workers:
toml[compiler] extract_workers = 4 # default is 2; increase based on API rate limitsIf using a remote API, check latency:
bashtime curl -s -o /dev/null "$KAAS_LLM_BASE_URL/models"Consider using a faster or smaller model for extraction:
toml[llm] model = "gpt-4o-mini" # faster than gpt-4o for extraction tasksIf running a local LLM, ensure you have sufficient GPU memory and that the model fits without excessive swapping.
Monitor system resources during compilation:
bashdocker stats kaas-backend