Skip to content

[Bug]: Stuck at Fetching dialog list #95

@sube32

Description

@sube32

Version

v7.3.0

Deployment Method

Docker Compose

Database Type

SQLite (default)

Bug Description

Telegram-backup cannot fetch dialog list, gets stuck, no feedback.

Expected Behavior

Any feedback.

Steps to Reproduce

sudo docker compose up -d && sudo docker compose logs -f telegram-backup

telegram-backup  | No database found yet - skipping migrations (will be created automatically)
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - ============================================================
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Telegram Backup Automation
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - ============================================================
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Schedule: 0 */6 * * *
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Backup path: /data/backups
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Download media: True
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Chat types: private, groups, channels
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Real-time listener: disabled
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - ============================================================
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Establishing shared Telegram connection...
telegram-backup  | 2026-03-25 11:03:09 - src.connection - INFO - Connecting to Telegram...
telegram-backup  | 2026-03-25 11:03:09 - src.connection - INFO - Enabled WAL mode for Telethon session database
telegram-backup  | 2026-03-25 11:03:09 - src.connection - INFO - Connected as *** (***)
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Shared connection established
telegram-backup  | 2026-03-25 11:03:09 - apscheduler.scheduler - INFO - Adding job tentatively -- it will be properly scheduled when the scheduler starts
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Backup scheduled with cron: 0 */6 * * *
telegram-backup  | 2026-03-25 11:03:09 - apscheduler.scheduler - INFO - Added job "Telegram Backup" to job store "default"
telegram-backup  | 2026-03-25 11:03:09 - apscheduler.scheduler - INFO - Scheduler started
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Scheduler started successfully
telegram-backup  | 2026-03-25 11:03:09 - src.scheduler - INFO - Running initial backup on startup...
telegram-backup  | 2026-03-25 11:03:09 - src.db.base - INFO - Initializing database: sqlite+aiosqlite:////data/backups/telegram_backup.db
telegram-backup  | 2026-03-25 11:03:09 - src.db.base - INFO - Database initialized successfully (SQLite)
telegram-backup  | 2026-03-25 11:03:09 - src.telegram_backup - INFO - TelegramBackup initialized
telegram-backup  | 2026-03-25 11:03:09 - src.telegram_backup - INFO - Starting backup process...
telegram-backup  | 2026-03-25 11:03:09 - src.telegram_backup - INFO - Connecting to Telegram...
telegram-backup  | 2026-03-25 11:03:10 - src.telegram_backup - INFO - Logged in as *** (***)
telegram-backup  | 2026-03-25 11:03:10 - src.telegram_backup - INFO - Fetching dialog list...

.env

# ==============================================================================
# Telegram Archive — Environment Variables
# ==============================================================================
# Copy this file to .env and fill in your values:
#   cp .env.example .env
#
# For the full reference table, see the README:
#   https://github.com/GeiserX/Telegram-Archive#environment-variables
# ==============================================================================

# ==============================================================================
# TELEGRAM CREDENTIALS (required for backup)
# ==============================================================================
# Get these from https://my.telegram.org/apps
TELEGRAM_API_ID=***
TELEGRAM_API_HASH=***
TELEGRAM_PHONE=***

# ==============================================================================
# BACKUP SCHEDULE & STORAGE
# ==============================================================================

# Cron schedule (minute hour day month weekday)
# Examples: 0 */6 * * * (every 6h), 0 0 * * * (daily), 0 */1 * * * (hourly)
SCHEDULE=0 */6 * * *

# Backup destination path (inside container)
BACKUP_PATH=/data/backups

# Download media files (photos, videos, documents)
# Set to false to save space and only backup text messages
DOWNLOAD_MEDIA=true

# Maximum media file size to download (in MB)
# Files larger than this will be skipped
MAX_MEDIA_SIZE_MB=4096

# Messages processed per database batch
# Higher values = faster but more memory usage
BATCH_SIZE=100

# How often to save backup progress (every N batch inserts)
# 1 = checkpoint every batch (safest, best crash recovery)
# Higher = fewer DB writes but more re-work on crash/restart
CHECKPOINT_INTERVAL=1

# Use symlinks to deduplicate identical media files across chats
# DEDUPLICATE_MEDIA=true

# Comma-separated chat IDs to process FIRST in all operations
# PRIORITY_CHAT_IDS=

# Skip media downloads for specific chats (comma-separated IDs)
# Messages are still backed up with text, but media files are not downloaded
# Useful for high-volume media chats where you only need text content
# Example: SKIP_MEDIA_CHAT_IDS=-1001234567890,-1009876543210
# SKIP_MEDIA_CHAT_IDS=

# Delete existing media files and DB records for chats in SKIP_MEDIA_CHAT_IDS
# When enabled (default), reclaims storage by removing already-downloaded media
# Set to false to keep existing media but skip future downloads
SKIP_MEDIA_DELETE_EXISTING=true

# Hour (0-23) to recalculate backup statistics daily
# STATS_CALCULATION_HOUR=3

# Logging level: DEBUG, INFO, WARNING, ERROR
LOG_LEVEL=INFO

# Session name (use different names for multiple accounts)
SESSION_NAME=telegram_backup

# Session directory (defaults to /data/session)
# SESSION_DIR=/data/session

# ==============================================================================
# CHAT FILTERING — Choose ONE mode
# ==============================================================================

# MODE 1: WHITELIST (Simple) — Set CHAT_IDS to backup ONLY specific chats
# When set, ONLY these chats are backed up. All other filtering is ignored.
# Example: CHAT_IDS=-1001234567890,-1009876543210
CHAT_IDS=-1002701160643

# MODE 2: TYPE-BASED (Default) — Use CHAT_TYPES to backup by type
# Options: private, groups, channels, bots (comma-separated)
CHAT_TYPES=private,groups,channels

# EXCLUDE specific chats (blacklist — takes priority)
GLOBAL_EXCLUDE_CHAT_IDS=
PRIVATE_EXCLUDE_CHAT_IDS=
GROUPS_EXCLUDE_CHAT_IDS=
CHANNELS_EXCLUDE_CHAT_IDS=

# INCLUDE additional chats (additive — adds to what CHAT_TYPES selects)
# Note: These ADD to the selection, they don't restrict it.
# For exclusive selection, use CHAT_IDS mode instead.
GLOBAL_INCLUDE_CHAT_IDS=
PRIVATE_INCLUDE_CHAT_IDS=
GROUPS_INCLUDE_CHAT_IDS=
CHANNELS_INCLUDE_CHAT_IDS=

# ==============================================================================
# REAL-TIME LISTENER
# ==============================================================================
# ENABLE_LISTENER is the master switch. When false (default), all LISTEN_*
# and MASS_OPERATION_* variables below have no effect.

ENABLE_LISTENER=false

# Granular listener controls (only apply when ENABLE_LISTENER=true):
# LISTEN_EDITS=true
# LISTEN_DELETIONS=true
# LISTEN_NEW_MESSAGES=true
# LISTEN_NEW_MESSAGES_MEDIA=false
# LISTEN_CHAT_ACTIONS=true

# Mass operation protection (only applies when ENABLE_LISTENER=true)
# MASS_OPERATION_THRESHOLD=10
# MASS_OPERATION_WINDOW_SECONDS=30
# MASS_OPERATION_BUFFER_DELAY=2.0

# Batch sync alternative (expensive — prefer ENABLE_LISTENER instead)
SYNC_DELETIONS_EDITS=false

# Re-download missing or corrupted media files
VERIFY_MEDIA=false

# ==============================================================================
# DATABASE CONFIGURATION (v3.0+)
# ==============================================================================
# Supports SQLite (default) and PostgreSQL.
# Both backup and viewer containers MUST use the same database settings.

# Option 1: Full DATABASE_URL (takes priority over all below)
# SQLite:     DATABASE_URL=sqlite:///data/telegram_backup.db
# PostgreSQL: DATABASE_URL=postgresql://user:password@localhost:5432/telegram_backup

# Option 2: Individual settings
DB_TYPE=sqlite
DB_PATH=/data/backups/telegram_backup.db

# PostgreSQL settings (when DB_TYPE=postgresql)
# POSTGRES_HOST=localhost
# POSTGRES_PORT=5432
# POSTGRES_USER=telegram
# POSTGRES_PASSWORD=your_secure_password
# POSTGRES_DB=telegram_backup

# ==============================================================================
# VIEWER & AUTHENTICATION
# ==============================================================================
# These apply to the telegram-archive-viewer container.

# Basic auth — set BOTH to enable authentication (recommended)
# VIEWER_USERNAME=admin
# VIEWER_PASSWORD=your_secure_password
# AUTH_SESSION_DAYS=30

# --- Multi-User Access Control (v7.0.0) ---
# Viewer accounts are managed via the admin panel (gear icon in sidebar).
# The VIEWER_USERNAME/VIEWER_PASSWORD above becomes the "master" account.
# Create additional viewer accounts with per-chat access via the admin UI.
# Viewer account data is stored in the database (viewer_accounts table).

# Timezone for displayed timestamps (tz database name)
# VIEWER_TIMEZONE=Europe/Madrid

# Show backup statistics dropdown in viewer header
# SHOW_STATS=true

# Restrict viewer to specific chats (comma-separated IDs)
# Useful for sharing public channel viewers without exposing other chats
# DISPLAY_CHAT_IDS=

# ==============================================================================
# SECURITY
# ==============================================================================

# Allowed CORS origins (comma-separated)
# Default: * (allow all origins, credentials auto-disabled)
# Example: CORS_ORIGINS=https://my.domain.com,https://other.domain.com
# CORS_ORIGINS=*

# Set Secure flag on auth cookies
# Default: auto-detect from request protocol (HTTPS reverse proxy or direct HTTPS = Secure)
# Override: true = always Secure, false = never Secure
# SECURE_COOKIES=

# ==============================================================================
# NOTIFICATIONS
# ==============================================================================

# Push notification mode: off, basic (in-browser only), full (Web Push)
# PUSH_NOTIFICATIONS=basic

# Custom VAPID keys for Web Push (auto-generated if empty)
# Generate with: npx web-push generate-vapid-keys
# VAPID_PRIVATE_KEY=
# VAPID_PUBLIC_KEY=
# VAPID_CONTACT=mailto:[email protected]

Environment

  • Docker version 28.2.2, build e6534b4
  • WSL Ubuntu 24.04

Checklist

  • I have searched existing issues to ensure this isn't a duplicate
  • I am using the latest version

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions