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
452 lines
12 KiB
Markdown
452 lines
12 KiB
Markdown
# LXC 110 - MoltBot (AI Chatbot)
|
||
|
||
> **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/lxc110-moltbot/`
|
||
**VMID:** 110
|
||
**IP:** 10.0.20.173 (intern) | 100.120.119.70 (Tailscale)
|
||
**Host Proxmox:** pve1 (10.0.20.200)
|
||
**Rol:** Bot AI pentru Telegram și WhatsApp cu Claude Opus 4.5
|
||
|
||
---
|
||
|
||
## ⚠️ Status actual (verificat 2026-08-30)
|
||
|
||
Stack-ul activ e **echo-core** (Python, `/home/moltbot/echo-core`), NU clawdbot/OpenClaw.
|
||
Servicii `systemctl --user` active:
|
||
|
||
| Serviciu | Status | Descriere |
|
||
|----------|--------|-----------|
|
||
| `echo-core.service` | ✅ active running | Echo Core Bot (Discord + Telegram + WhatsApp), `python3 src/main.py` |
|
||
| `echo-taskboard.service` | ✅ active running | Echo Task Board API (dashboard) |
|
||
| `echo-whatsapp-bridge.service` | ✅ active running | Echo Core WhatsApp Bridge (Baileys, Node) |
|
||
| `pocket-tts.service` | ✅ active running | Pocket TTS (Kyutai) |
|
||
| `supertonic-tts.service` | ✅ active running | Supertonic TTS |
|
||
| `clawdbot-gateway.service` | ❌ not-found / dead | vechi, nu mai există ca unit |
|
||
| `openclaw-gateway` | ❌ nu există ca unit systemd | — |
|
||
|
||
CLI-ul `openclaw` (fostul `clawdbot`) e instalat (`/usr/bin/openclaw`, v2026.2.9) dar **nu mai e
|
||
funcțional**: config-ul din `~/.openclaw/openclaw.json` a fost scris de o versiune mai nouă
|
||
(2026.2.15), iar `openclaw status` dă `gateway closed (1006 abnormal closure)` pe
|
||
`ws://127.0.0.1:18789` — gateway-ul lui nu rulează (nu mai e serviciu systemd pentru el).
|
||
Comenzile `clawdbot ...` din secțiunile de mai jos **nu mai sunt valabile** — folosește
|
||
`systemctl --user status/restart echo-core` și `journalctl --user -u echo-core -f` în loc.
|
||
|
||
Secțiunile "MoltBot - Comenzi" / "Configurare Gateway" / "Servicii Systemd" de mai jos
|
||
documentează arhitectura veche (clawdbot/OpenClaw) — păstrate ca referință istorică, dar
|
||
nu mai reflectă ce rulează efectiv pe container.
|
||
|
||
---
|
||
|
||
## Informații Container
|
||
|
||
| Parametru | Valoare |
|
||
|-----------|---------|
|
||
| VMID | 110 |
|
||
| Hostname | moltbot |
|
||
| IP intern | 10.0.20.173 |
|
||
| IP Tailscale | 100.120.119.70 |
|
||
| Host Proxmox | pve1 (10.0.20.200) |
|
||
| User serviciu | `moltbot` |
|
||
| Parola user | `Moltbot2026!` |
|
||
| Storage | local-zfs (50GB) |
|
||
| RAM | 8GB (+ 4GB swap) |
|
||
| CPU | 6 cores |
|
||
| DNS | `10.0.20.1 1.1.1.1` (explicit, vezi mai jos) |
|
||
| OS | Ubuntu 24.04 LTS |
|
||
|
||
## Componente Instalate
|
||
|
||
- Ubuntu 24.04 LTS
|
||
- OpenClaw v2026.2.9 (upgraded from MoltBot/clawdbot)
|
||
- Node.js v22.22.0 (user-space)
|
||
- Bun v1.3.7
|
||
- Tailscale (pentru SSH, fără funnel)
|
||
- UFW Firewall
|
||
- Fail2ban
|
||
|
||
## Canale Configurate
|
||
|
||
| Canal | Status | Detalii |
|
||
|-------|--------|---------|
|
||
| **Telegram** | ✅ ON | Bot token configurat |
|
||
| **WhatsApp** | ✅ ON | Linked la +40723197939 |
|
||
|
||
## Model AI
|
||
|
||
- **Provider:** Anthropic
|
||
- **Model:** claude-opus-4-5
|
||
- **Context:** 200k tokens
|
||
|
||
## Securitate
|
||
|
||
| Măsură | Status |
|
||
|--------|--------|
|
||
| User dedicat (non-root) | `moltbot` |
|
||
| SSH key-only auth | Activat |
|
||
| UFW Firewall | Activat |
|
||
| Fail2ban SSH | Activat |
|
||
| Tailscale SSH | Activat |
|
||
| Sudo limitat | Doar `systemctl` |
|
||
| Linger enabled | Da (serviciu persistent) |
|
||
|
||
### Reguli Firewall UFW
|
||
|
||
```
|
||
22/tcp ALLOW IN Anywhere
|
||
18789 ALLOW IN 10.0.20.0/24 (MoltBot Dashboard)
|
||
Anywhere ALLOW IN 10.0.20.0/24 (rețea locală)
|
||
Anywhere ALLOW IN 100.64.0.0/10 (Tailscale)
|
||
```
|
||
|
||
### Configurare Sudo
|
||
|
||
User `moltbot` are sudo passwordless doar pentru:
|
||
- `systemctl status *`
|
||
- `systemctl start *`
|
||
- `systemctl stop *`
|
||
- `systemctl restart *`
|
||
|
||
## Conectare
|
||
|
||
### SSH (rețea internă)
|
||
```bash
|
||
ssh moltbot@10.0.20.173
|
||
```
|
||
|
||
### SSH (Tailscale - de oriunde)
|
||
```bash
|
||
ssh moltbot@100.120.119.70
|
||
```
|
||
|
||
### Acces root (pentru administrare)
|
||
```bash
|
||
ssh root@10.0.20.173
|
||
```
|
||
|
||
## MoltBot - Comenzi
|
||
|
||
### Terminal UI (TUI)
|
||
```bash
|
||
# Conectare și TUI într-o singură comandă
|
||
ssh -t moltbot@10.0.20.173 "clawdbot tui"
|
||
|
||
# Sau conectare separată
|
||
ssh moltbot@10.0.20.173
|
||
clawdbot tui
|
||
```
|
||
|
||
### Web Dashboard (via SSH Tunnel)
|
||
```bash
|
||
# Pe calculatorul local, deschide tunnel
|
||
ssh -L 18789:127.0.0.1:18789 -N moltbot@10.0.20.173 &
|
||
|
||
# Apoi accesează în browser
|
||
# http://localhost:18789
|
||
```
|
||
|
||
### Comenzi utile
|
||
|
||
```bash
|
||
# Status complet
|
||
clawdbot status
|
||
|
||
# Status detaliat
|
||
clawdbot status --deep
|
||
|
||
# Verificare versiune
|
||
clawdbot --version
|
||
|
||
# Restart gateway
|
||
clawdbot gateway restart
|
||
|
||
# Vezi loguri live
|
||
clawdbot logs --follow
|
||
|
||
# Verificare canale
|
||
clawdbot status --deep
|
||
|
||
# Gestionare dispozitive (pairing)
|
||
clawdbot devices list
|
||
clawdbot devices approve <request-id>
|
||
```
|
||
|
||
## Configurare Gateway
|
||
|
||
| Parametru | Valoare |
|
||
|-----------|---------|
|
||
| Port | 18789 |
|
||
| Bind | loopback (doar local) |
|
||
| Auth | token + password |
|
||
| Tailscale mode | off |
|
||
|
||
### Fișiere configurare
|
||
|
||
| Fișier | Descriere |
|
||
|--------|-----------|
|
||
| `~/.clawdbot/clawdbot.json` | Configurare principală |
|
||
| `~/.clawdbot/logs/gateway.log` | Loguri gateway |
|
||
| `~/.clawdbot/agents/main/sessions/` | Sesiuni agent |
|
||
| `~/.clawdbot/credentials/` | Credențiale (chmod 700) |
|
||
|
||
## Structura Directoare
|
||
|
||
```
|
||
/home/moltbot/
|
||
├── .ssh/
|
||
│ └── authorized_keys # Chei SSH pentru acces
|
||
├── .bun/ # Bun runtime
|
||
├── .local/
|
||
│ └── share/moltbot/
|
||
│ └── node/ # Node.js user-space
|
||
├── .clawdbot/
|
||
│ ├── clawdbot.json # Config MoltBot
|
||
│ ├── credentials/ # Credențiale (chmod 700)
|
||
│ ├── agents/
|
||
│ │ └── main/
|
||
│ │ └── sessions/ # Sesiuni chat
|
||
│ └── logs/
|
||
│ └── gateway.log # Loguri
|
||
├── clawd/ # Workspace pentru agent
|
||
└── .bashrc # PATH pentru node/bun
|
||
```
|
||
|
||
## Servicii Systemd
|
||
|
||
### Gateway Service
|
||
```bash
|
||
# Status
|
||
systemctl --user status clawdbot-gateway
|
||
|
||
# Restart
|
||
systemctl --user restart clawdbot-gateway
|
||
|
||
# Logs
|
||
journalctl --user -u clawdbot-gateway -f
|
||
```
|
||
|
||
## Administrare via Proxmox
|
||
|
||
### De pe pve1 (sau alt nod cluster)
|
||
```bash
|
||
# Status container
|
||
ssh root@10.0.20.200 "pct status 110"
|
||
|
||
# Exec comandă
|
||
ssh root@10.0.20.200 "pct exec 110 -- <comandă>"
|
||
|
||
# Stop/Start
|
||
ssh root@10.0.20.200 "pct stop 110"
|
||
ssh root@10.0.20.200 "pct start 110"
|
||
|
||
# Console
|
||
ssh root@10.0.20.200 "pct enter 110"
|
||
```
|
||
|
||
## DNS & Swap (incident 2026-07-31)
|
||
|
||
### DNS — nu depinde de Tailscale
|
||
|
||
Containerul **nu** avea `nameserver` în `pct config`, deci moștenea `/etc/resolv.conf` de
|
||
la host-ul pve1 — unde fișierul e scris de Tailscale și conținea doar MagicDNS
|
||
(`100.100.100.100`). Când `tailscaled` din container s-a delogat, DNS-ul a murit complet
|
||
(deși L3 era OK: `ping 8.8.8.8` funcționa) → `echo-core` în crash-loop pe
|
||
`telegram.error.TimedOut`.
|
||
|
||
Fix aplicat — nameserver explicit:
|
||
|
||
```bash
|
||
ssh root@10.0.20.200 "pct set 110 --nameserver '10.0.20.1 1.1.1.1'"
|
||
```
|
||
|
||
> **Regula de diagnostic:** la „nu mai ajunge la internet", verifică întâi
|
||
> `getent hosts api.telegram.org` și `cat /etc/resolv.conf`, **nu** ping-ul.
|
||
> Ping-ul poate merge perfect cu DNS-ul complet mort.
|
||
|
||
### Swap — necesită zram pe host
|
||
|
||
`swap: 4096` din `pct config` e doar o limită cgroup (`memory.swap.max`), nu un backing
|
||
store. Cât timp pve1 nu avea swap deloc, în container `free -h` arăta `Swap: 0B`.
|
||
Rezolvat prin zram pe pve1 (root-ul e pe ZFS → swapfile exclus):
|
||
|
||
```bash
|
||
# pe pve1 (host)
|
||
apt install -y zram-tools
|
||
cat > /etc/default/zramswap <<'EOF'
|
||
ALGO=zstd
|
||
SIZE=8192
|
||
PRIORITY=100
|
||
EOF
|
||
systemctl restart zramswap.service
|
||
swapon --show # /dev/zram0 8G prio 100
|
||
```
|
||
|
||
Verificare în container: `free -h` → `Swap: 4.0Gi`.
|
||
|
||
### Limite de memorie pe TTS
|
||
|
||
Serviciile user systemd rulau toate cu `MemoryMax=infinity` / `MemoryHigh=infinity`, deci
|
||
oricare putea consuma singur cei 8 GB → OOM-uri recurente (Apr 25, May 28 ×4, Jul 31), cu
|
||
victime aparent aleatorii (`dbus-daemon`, `sd-pam`) alese după `oom_score_adj`.
|
||
|
||
Aplicat pe stiva TTS — `MemoryHigh` face throttle + reclaim în loc de kill:
|
||
|
||
| Serviciu | RSS repaus | MemoryHigh | MemoryMax |
|
||
|----------|-----------|------------|-----------|
|
||
| `pocket-tts` | ~945 MB | 1536M | 2G |
|
||
| `supertonic-tts` | ~500 MB | 1024M | 1536M |
|
||
|
||
Drop-in-uri: `~/.config/systemd/user/<serviciu>.service.d/limits.conf`
|
||
|
||
```bash
|
||
su - moltbot
|
||
export XDG_RUNTIME_DIR=/run/user/1000
|
||
systemctl --user show pocket-tts -p MemoryHigh,MemoryMax,MemoryCurrent
|
||
```
|
||
|
||
**Post-mortem complet:** `../cluster/incidents/2026-07-31-lxc110-dns-tailscale-oom.md`
|
||
|
||
## Troubleshooting
|
||
|
||
### OpenClaw gateway se restartează continuu (OOM kill)
|
||
```bash
|
||
# Verifică dacă este omorât de OOM killer
|
||
journalctl --user -u openclaw-gateway | grep -i oom
|
||
|
||
# Verifică consumul de memorie
|
||
free -h
|
||
systemctl --user status openclaw-gateway
|
||
|
||
# Verifică dacă OOM-ul e local containerului sau al host-ului
|
||
# ssh root@10.0.20.200 "cat /sys/fs/cgroup/lxc/110/memory.events" # oom_kill > 0 => local
|
||
# ssh root@10.0.20.200 "free -h; swapon --show" # zram0 8G activ?
|
||
|
||
# Soluție: Crește RAM-ul containerului pe Proxmox (actual: 8192)
|
||
# ssh root@10.0.20.200
|
||
# pct stop 110
|
||
# pct set 110 --memory 12288
|
||
# pct start 110
|
||
|
||
# Curăță sesiunile vechi pentru a reduce consumul
|
||
openclaw sessions clean --older-than 7d
|
||
```
|
||
|
||
### MoltBot gateway nu pornește
|
||
```bash
|
||
# Verifică logs
|
||
clawdbot logs --follow
|
||
|
||
# Verifică status
|
||
clawdbot status
|
||
|
||
# Restart
|
||
clawdbot gateway restart
|
||
|
||
# Rulare manuală pentru debug
|
||
/usr/bin/node /usr/lib/node_modules/clawdbot/dist/entry.js gateway --port 18789
|
||
```
|
||
|
||
### Gateway unreachable
|
||
```bash
|
||
# Verifică dacă portul e ocupat
|
||
ss -tlnp | grep 18789
|
||
|
||
# Verifică serviciul systemd
|
||
systemctl --user status clawdbot-gateway
|
||
|
||
# Restart complet
|
||
systemctl --user restart clawdbot-gateway
|
||
```
|
||
|
||
### Eroare "gateway not connected" în TUI
|
||
```bash
|
||
# Gateway-ul probabil s-a oprit, restartează-l
|
||
clawdbot gateway restart
|
||
```
|
||
|
||
### Telegram/WhatsApp nu răspunde
|
||
```bash
|
||
# Verifică starea canalelor
|
||
clawdbot status --deep
|
||
|
||
# Pentru Telegram, verifică token-ul
|
||
grep botToken ~/.clawdbot/clawdbot.json
|
||
|
||
# Pentru WhatsApp, verifică link-ul
|
||
clawdbot status | grep WhatsApp
|
||
```
|
||
|
||
### Probleme de permisiuni
|
||
```bash
|
||
# Setează permisiunile corecte
|
||
chmod 700 ~/.clawdbot
|
||
chmod 700 ~/.clawdbot/credentials
|
||
chmod 600 ~/.clawdbot/clawdbot.json
|
||
```
|
||
|
||
### Tailscale nu funcționează
|
||
```bash
|
||
sudo systemctl status tailscaled
|
||
sudo tailscale status
|
||
tailscale ip
|
||
```
|
||
|
||
## Backup
|
||
|
||
### Backup configurare MoltBot
|
||
```bash
|
||
# De pe mașina locală
|
||
scp -r moltbot@10.0.20.173:~/.clawdbot ./backup-moltbot-$(date +%Y%m%d)/
|
||
```
|
||
|
||
### Backup complet LXC (via Proxmox)
|
||
```bash
|
||
ssh root@10.0.20.200 "vzdump 110 --storage local --compress zstd"
|
||
```
|
||
|
||
## Provider AI - Anthropic
|
||
|
||
MoltBot folosește Anthropic Claude prin API key configurat în:
|
||
- Config: `~/.clawdbot/clawdbot.json` → `auth.profiles.anthropic:default`
|
||
- Credențiale: `~/.clawdbot/credentials/`
|
||
|
||
### Monitorizare costuri
|
||
- Dashboard Anthropic: https://console.anthropic.com/settings/usage
|
||
- Sesiune curentă: ~132k/200k tokens (66%)
|
||
|
||
## Reconfigurare (dacă e necesar)
|
||
|
||
### Rulare wizard onboarding
|
||
```bash
|
||
clawdbot onboard
|
||
```
|
||
|
||
### Resetare completă
|
||
```bash
|
||
# Oprește gateway
|
||
clawdbot gateway stop
|
||
|
||
# Backup config vechi
|
||
mv ~/.clawdbot ~/.clawdbot.backup
|
||
|
||
# Rulează onboarding fresh
|
||
clawdbot onboard
|
||
```
|
||
|
||
---
|
||
|
||
## Legături Utile
|
||
|
||
- **Proxmox Index:** `../README.md`
|
||
- **Documentație MoltBot:** https://docs.molt.bot
|
||
- **MoltBot oficial:** https://molt.bot
|
||
- **Ghid deployment:** https://merox.dev/blog/moltbot-proxmox-deployment/
|
||
|
||
---
|
||
|
||
**Data setup:** 2026-01-29
|
||
**Ultima actualizare:** 2026-07-31 (host pve1, DNS explicit, zram — incident DNS/OOM)
|
||
**Autor:** Claude Code
|