Improve timeout resilience for Telegram and n8n integrations.
Add configurable Telethon retry/connect settings, enable retry-on-fail for external n8n nodes, and document recovery steps for Telegram and workflow activation timeouts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
41
redme.md
41
redme.md
@@ -67,6 +67,12 @@ cp .env.example .env
|
||||
- `SESSION_FILE_PATH=/app/session/session.session`
|
||||
- `HISTORY_CHECK_FILE=/app/session/history_done.flag`
|
||||
- `N8N_WEBHOOK_URL=https://<твой-n8n-домен>/webhook/tg-inbox`
|
||||
- `TG_USE_IPV6=false` (обычно для серверов так стабильнее)
|
||||
- `TG_CONNECT_TIMEOUT=20`
|
||||
- `TG_REQUEST_RETRIES=10`
|
||||
- `TG_CONNECTION_RETRIES=20`
|
||||
- `TG_RETRY_DELAY=5`
|
||||
- `TG_RECONNECT_WAIT=15`
|
||||
|
||||
Если `n8n` локально, можно `http://localhost:5678/webhook/tg-inbox`.
|
||||
|
||||
@@ -132,6 +138,41 @@ docker ps --filter name=dbbot-userbot
|
||||
docker compose up -d --build --force-recreate
|
||||
```
|
||||
|
||||
Если в логах `Connection to Telegram failed ... TimeoutError`:
|
||||
|
||||
1. Проверь доступность Telegram с хоста (фаервол/провайдер/блокировки).
|
||||
2. Оставь `TG_USE_IPV6=false` в `.env`.
|
||||
3. Подними таймаут/ретраи, например:
|
||||
- `TG_CONNECT_TIMEOUT=30`
|
||||
- `TG_CONNECTION_RETRIES=30`
|
||||
- `TG_RECONNECT_WAIT=20`
|
||||
4. Перезапусти контейнер:
|
||||
|
||||
```bash
|
||||
docker compose up -d --build --force-recreate
|
||||
docker compose logs -f tg-userbot
|
||||
```
|
||||
|
||||
Если в `n8n` при активации workflow ошибка:
|
||||
`The connection timed out, consider setting the 'Retry on Fail' option`
|
||||
|
||||
1. Открой в workflow узлы:
|
||||
- `Telegram Trigger`
|
||||
- `Qdrant Insert`
|
||||
- `Qdrant Retrieve Tool`
|
||||
- `Embeddings For Insert`
|
||||
- `Embeddings For Retrieve`
|
||||
- `Ollama Chat Model`
|
||||
- `Send Telegram Reply`
|
||||
2. Для каждого включи `Retry on Fail` и выставь:
|
||||
- `Max Tries = 5`
|
||||
- `Wait Between Tries = 5000 ms`
|
||||
3. Убедись, что из среды `n8n` доступны:
|
||||
- Telegram API (для `Telegram Trigger`)
|
||||
- URL Ollama
|
||||
- URL Qdrant
|
||||
4. Если снова падает на активации, временно отключи ветку `Telegram Trigger` и активируй ingest-ветку (`Webhook TG Inbox`) отдельно.
|
||||
|
||||
## Формат payload, который скрипт шлет в n8n
|
||||
|
||||
```json
|
||||
|
||||
Reference in New Issue
Block a user