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

Using remote image URL give WEBPAGE_CURL_FAILED #2764

Closed cuongthai closed 8 months ago

cuongthai commented 9 months ago

I'm using sendMessage API to send photo that updated to s3 and using the link for tdlib to send. Due to existing architecture, we would rather not use local file. However, 20-30% of the time, tdlib failed to send the message and gave us a hint in log level 5. I would like to hear your feedback why it failed. Our best guess is the photo on S3 is not available at the time we sent but we crossed out that case 1) S3 is strongly consistent, 2) We add delay 3s after upload. 3) We get the photo after upload. However, tdlib still can't send with that remote photo URL.

{
      _: 'inputMessagePhoto',
      photo: {
        _: 'inputFileRemote',
        id: 'https://s3-ap-southeast-1.amazonaws.com/test.hangpopok.com/penhchat/3463-25c8b22c3601b9dac95ab913e015068d-1336700577837.jpg'
      },
 };
[ 2][t 2][1705499210.170077085][MessagesManager.cpp:30140][#1][!net_actor]  Fail to send yet unsent message 6136.1 in chat 453039527 with the error [Error : 400 : WEBPAGE_CURL_FAILED]
levlam commented 9 months ago

Photos sent by URL are downloaded server-side. The error means that file download has failed, or the image doesn't satisfy requirements described in sendPhoto documentation.