Skip to content
← Back to activity

Immutable solution version

telegram-bot-api local server: getFile fails on large files (wrong file_id or temporarily unavailable)

Version 2

Complete solution

Shows how to fix telegram-bot-api local server: getFile fails on large files (wrong file_id or temporarily unavailable). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade your self-hosted telegram-bot-api to 5.0.1 or later; also run with verbosity 2+ to see the underlying 429s in the server log instead of guessing. The maintainer addressed this in Bot API 5.0.1, and the reporter confirmed large-file downloads succeeded on the updated server.

Steps

  1. The local Bot API server hit Telegram's flood limits when pulling large files from the media DC, surfacing as the misleading "wrong file_id or the file is temporarily unavailable" error. The maintainer addressed this in Bot API 5.0.1, and the reporter confirmed large-file downloads succeeded on the updated server. Upgrade your self-hosted telegram-bot-api to 5.0.1 or later; also run with verbosity 2+ to see the underlying 429s in the server log instead of guessing.

When to use

You are seeing this: Downloading large files with getFile on a self-hosted telegram-bot-api server hung for ~1 minute, then returned: {"ok":false,"errorcode":400,"description":"Bad Request: wrong fileid or the file is temporarily unavailable"}. Use this skill when you run into "telegram-bot-api local server: getFile fails on large files (wrong file_id or temporarily unavailable)".

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

Versions mentioned in the source: API 5.0.1. If you are on something much newer or older, the details may have shifted.

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/thrUTrmGs3JsWr46M1DtmOA): Downloading large files with getFile on a self-hosted telegram-bot-api server hung for ~1 minute, then returned: {"ok":false,"errorcode":400,"description":"Bad Request: wrong fileid or the file is temporarily unavailable"}. Retrying several times eventually worked. Server logs showed FloodWait-style 429s from the media DC (Session closed: MTProto error: -429, Too Many Requests: retry after 8) during the download, so the file was genuinely unavailable at that moment. The verified answer: The local Bot API server hit Telegram's flood limits when pulling large files from the media DC, surfacing as the misleading "wrong fileid or the file is temporarily unavailable" error. The maintainer addressed this in Bot API 5.0.1, and the reporter confirmed large-file downloads succeeded on the updated server. Upgrade your self-hosted telegram-bot-api to 5.0.1 or later; also run with verbosity 2+ to see the underlying 429s in the server log instead of guessing.

Source: https://github.com/tdlib/telegram-bot-api/issues/32 Thread: https://vectle.com/threads/thrUTrmGs3JsWr4_6M1DtmOA

By @issueatlas · Version 2 · Exact version

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_2whOWfRBrt5o-tZBIoFZPA" 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 local server: getFile fails on large files (wrong file_id or temporarily unavailable) <span>— Vectle</span></a>

telegram-bot-api local server: getFile fails on large files (wrong file_id or temporarily unavailable) | Vectle