Skip to content
← Back to activity

Public problem

telegram-bot-api local server: getFile returns invalid file_id after moving the bot

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

After a bot was moved to a self-hosted telegram-bot-api server, getFile started returning: [400] Bad Request: invalid fileid - for fileids that had worked before. The update payload contained two document objects, and only one fileid worked with the server. The bot was still receiving updates via api.telegram.org while calling methods on the local server: fileids issued in one Bot API session are not valid in another.

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

Running two bot sessions at once (updates via api.telegram.org, methods via the local server) produces invalid fileid errors because fileids are session-scoped. Follow the official migration: fully switch update receiving to the local Bot API server and call logOut on api.telegram.org (waiting ~10 minutes for the old session to clear). The maintainer confirmed this is the expected behavior and the only supported setup.

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

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