Troubleshooting
Fix common startup, database, login, proxy, upload, download, and SSE problems.
Start here
teldrive check --config /etc/teldrive/config.tomlCompose:
docker compose run --rm teldrive check
docker compose logs --tail=300 teldriveTemporary debug logging:
In a YAML configuration file:
logging:
log-level: debug
log-format: textReturn to info after investigating. Debug logs may contain sensitive operational details; redact them before sharing.
File logging
Console logs remain enabled. To also write to a file, add this to config.toml:
[logging]
log-level = "info"
log-format = "json"
log-file = "/var/log/teldrive/teldrive.log"Or set TELDRIVE_LOGGING_LOG_FILE=/var/log/teldrive/teldrive.log. The file uses the configured log level and format, without terminal color codes.
For a host service running as teldrive, create the parent directory first:
sudo install -d -o teldrive -g teldrive -m 0700 /var/log/teldriveNew files are created with mode 0600. Existing files keep their permissions and must be writable by the service user. Teldrive appends on startup; it does not truncate the file. A missing or unwritable parent directory prevents startup.
For the official container image, create a writable directory owned by UID/GID 65532:65532 and mount it into the container:
sudo install -d -o 65532 -g 65532 -m 0700 /srv/teldrive/logsAdd these settings to the Teldrive Compose service:
services:
teldrive:
environment:
TELDRIVE_LOGGING_LOG_FILE: /var/log/teldrive/teldrive.log
volumes:
- /srv/teldrive/logs:/var/log/teldriveAdjust ownership for rootless containers and apply the required bind-mount labels on SELinux hosts.
There is no automatic rotation or size limit. Prefer console-log collection when available. If rotating the file by renaming it, restart Teldrive to reopen the configured path; otherwise it continues writing to the old file. Monitor disk usage and keep log files private.
Teldrive exits immediately
Check the first error. Common causes:
- missing/unreachable PostgreSQL;
- signing key shorter than 32 characters;
- invalid
security.data-key; - invalid proxy/MTProxy combination;
- invalid encryption key/version configuration.
Generate a compatible data key only for a new installation:
openssl rand -base64 32Do not replace a production data key; existing encrypted values depend on it.
Container is unreachable
Inside a container, listen on all container interfaces:
TELDRIVE_HTTP_ADDRESS=0.0.0.0:8080Publish intentionally, for example host loopback only:
ports:
- "127.0.0.1:8080:8080"PostgreSQL connection failure
pg_isready -h postgres -p 5432 -U teldrive -d teldriveCheck host/service name, port, credentials, database, sslmode, networking, readiness, and connection limits. In Compose, use the PostgreSQL service name, not localhost.
Login fails behind HTTPS
Verify:
- proxy sends
X-Forwarded-Proto: https; - proxy source is listed in
http.trusted-proxies; - users access one canonical HTTPS origin.
Login disappears after restart
Check that these did not change:
security.signing-key
security.data-keyAlso verify PostgreSQL data is persistent.
Live progress updates only after refresh
SSE is being interrupted or buffered. Check proxy response buffering, read/idle timeouts, CDN/load-balancer timeouts, and repeated EventSource reconnects in browser developer tools.
Upload fails at a fixed duration
Compare timeout limits across:
client → CDN/load balancer → reverse proxy → TeldriveTeldrive defaults to one-hour HTTP read/write timeouts.
Slow uploads
Check CPU, network, Telegram retry/rate-limit errors, proxy overhead, and BLAKE3 hashing before increasing:
telegram:
upload-threads: 8Increase gradually.
Slow downloads
Start from defaults:
telegram:
download-read-buffers: 32
download-read-parallel: 4
download-bots: 0Tune parallelism only after ruling out client/proxy/host bottlenecks. Add bots only after normal downloads work.
Proxy/MTProxy config rejected
Use one proxy mode only.
Standard proxy:
telegram:
proxy: socks5://proxy.example.com:1080MTProxy:
telegram:
mtproxy:
address: proxy.example.com:443
secret: YOUR_SECRETMTProxy address and secret must both be present.
Encryption errors after rotation
Keep old key versions referenced by existing files:
encryption:
active-key-version: 2
keys:
1: OLD_KEY
2: NEW_KEYTest both a new upload and an old download.
Problems only with multiple instances
Verify every process shares the same database/schema and security/encryption keys. Also check aggregate PostgreSQL connections, worker roles, SSE load-balancing, bot rotation backend, and version skew.
Report useful diagnostics
Include:
teldrive version;- deployment method;
- redacted relevant config;
- first meaningful log error;
- result of
teldrive check; - exact reproduction steps.