Open StarkGang opened 3 years ago
I cannot reproduce this issue. Does it need to be tested in a private conversation, small group chat, megagroup channel, or broadcast channel? Does the bot's datacenter matter? Does the group's datacenter matter? Does the datacenter of the user making the query matter?
I got this error on a mega group, where the owner's Dc is 5 and bot's Dc is also 5 and I got this error my Dc is also 5.
Please upload or otherwise provide the contents of the file somehow so that I can test with a file that triggers the bug.
Its a media file. happens with videos mostly.
@Lonami, I am too having this Error, I am. Trying to edit media send via Inline Queries, it's Occuring with Text files too, (while when used with send_file, they are fine)
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/telethon/client/updates.py", line 454, in _dispatch_update
await callback(event)
File "/root/TeamUltroid/assistant/othervars.py", line 62, in send
await eve.edit(file=plugin, buttons=buttons)
File "/usr/local/lib/python3.9/site-packages/telethon/events/callbackquery.py", line 316, in edit
return await self._client.edit_message(
File "/usr/local/lib/python3.9/site-packages/telethon/client/messages.py", line 1148, in edit_message
return await self._call(sender, request)
File "/usr/local/lib/python3.9/site-packages/telethon/client/users.py", line 79, in _call
result = await future
telethon.errors.rpcerrorlist.FilePart0MissingError: File part 0 missing (caused by EditInlineBotMessageRequest)
It's going for if statement ( dc_id are not same) - https://github.com/LonamiWebs/Telethon/blob/6b53d45ce27510335f5f33db510a4ee4e3a29a91/telethon/client/messages.py#L1120
Maybe something with invoking request from right DC
Yeah, maybe both the upload and request have to be invoked in the other DC.
Yeah, maybe both the upload and request have to be invoked in the other DC.
Lonami, how it can be achieved?
Presumably, the exported sender needs to be used for the upload too, and not just the request invocation.
Just encountered the same bug, in a public channel (with a handle).
A log, if that helps at all. I was replacing an image with an mp4
2021-06-09 23:34:12,929:INFO:fa_search_bot.sites.fa_submission:Loading gif from cache, submission ID 42264312
2021-06-09 23:34:12,934:INFO:usage:Pretty gif: from cache
2021-06-09 23:34:12,934:INFO:telethon.client.uploads:Uploading file of 709092 bytes in 6 chunks of 131072
2021-06-09 23:34:13,678:INFO:telethon.network.mtprotosender:Connecting to 149.154.167.51:443/TcpFull...
2021-06-09 23:34:13,704:INFO:telethon.network.mtprotosender:Connection to 149.154.167.51:443/TcpFull complete!
2021-06-09 23:34:13,757:ERROR:fa_search_bot.sites.fa_submission:Failed to convert gif to video. Submission ID: 42264312
Traceback (most recent call last):
File "/home/spangle/FA-search-bot/fa_search_bot/sites/fa_submission.py", line 309, in _send_gif
await send_partial(open(filename, "rb"))
File "/home/spangle/FA-search-bot/fa_search_bot/sites/fa_submission.py", line 247, in send_partial
await client.edit_message(
File "/home/spangle/FA-search-bot/venv/lib/python3.8/site-packages/telethon/client/messages.py", line 1093, in edit_message
return await self._call(sender, request)
File "/home/spangle/FA-search-bot/venv/lib/python3.8/site-packages/telethon/client/users.py", line 79, in _call
result = await future
telethon.errors.rpcerrorlist.FilePart0MissingError: File part 0 missing (caused by EditInlineBotMessageRequest)
2021-06-09 23:34:13,981:INFO:telethon.client.uploads:Uploading file of 122679 bytes in 1 chunks of 131072
I've tried uploading the file to a different datacenter, but I constantly get PHONE_MIGRATED
, so that does not seem to be the solution.
Lonami, I just Tried What you did, and got KeyError.
Complete TraceBack - https://hastebin.com/udavanapic.sql
Seems connection failed on __aenter__
so the exit fails too.
Editing Inline Media is already working fine for document already on Telegram. Problem is/was only for local Files.
So I just Tried
msg_media = await client.upload_file('file.txt')
media = await client(functions.messages.UploadMediaRequest(types.InputPeerSelf(), msg_media))
await event.edit(file=media)
And luckily it worked
Lately , I found
FILE_PART_Х_MISSING: Part X (where X is a number)
of the file is missing from storage. Try repeating the
method call to resave the part.
Is Mentioned at https://core.telegram.org/api/files
Maybe, that's what https://github.com/LonamiWebs/Telethon/issues/1668#issuecomment-873602782, is doing
I think, apparently it is not allowed, the BOT API docs was updated,.
I think for editing inline messages, you need to send message to some chat, and edit using the sent message file_id,
I think, getting the file id is currently broken in master branch, due to the layer 130 update.
Checklist
pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zip
and triggered the bug in the latest version.Code that causes the issue
Traceback