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

IPv6 servers seems to be down #2491

Closed vincentneo closed 1 year ago

vincentneo commented 1 year ago

When prefer_ipv6 option is set to true, connection fails. Tested on watchOS, TDLib is compiled with current master branch commit.

[ 1][t 4][1686469431.012201070][ConnectionCreator.cpp:900][#1][!ConnectionCreator]   [Error : 0 : Socket is empty]
2023-06-11 15:43:51.019636+0800 Pigeon[72306:653363] PDTask <A5AA1480-26B0-40F1-9670-6DF6340ED264>.<5> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <A5AA1480-26B0-40F1-9670-6DF6340ED264>.<5>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <A5AA1480-26B0-40F1-9670-6DF6340ED264>.<5>",
    "LocalDataTask <A5AA1480-26B0-40F1-9670-6DF6340ED264>.<5>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:80/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:80/api}
2023-06-11 15:43:51.019913+0800 Pigeon[72306:653363] Task <A5AA1480-26B0-40F1-9670-6DF6340ED264>.<5> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <A5AA1480-26B0-40F1-9670-6DF6340ED264>.<5>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <A5AA1480-26B0-40F1-9670-6DF6340ED264>.<5>",
    "LocalDataPDTask <A5AA1480-26B0-40F1-9670-6DF6340ED264>.<5>",
    "LocalDataTask <A5AA1480-26B0-40F1-9670-6DF6340ED264>.<5>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:80/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:80/api}
[ 1][t 4][1686469438.357077121][ConnectionCreator.cpp:900][#1][!ConnectionCreator]   [Error : 0 : Socket is empty]
2023-06-11 15:43:58.367470+0800 Pigeon[72306:653831] PDTask <2FAE47A0-63E7-494A-9AA1-1F941EE85C57>.<6> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <2FAE47A0-63E7-494A-9AA1-1F941EE85C57>.<6>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <2FAE47A0-63E7-494A-9AA1-1F941EE85C57>.<6>",
    "LocalDataTask <2FAE47A0-63E7-494A-9AA1-1F941EE85C57>.<6>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:5222/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:5222/api}
2023-06-11 15:43:58.367890+0800 Pigeon[72306:653831] Task <2FAE47A0-63E7-494A-9AA1-1F941EE85C57>.<6> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <2FAE47A0-63E7-494A-9AA1-1F941EE85C57>.<6>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <2FAE47A0-63E7-494A-9AA1-1F941EE85C57>.<6>",
    "LocalDataPDTask <2FAE47A0-63E7-494A-9AA1-1F941EE85C57>.<6>",
    "LocalDataTask <2FAE47A0-63E7-494A-9AA1-1F941EE85C57>.<6>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:5222/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:5222/api}
[ 1][t 4][1686469454.357916116][ConnectionCreator.cpp:900][#1][!ConnectionCreator]   [Error : 0 : Socket is empty]
2023-06-11 15:44:14.376613+0800 Pigeon[72306:654197] PDTask <0B7F8159-E84C-4A3B-9881-6BBD08948A6F>.<7> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <0B7F8159-E84C-4A3B-9881-6BBD08948A6F>.<7>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <0B7F8159-E84C-4A3B-9881-6BBD08948A6F>.<7>",
    "LocalDataTask <0B7F8159-E84C-4A3B-9881-6BBD08948A6F>.<7>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:443/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:443/api}
2023-06-11 15:44:14.376828+0800 Pigeon[72306:653833] Task <0B7F8159-E84C-4A3B-9881-6BBD08948A6F>.<7> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <0B7F8159-E84C-4A3B-9881-6BBD08948A6F>.<7>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <0B7F8159-E84C-4A3B-9881-6BBD08948A6F>.<7>",
    "LocalDataPDTask <0B7F8159-E84C-4A3B-9881-6BBD08948A6F>.<7>",
    "LocalDataTask <0B7F8159-E84C-4A3B-9881-6BBD08948A6F>.<7>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:443/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:443/api}
[ 1][t 4][1686469486.355553150][ConnectionCreator.cpp:900][#1][!ConnectionCreator]   [Error : 0 : Socket is empty]
2023-06-11 15:44:46.365816+0800 Pigeon[72306:654869] PDTask <823460EC-8037-453F-AE14-968D43DF363C>.<8> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <823460EC-8037-453F-AE14-968D43DF363C>.<8>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <823460EC-8037-453F-AE14-968D43DF363C>.<8>",
    "LocalDataTask <823460EC-8037-453F-AE14-968D43DF363C>.<8>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:80/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:80/api}
2023-06-11 15:44:46.366348+0800 Pigeon[72306:654869] Task <823460EC-8037-453F-AE14-968D43DF363C>.<8> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <823460EC-8037-453F-AE14-968D43DF363C>.<8>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <823460EC-8037-453F-AE14-968D43DF363C>.<8>",
    "LocalDataPDTask <823460EC-8037-453F-AE14-968D43DF363C>.<8>",
    "LocalDataTask <823460EC-8037-453F-AE14-968D43DF363C>.<8>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:80/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:80/api}
[ 1][t 4][1686469550.354850053][ConnectionCreator.cpp:900][#1][!ConnectionCreator]   [Error : 0 : Socket is empty]
2023-06-11 15:45:50.363010+0800 Pigeon[72306:656726] PDTask <B1F69B9E-7DF1-4526-8B07-B62565A7BCC7>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <B1F69B9E-7DF1-4526-8B07-B62565A7BCC7>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <B1F69B9E-7DF1-4526-8B07-B62565A7BCC7>.<1>",
    "LocalDataTask <B1F69B9E-7DF1-4526-8B07-B62565A7BCC7>.<1>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:5222/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:5222/api}
2023-06-11 15:45:50.363204+0800 Pigeon[72306:656726] Task <B1F69B9E-7DF1-4526-8B07-B62565A7BCC7>.<9> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <B1F69B9E-7DF1-4526-8B07-B62565A7BCC7>.<9>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <B1F69B9E-7DF1-4526-8B07-B62565A7BCC7>.<9>",
    "LocalDataPDTask <B1F69B9E-7DF1-4526-8B07-B62565A7BCC7>.<1>",
    "LocalDataTask <B1F69B9E-7DF1-4526-8B07-B62565A7BCC7>.<1>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23d:f001::a:5222/api, NSErrorFailingURLKey=http://2001:b28:f23d:f001::a:5222/api}
vincentneo commented 1 year ago

And yes, I do have IPv6 access even in watchOS simulator.

Screenshot 2023-06-11 at 3 56 11 PM

(Sensitive information censored out)

levlam commented 1 year ago

Thank you for the report. I pushed a fix. Could you check that IPv6 works now on watchOS?

vincentneo commented 1 year ago

Unfortunately no. 😞 I also tried to ping from my Mac to 2001:b28:f23f:f005::a and got unknown host

2023-06-11 18:32:01.746541+0800 Pigeon[16612:1013630] PDTask <0C424364-4358-46A0-9E1C-7EDC00BFAA66>.<65> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <0C424364-4358-46A0-9E1C-7EDC00BFAA66>.<65>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <0C424364-4358-46A0-9E1C-7EDC00BFAA66>.<65>",
    "LocalDataTask <0C424364-4358-46A0-9E1C-7EDC00BFAA66>.<65>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23f:f005::a:80/api, NSErrorFailingURLKey=http://2001:b28:f23f:f005::a:80/api}
2023-06-11 18:32:01.746955+0800 Pigeon[16612:1013630] Task <0C424364-4358-46A0-9E1C-7EDC00BFAA66>.<65> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <0C424364-4358-46A0-9E1C-7EDC00BFAA66>.<65>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <0C424364-4358-46A0-9E1C-7EDC00BFAA66>.<65>",
    "LocalDataPDTask <0C424364-4358-46A0-9E1C-7EDC00BFAA66>.<65>",
    "LocalDataTask <0C424364-4358-46A0-9E1C-7EDC00BFAA66>.<65>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23f:f005::a:80/api, NSErrorFailingURLKey=http://2001:b28:f23f:f005::a:80/api}
2023-06-11 18:32:01.750296+0800 Pigeon[16612:1012079] PDTask <EDA1DE05-8E90-4F29-ABED-81A6C3D1D415>.<66> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <EDA1DE05-8E90-4F29-ABED-81A6C3D1D415>.<66>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <EDA1DE05-8E90-4F29-ABED-81A6C3D1D415>.<66>",
    "LocalDataTask <EDA1DE05-8E90-4F29-ABED-81A6C3D1D415>.<66>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23f:f005::a:5222/api, NSErrorFailingURLKey=http://2001:b28:f23f:f005::a:5222/api}
2023-06-11 18:32:01.750695+0800 Pigeon[16612:1012079] Task <EDA1DE05-8E90-4F29-ABED-81A6C3D1D415>.<66> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <EDA1DE05-8E90-4F29-ABED-81A6C3D1D415>.<66>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <EDA1DE05-8E90-4F29-ABED-81A6C3D1D415>.<66>",
    "LocalDataPDTask <EDA1DE05-8E90-4F29-ABED-81A6C3D1D415>.<66>",
    "LocalDataTask <EDA1DE05-8E90-4F29-ABED-81A6C3D1D415>.<66>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23f:f005::a:5222/api, NSErrorFailingURLKey=http://2001:b28:f23f:f005::a:5222/api}
2023-06-11 18:32:01.754190+0800 Pigeon[16612:1013630] PDTask <499648D4-27D2-4C13-8B9D-06B222EB4F17>.<67> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=65, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <499648D4-27D2-4C13-8B9D-06B222EB4F17>.<67>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <499648D4-27D2-4C13-8B9D-06B222EB4F17>.<67>",
    "LocalDataTask <499648D4-27D2-4C13-8B9D-06B222EB4F17>.<67>"
), NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=http://2001:b28:f23f:f005::a:443/api, NSErrorFailingURLKey=http://2001:b28:f23f:f005::a:443/api}
levlam commented 1 year ago

This looks like a log from an old TDLib version. Did you rebuild the latest TDLib 66234ae2537a99ec0eaf7b0857245a6e5c2d2bc9 from Github and used it for testing?

vincentneo commented 1 year ago

Ah, apologies, I didn't notice there's a new commit, assumed it's server-side. Will rebuild and retest, sorry about that.

vincentneo commented 1 year ago

Now with https://github.com/tdlib/td/commit/66234ae2537a99ec0eaf7b0857245a6e5c2d2bc9

I am getting:

2023-06-12 00:18:51.554960+0800 Pigeon[40303:1723839] PDTask <074E03FC-58FF-4840-AA4C-4063CEB6C3F2>.<3> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <074E03FC-58FF-4840-AA4C-4063CEB6C3F2>.<3>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataPDTask <074E03FC-58FF-4840-AA4C-4063CEB6C3F2>.<3>",
    "LocalDataTask <074E03FC-58FF-4840-AA4C-4063CEB6C3F2>.<3>"
), NSLocalizedDescription=The request timed out., _kCFStreamErrorDomainKey=4, NSErrorFailingURLStringKey=http://[2001:b28:f23d:f001::a]:5222/api, NSErrorFailingURLKey=http://[2001:b28:f23d:f001::a]:5222/api}
2023-06-12 00:18:51.555300+0800 Pigeon[40303:1723839] Task <074E03FC-58FF-4840-AA4C-4063CEB6C3F2>.<3> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <074E03FC-58FF-4840-AA4C-4063CEB6C3F2>.<3>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <074E03FC-58FF-4840-AA4C-4063CEB6C3F2>.<3>",
    "LocalDataPDTask <074E03FC-58FF-4840-AA4C-4063CEB6C3F2>.<3>",
    "LocalDataTask <074E03FC-58FF-4840-AA4C-4063CEB6C3F2>.<3>"
), NSLocalizedDescription=The request timed out., _kCFStreamErrorDomainKey=4, NSErrorFailingURLStringKey=http://[2001:b28:f23d:f001::a]:5222/api, NSErrorFailingURLKey=http://[2001:b28:f23d:f001::a]:5222/api}

Which I think can be assumed as a #2488 issue, since it's a timeout thing, just like in #2488.