telegram-upload icon indicating copy to clipboard operation
telegram-upload copied to clipboard

RPCError 400: INPUT_GZIP_INVALID

Open ElektroStudios opened this issue 4 years ago • 1 comments

  • telegram-upload version: 0.4.0
  • Python version: 3.9.2 x64
  • Operating System: Microsoft Windows 10.0.18363.959
  • Dependencies list (run pip freeze):
cffi==1.14.5
click==7.1.2
cryptg==0.2.post2
hachoir==3.1.2
pyaes==1.6.1
pyasn1==0.4.8
pycparser==2.20
rsa==4.7.2
telegram-upload==0.4.0
Telethon==1.21

Description

When sending a file, during the upload operation about at the 95% completion, I got an exception with message text related to 'RPCError 400: INPUT_GZIP_INVALID' which abruptly aborted the upload operation and telegram-upload.exe process terminated with exit code "1".

Here is the Traceback's stack trace:

Traceback (most recent call last):
  File "C:\Users\Administrador\source\repos\TelegramBackupBot\TelegramBackupBot\bin\Debug\Libs\telegram-upload-script.py", line 33, in <module>
    sys.exit(load_entry_point('telegram-upload==0.4.0', 'console_scripts', 'telegram-upload')())
  File "c:\program files\python\lib\site-packages\telegram_upload\exceptions.py", line 54, in wrap
    return fn(*args, **kwargs)
  File "c:\program files\python\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\program files\python\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\program files\python\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\program files\python\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\program files\python\lib\site-packages\telegram_upload\management.py", line 111, in upload
    client.send_files(to, files, delete_on_success, print_file_id, forward)
  File "c:\program files\python\lib\site-packages\telegram_upload\client.py", line 173, in send_files
    message = self._send_file_message(entity, file, thumb, progress)
  File "c:\program files\python\lib\site-packages\telegram_upload\client.py", line 123, in _send_file_message
    message = self.send_file(entity, file, thumb=thumb,
  File "c:\program files\python\lib\site-packages\telethon\sync.py", line 39, in syncified
    return loop.run_until_complete(coro)
  File "c:\program files\python\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "c:\program files\python\lib\site-packages\telethon\client\uploads.py", line 375, in send_file
    file_handle, media, image = await self._file_to_media(
  File "c:\program files\python\lib\site-packages\telethon\client\uploads.py", line 692, in _file_to_media
    file_handle = await self.upload_file(
  File "c:\program files\python\lib\site-packages\telethon\client\uploads.py", line 628, in upload_file
    result = await self(request)
  File "c:\program files\python\lib\site-packages\telethon\client\users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "c:\program files\python\lib\site-packages\telethon\client\users.py", line 79, in _call
    result = await future
telethon.errors.rpcbaseerrors.BadRequestError: RPCError 400: INPUT_GZIP_INVALID (caused by SaveBigFilePartRequest)

After I got that error, and as shown in the image above, I was able to try again to upload the same file (this means run again telegram-upload.exe using the same parameters as before), and this time the file was uploaded successfully without errors during the upload operation.

I don't know anything about Python more than the very basics, so I will not enter to discuss on that, but I can discard that it could had been a random network disconnection problem since on the background (me doing other things unrelated to telegram-upload) I was using other program that depends on staying connected.

What I Did

I did nothing strange, just a programmatic, automated call to run telegram-upload.exe passing to it the next command-line parameters to upload a file:

telegram-upload.exe --force-file --caption "" --to "{telegramInviteLink}" "{filepath}"

The program that can be seen in the image that I shared which is automating the telegram-upload.exe execution, I let it running mostly 24/7 hrs since 13 March 2021, and I noticed this same RPCError 400: INPUT_GZIP_INVALID error appearing a few times.

The error is not a big deal for me since in case of telegram-upload.exe exits with an error code I can retry the upload operation in an automated way (as I do in the image above), but precisely doing this it needs to start the upload from the beginning, and it consumes twice the time to upload the file, so at the end that error is very annoying.

ElektroStudios avatar Mar 25 '21 14:03 ElektroStudios

It must be probably a connection error with the servers. Even if you have a good connection, the servers may have connection failures.

I'm afraid there is no information about that error:

https://www.google.com/search?q=%22INPUT_GZIP_INVALID%22

Nekmo avatar Apr 03 '21 02:04 Nekmo

There are now 3 retries per file. In case of error it will continue with the rest of the files.

Nekmo avatar Jun 14 '23 16:06 Nekmo