docs: care chatbot e care — trei "Maria", doi boti de Discord, doua punti WhatsApp

Pe 2026-08-31 s-a pierdut aproape o ora de diagnostic fiindca Maria raspundea pe
WhatsApp, dar verificarile se faceau pe containerul gresit: pe LXC 171 totul parea
rupt (niciun LLM pe 8091, WhatsApp neasociat, log fara activitate) in timp ce
raspunsurile veneau de pe LXC 104. Nicio pagina nu spunea ca exista doua instalari.

docs/chatboti-si-punti.md, verificat live: tabel scurt "cine e cine", cate o
sectiune per instanta (Maria pe Flowise, Maria WhatsApp de pe 104 care e cea vie,
Maria din git de pe 171 care nu e asociata, Echo pe 110, puntea Discord), tabel de
porturi cu notarea ca 8099 si 11434 exista pe ambele containere cu continut
diferit, comenzi de verificat cu cine vorbesti, si capcanele (prototipul de pe 104
nu e in git, depozitul e oglinda a Drive-ului, reindexarea dureaza ~21 min,
granita Mariei fata de infrastructura).

Faptul care lega totul: WhatsApp-ul lui Echo (110) si al Mariei (104) sunt legate
la acelasi numar, +40723197939, ca dispozitive diferite ale aceluiasi cont.

Documentul e legat din CLAUDE.md si dintr-un citat pus in capul celor cinci
README-uri implicate, ca sa fie gasit de cine aterizeaza direct acolo.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4uzvgm7AyJch5WH8QHRhY
This commit is contained in:
Claude Agent
2026-08-31 19:30:06 +00:00
parent 16ac5a289f
commit ae8acfbc8b
7 changed files with 1260 additions and 1081 deletions

View File

@@ -1,171 +1,175 @@
# LXC 104 - Flowise AI (Chatbot Maria)
**Director:** `proxmox/lxc104-flowise/`
**VMID:** 104
**IP:** 10.0.20.161
**Host Proxmox:** pvemini
**Servicii:** Flowise AI, ngrok tunnel, Ollama (opțional)
---
## Documentație Adițională
| Fișier | Descriere |
|--------|-----------|
| `docs/prd.md` | Product Requirements Document - Chatbot Suport Tehnic |
| `docs/v1-arhitectura.md` | Arhitectură versiunea 1 (Flowise + Groq) |
| `docs/v2-arhitectura.md` | Arhitectură versiunea 2 (Claude Agent SDK) |
---
## Componente
| Componenta | Locație | IP | Port |
|------------|---------|-----|------|
| Flowise | LXC 104 | 10.0.20.161 | 3000 |
| ngrok tunnel | LXC 104 | 10.0.20.161 | - |
| Pagina chatbot | romfast.ro | - | 443 |
## Configurare Flowise
**Serviciu systemd**: `/etc/systemd/system/flowise.service`
```ini
[Unit]
Description=Flowise Service
After=network.target
[Service]
User=root
Group=root
ExecStart=/usr/bin/npx flowise start
Restart=always
Environment=PORT=3000
Environment=FLOWISE_USERNAME=admin
Environment=FLOWISE_PASSWORD=parola28
Environment=CORS_ORIGINS=https://www.romfast.ro,https://romfast.ro
WorkingDirectory=/root/.flowise
Environment=FLOWISE_DATABASE_PATH=/root/.flowise/database.sqlite
[Install]
WantedBy=multi-user.target
```
**Comenzi utile**:
```bash
# Status
pct exec 104 -- systemctl status flowise
# Restart
pct exec 104 -- systemctl restart flowise
# Logs
pct exec 104 -- journalctl -u flowise -f
```
## Configurare ngrok
**Configurare**: `/root/.config/ngrok/ngrok.yml`
```yaml
version: "2"
authtoken: 2mo9quiDc23B6U3TtTqWJEleEfM_jYeD1KYe9u7njaaQMZg2
tunnels:
web:
proto: http
addr: http://10.0.20.161:3000
domain: mutual-special-koala.ngrok-free.app
```
**Serviciu systemd**: `/etc/systemd/system/ngrok.service`
**URL public**: https://mutual-special-koala.ngrok-free.app
**API endpoint chatbot**:
```
POST https://mutual-special-koala.ngrok-free.app/api/v1/prediction/d4911620-07fe-41f8-adb4-f2f52d6ec766
```
**Comenzi utile**:
```bash
# Status
pct exec 104 -- systemctl status ngrok
# Restart
pct exec 104 -- systemctl restart ngrok
# Verificare tunel activ
pct exec 104 -- curl -s http://localhost:4040/api/tunnels
# Verificare versiune
pct exec 104 -- /usr/local/bin/ngrok --version
# Actualizare ngrok
pct exec 104 -- /usr/local/bin/ngrok update
```
## Troubleshooting
### Eroare CORS
**Simptom**: Browser-ul afișează eroare CORS când se încarcă chatbot-ul.
**Cauza**: Flowise nu are configurată variabila `CORS_ORIGINS`.
**Soluție**: Adaugă în `/etc/systemd/system/flowise.service`:
```
Environment=CORS_ORIGINS=https://www.romfast.ro,https://romfast.ro
```
Apoi: `systemctl daemon-reload && systemctl restart flowise`
### Eroare ngrok versiune veche (ERR_NGROK_121)
**Simptom**: În logs apare:
```
Your ngrok-agent version "3.16.0" is too old. The minimum supported agent version is "3.19.0"
```
**Cauza**: ngrok a fost actualizat dar serviciul nu a fost restartat. Procesul vechi continuă să ruleze.
**Soluție**:
```bash
# Actualizare (dacă nu e deja făcută)
pct exec 104 -- /usr/local/bin/ngrok update
# IMPORTANT: Restart după actualizare
pct exec 104 -- systemctl restart ngrok
```
### Verificare rapidă că totul funcționează
```bash
# Test local Flowise
pct exec 104 -- curl -s http://localhost:3000/ | head -5
# Test tunel ngrok
curl -s "https://mutual-special-koala.ngrok-free.app/api/v1/prediction/d4911620-07fe-41f8-adb4-f2f52d6ec766" \
-X POST -H "Content-Type: application/json" \
-d '{"question":"test"}'
```
## Pagina web
URL: https://www.romfast.ro/chatbot_maria.html
Pagina încarcă widget-ul Flowise care se conectează la endpoint-ul ngrok.
## Istoric incidente
### 2025-12-30: Chatbot nu funcționa (CORS + ngrok versiune)
- **Problemă 1**: Flowise nu avea CORS configurat
- **Problemă 2**: ngrok rula versiunea 3.16.0 (actualizată dar nerestartat din octombrie)
- **Soluție**: Adăugat CORS_ORIGINS și restart la ambele servicii
---
## Legături Utile
- **Proxmox Index:** `../README.md`
- **Cluster Info:** `../cluster/README.md`
---
**Ultima actualizare:** 2026-01-27
**Autor:** Marius Mutu
# LXC 104 - Flowise AI (Chatbot Maria)
> **Care chatbot e care?** Exista trei lucruri numite „Maria", doi boti pe Discord si
> doua punti WhatsApp legate la acelasi numar. Inainte de a depana, citeste
> [`docs/chatboti-si-punti.md`](../../docs/chatboti-si-punti.md) — spune care instanta raspunde de fapt.
**Director:** `proxmox/lxc104-flowise/`
**VMID:** 104
**IP:** 10.0.20.161
**Host Proxmox:** pvemini
**Servicii:** Flowise AI, ngrok tunnel, Ollama (opțional)
---
## Documentație Adițională
| Fișier | Descriere |
|--------|-----------|
| `docs/prd.md` | Product Requirements Document - Chatbot Suport Tehnic |
| `docs/v1-arhitectura.md` | Arhitectură versiunea 1 (Flowise + Groq) |
| `docs/v2-arhitectura.md` | Arhitectură versiunea 2 (Claude Agent SDK) |
---
## Componente
| Componenta | Locație | IP | Port |
|------------|---------|-----|------|
| Flowise | LXC 104 | 10.0.20.161 | 3000 |
| ngrok tunnel | LXC 104 | 10.0.20.161 | - |
| Pagina chatbot | romfast.ro | - | 443 |
## Configurare Flowise
**Serviciu systemd**: `/etc/systemd/system/flowise.service`
```ini
[Unit]
Description=Flowise Service
After=network.target
[Service]
User=root
Group=root
ExecStart=/usr/bin/npx flowise start
Restart=always
Environment=PORT=3000
Environment=FLOWISE_USERNAME=admin
Environment=FLOWISE_PASSWORD=parola28
Environment=CORS_ORIGINS=https://www.romfast.ro,https://romfast.ro
WorkingDirectory=/root/.flowise
Environment=FLOWISE_DATABASE_PATH=/root/.flowise/database.sqlite
[Install]
WantedBy=multi-user.target
```
**Comenzi utile**:
```bash
# Status
pct exec 104 -- systemctl status flowise
# Restart
pct exec 104 -- systemctl restart flowise
# Logs
pct exec 104 -- journalctl -u flowise -f
```
## Configurare ngrok
**Configurare**: `/root/.config/ngrok/ngrok.yml`
```yaml
version: "2"
authtoken: 2mo9quiDc23B6U3TtTqWJEleEfM_jYeD1KYe9u7njaaQMZg2
tunnels:
web:
proto: http
addr: http://10.0.20.161:3000
domain: mutual-special-koala.ngrok-free.app
```
**Serviciu systemd**: `/etc/systemd/system/ngrok.service`
**URL public**: https://mutual-special-koala.ngrok-free.app
**API endpoint chatbot**:
```
POST https://mutual-special-koala.ngrok-free.app/api/v1/prediction/d4911620-07fe-41f8-adb4-f2f52d6ec766
```
**Comenzi utile**:
```bash
# Status
pct exec 104 -- systemctl status ngrok
# Restart
pct exec 104 -- systemctl restart ngrok
# Verificare tunel activ
pct exec 104 -- curl -s http://localhost:4040/api/tunnels
# Verificare versiune
pct exec 104 -- /usr/local/bin/ngrok --version
# Actualizare ngrok
pct exec 104 -- /usr/local/bin/ngrok update
```
## Troubleshooting
### Eroare CORS
**Simptom**: Browser-ul afișează eroare CORS când se încarcă chatbot-ul.
**Cauza**: Flowise nu are configurată variabila `CORS_ORIGINS`.
**Soluție**: Adaugă în `/etc/systemd/system/flowise.service`:
```
Environment=CORS_ORIGINS=https://www.romfast.ro,https://romfast.ro
```
Apoi: `systemctl daemon-reload && systemctl restart flowise`
### Eroare ngrok versiune veche (ERR_NGROK_121)
**Simptom**: În logs apare:
```
Your ngrok-agent version "3.16.0" is too old. The minimum supported agent version is "3.19.0"
```
**Cauza**: ngrok a fost actualizat dar serviciul nu a fost restartat. Procesul vechi continuă să ruleze.
**Soluție**:
```bash
# Actualizare (dacă nu e deja făcută)
pct exec 104 -- /usr/local/bin/ngrok update
# IMPORTANT: Restart după actualizare
pct exec 104 -- systemctl restart ngrok
```
### Verificare rapidă că totul funcționează
```bash
# Test local Flowise
pct exec 104 -- curl -s http://localhost:3000/ | head -5
# Test tunel ngrok
curl -s "https://mutual-special-koala.ngrok-free.app/api/v1/prediction/d4911620-07fe-41f8-adb4-f2f52d6ec766" \
-X POST -H "Content-Type: application/json" \
-d '{"question":"test"}'
```
## Pagina web
URL: https://www.romfast.ro/chatbot_maria.html
Pagina încarcă widget-ul Flowise care se conectează la endpoint-ul ngrok.
## Istoric incidente
### 2025-12-30: Chatbot nu funcționa (CORS + ngrok versiune)
- **Problemă 1**: Flowise nu avea CORS configurat
- **Problemă 2**: ngrok rula versiunea 3.16.0 (actualizată dar nerestartat din octombrie)
- **Soluție**: Adăugat CORS_ORIGINS și restart la ambele servicii
---
## Legături Utile
- **Proxmox Index:** `../README.md`
- **Cluster Info:** `../cluster/README.md`
---
**Ultima actualizare:** 2026-01-27
**Autor:** Marius Mutu