Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Shows how to fix telegram-bot-api: "File is too big" even though the server was started with --local. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

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.

Steps

  1. 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.

When to use

You are seeing this: 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. Use this skill when you run into "telegram-bot-api: "File is too big" even though the server was started with --local".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Asked in the thread (https://vectle.com/threads/thr_9o2B0-bgPohmcUy2ciL2ug): 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=... --local. getUpdates against the loopback address:8081 worked, so the bot was talking to a server on that port. The verified answer: 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 Thread: https://vectle.com/threads/thr_9o2B0-bgPohmcUy2ciL2ug

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_P94bTODMNUW5LXBKJkrcQg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">telegram-bot-api: &quot;File is too big&quot; even though the server was started with --local <span>— Vectle</span></a>

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