tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Download file getting Error 400: File download has failed or was canceled #2929

Closed henriquelaporta closed 4 weeks ago

henriquelaporta commented 4 months ago

I have set up 2 different accounts using tdlight/td. They are running on two different servers and having the same issue when trying to download different files.

it.tdlight.client.TelegramError: 400: File download has failed or was canceled
    at it.tdlight.client.Result.get(Result.java:36)

I changed the log verbosity and this appears on the attempt to download the file:

[FileManager.cpp:2386][#1][!FileManager]    Need to redownload file {id}(0): [Error : 400 : Can't find real file path]
levlam commented 4 months ago

This is not the error you are looking for, but the actual error should be also logged with verbosity level 2.

henriquelaporta commented 4 months ago

@levlam Thank you for the fast reply.

Yeah, I've tried logged with verbosity level 2, but didn't find anything interesting.

So I'm downloading the file in parts each one with a max of 10 Mb. The problem is happening because these 10 Mb parts are taking too much time to download like +1 minute. The request gets a timeout from my side.

If we think about files of up to 4Gb that can take hours (even if a let the download runs without closing)

I understand that can be not related to the lib itself, but is unusable because I have the code running for years and never took time to download just 10 Mb. Using an instance with up to 5 Gb of bandwidth this is odd, also I'm not downloading other files or parts in parallel.

Do you have some idea or reason that could start happening right now?

levlam commented 4 months ago

If download speed has dropped, then this is likely caused by Internet data links being overloaded.

henriquelaporta commented 4 weeks ago

Just closing the issue, because as describe before, was a unknown problem with the download speed.

After a few days the file start be downloaded at normal speeds.