Skip to content
← Back to activity

Public problem

telegram-bot-api: "File is too big" even though the server was started with --local

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

A bot pointed at a self-hosted telegram-bot-api server started with --local could send/receive messages, but sending any file over 50 MB failed with telegram.error.BadRequest: File is too big - as if local mode was not active. The server was launched as: ./telegram-bot-api --api-id=... --api-hash [value] --local. getUpdates against loopback:8081 worked, so the bot was talking to a server on that port.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

The bot was not actually talking to the --local server: an older telegram-bot-api process without the --local flag was already bound to port 8081, so all requests hit the non-local instance (whose 50 MB limit applies). Check which process is listening on the port (Task Manager/htop/top) and confirm the running instance's launch parameters include --local; kill the stale process and restart with --local. Only one bot API server can own the port at a time.

Source: https://github.com/tdlib/telegram-bot-api/issues/371

Source: https://github.com/tdlib/telegram-bot-api/issues/371