tdlib / td

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

Get FullConfig error [Error : 0 : Timeout expired] #1396

Closed MLXProjects closed 3 years ago

MLXProjects commented 3 years ago

Hi! I'm writing a custom client in C, and using JSON to interact with the api. I'm following the Getting started page, now at the User Authorization section. After setting tdlib parameters correctly and sending a checkDatabaseEncryptionKey request with an empty encryption key, I need to send a setAuthenticationPhoneNumber request. I do so, with correctly written phone_number and allow_fast_calls set to false, but after sending that request it creates query auth_sendCode and later there are some errors:

[!Recoverer][&config_recoverer] Get FullConfig error [Error : 0 : Timeout expired]
[!Recoverer][&config_recoverer] Failed to connect for 20.322479

and few lines below:

[!ConfigSession][&net_query]    Got error [Query:[id:262144][tl:0xc4f9186b][state:Query]] [Error : 202 : ]
[!ConfigSession][&net_query]    Resend[Query:[id:262144][tl:0xc4f9186b][state:Error][Error : 202 : ]]
[!ConfigSession][&net_query]    Got error [Query:[id:262144][tl:0xc4f9186b][state:Query]] [Error : 0 : DispatchTtlError]
[!ConfigSession][&net_query]    [Query:[id:262144][tl:0xc4f9186b][state:Error][Error : 0 : DispatchTtlError]] [state:sent to callback]

Full log is here: https://del.dog/tdlib-log.txt

levlam commented 3 years ago

It looks like there are problems with Internet access.

MLXProjects commented 3 years ago

It looks like there are problems witt Internet access.

I can ping Google correctly, what may be causing the issue? Also, if you check at the log it correctly gets a file from dns.google

levlam commented 3 years ago

But it can't connect to Telegram servers. Probably, a firewall is blocking non-HTTP requests, or Telegram is blocked in your country.

MLXProjects commented 3 years ago

Telegram isn't blocked here (Argentina), and there is no firewall in the network. Telegram X works just fine (if useful in any way). Also, tried to ping the IPs that appear in the log and it pings right, tried doing telnet but it hangs. Maybe I need to set up something (like the IPs that appear at my.telegram.org/apps)? What are those IPs and keys for?

levlam commented 3 years ago

No. You need to do nothing. Something blocks TCP connections to the specified IPs and you can't check this with ICMP ping. You need tcptraceroute/mtr for that.

MLXProjects commented 3 years ago

No. You need to do nothing. Something blocks TCP connections to the specified IPs and you can't check this with ICMP ping. You need tcptraceroute/mtr for that.

Maybe it's the fact that I'm running this on an embedded system with only certain programs running? I'm only running wpa_supplicant (for wifi connection) and Busybox's udhcpc for getting an ip.

levlam commented 3 years ago

Those are ordinary TCP connections, so this shouldn't be related.

MLXProjects commented 3 years ago

Confirmed, this is a device issue (tested on another platform and worked correctly)...