10 common pitfalls when self-hosting open-source AI support (with fixes)
The 10 most frequent issues we've seen rolling out Chatwoot + Dify / FastGPT over the past year — repro and fix for each.
1. Chatwoot can’t send mail#
Symptom: signup / ticket notification emails fail.
Cause: default dev SMTP; MAILER_SENDER_EMAIL mismatched with the verified domain.
Fix: Postmark or SES, ensure MAILER_SENDER_EMAIL is in the sender domain’s SPF / DKIM.
2. Dify KB returns zero hits#
Symptom: chat replies “I don’t have relevant info” after you uploaded docs.
Cause: 90% of the time it’s an embedding-dimension mismatch — you switched models without resetting the vector store.
Fix: rebuild the KB, or pin the embedding model in Settings.
3. AI leaks internal info to users#
Symptom: replies reference your internal SOP.
Cause: internal and external docs share one dataset.
Fix: split into two datasets. Prompt: “Only cite content from dataset ‘public’.“
4. Cloudflare Tunnel returns 502#
Cause: container listens on 127.0.0.1 rather than 0.0.0.0.
Fix: update docker-compose ports or bind to 0.0.0.0.
5. KB updates make RAG worse every time#
Cause: chunking strategy is re-picked each time; new docs dilute high-quality old ones.
Fix: pin chunking, build new docs in a side dataset, evaluate, then merge.
6. Long conversations forget context#
Symptom: AI forgets prior turns after 5 messages.
Cause: Dify default context window is 5 turns; models have hard limits too.
Fix: bump Dify to 15-20 turns or add a summarization node.
7. FRT killed by LLM latency#
Symptom: 8-15 seconds first response.
Cause: streaming not enabled + Cloudflare buffering + wrong model.
Fix: enable streaming, turn off Auto Minify / Rocket Loader, switch to low-latency model (Doubao / Groq Llama).
8. Tool calling — function not found#
Cause: tool schema validation fails silently.
Fix: hit the tool endpoint with Postman first, verify the OpenAPI schema matches Dify exactly.
9. AI answers off-limits questions#
Cause: prompt missing constraints + no pre-filter.
Fix: list forbidden topics in prompt + add a keyword pre-filter (n8n node).
10. End-of-month token bill explodes#
Symptom: LLM tokens 3-5× normal.
Cause: workflow loop or bot traffic spam.
Fix:
- Per-app token quota in Dify
- Cloudflare Turnstile for bot detection
- Alarms on hourly spend > X