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 1

Complete solution

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.

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

The problem

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 fix

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.

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

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