Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to connect to in.appcenter.ms in some areas of China mainland #1478

Closed
ichenhe opened this issue Nov 14, 2020 · 28 comments
Closed

Failed to connect to in.appcenter.ms in some areas of China mainland #1478

ichenhe opened this issue Nov 14, 2020 · 28 comments
Labels

Comments

@ichenhe
Copy link

ichenhe commented Nov 14, 2020

Description

Can not send any data to AppCenter with the following logs:

Emulator Logs (API28 Wear OS)
2020-11-14 23:12:26.015 21524-21524/com.cotwf.yilibaitech W/AppCenter: Try #2 failed and will be retried in 269213 ms
    javax.net.ssl.SSLHandshakeException: SSL handshake aborted: ssl=0xe1a4cf08: I/O error during system call, Connection reset by peer
        at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
        at com.android.org.conscrypt.NativeSsl.doHandshake(NativeSsl.java:375)
        at com.android.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(ConscryptFileDescriptorSocket.java:224)
        at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:192)
        at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:149)
        at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
        at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
        at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
        at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
        at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
        at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:26)
        at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doHttpCall(DefaultHttpClientCallTask.java:226)
        at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:279)
        at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:48)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
Physical Device Logs
2020-11-15 00:37:35.865 8677-8677/com.cotwf.yilibaitech W/AppCenter: Try #3 failed and will be retried in 827099 ms
    java.net.ConnectException: Failed to connect to in.appcenter.ms/52.232.216.86:443
        at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:143)
        at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
        at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
        at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
        at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
        at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
        at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:26)
        at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doHttpCall(DefaultHttpClientCallTask.java:226)
        at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:279)
        at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:48)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)

However the device can access the internet. This issue only shows up on Wear OS system. But I can use retrofit2 to visit any url like usual.

Repro Steps

Please list the steps used to reproduce your issue.

  1. Call AppCenter.start()
  2. Run the app.

Details

  1. Which SDK version are you using?
    • 3.3.1
  2. Which OS version did you experience the issue on?
    • Android 9 / Wear OS H
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • Wear OS emulator, Mi Watch / Mobvoi TicWatchPro physical device
  4. What third party libraries are you using?
    • retorfit2
    • glide
    • moshi
  5. Please enable verbose logging for your app using AppCenter.setLogLevel(Log.VERBOSE) before your call to AppCenter.start(...) and include the logs here:
Full Logs
2020-11-15 00:32:52.251 8677-8677/com.cotwf.yilibaitech I/AppCenter: App Center SDK configured successfully.
2020-11-15 00:32:52.278 8677-8677/com.cotwf.yilibaitech D/AppCenter: Cannot read instrumentation variables in a non-test environment.
2020-11-15 00:32:52.303 8677-8702/com.cotwf.yilibaitech D/AppCenter: Loaded stored sessions: {1605369182702=1605369182702//1605369182673, 1605369184661=1605369184661/1e1374da-ae7b-4856-a83a-00cbfd31a764/1605369182673, 1605369298999=1605369298999//1605369298916, 1605369301174=1605369301174/188002ba-d539-4295-a2fb-031b231a6235/1605369298916, 1605369672357=1605369672357//1605369672313, 1605369674825=1605369674825/ed159cd1-355d-4af0-a1d6-2303948fbce5/1605369672313, 1605369859755=1605369859755/65cb6b6c-adc2-48bf-b8f4-91e22644ebe8/1605369672313, 1605370013160=1605370013160/48d68a73-155c-4b1b-9b57-1ca81eb5921b/1605369672313, 1605371556087=1605371556087//1605371556056, 1605371558285=1605371558285/20b6cdfb-31c9-422f-871e-299c6086041f/1605371556056}
2020-11-15 00:32:52.304 8677-8677/com.cotwf.yilibaitech D/AppCenter: Cannot read instrumentation variables in a non-test environment.
2020-11-15 00:32:52.385 8677-8705/com.cotwf.yilibaitech D/AppCenter: Network 103 is available.
2020-11-15 00:32:52.390 8677-8705/com.cotwf.yilibaitech D/AppCenter: Network has been connected.
2020-11-15 00:32:52.406 8677-8705/com.cotwf.yilibaitech D/AppCenter: Network 104 is available.
2020-11-15 00:32:52.475 8677-8702/com.cotwf.yilibaitech I/AppCenter: Changed maximum database size to 10485760 bytes.
2020-11-15 00:32:52.476 8677-8702/com.cotwf.yilibaitech D/AppCenter: addGroup(group_core)
2020-11-15 00:32:52.497 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(group_core) pendingLogCount=11 batchTimeInterval=3000
2020-11-15 00:32:52.520 8677-8702/com.cotwf.yilibaitech D/AppCenter: App Center initialized.
2020-11-15 00:32:52.522 8677-8702/com.cotwf.yilibaitech D/AppCenter: removeGroup(group_analytics)
2020-11-15 00:32:52.522 8677-8702/com.cotwf.yilibaitech D/AppCenter: removeGroup(group_analytics/one)
2020-11-15 00:32:52.523 8677-8702/com.cotwf.yilibaitech D/AppCenter: addGroup(group_analytics)
2020-11-15 00:32:52.536 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(group_analytics) pendingLogCount=16 batchTimeInterval=3000
2020-11-15 00:32:52.537 8677-8702/com.cotwf.yilibaitech D/AppCenter: addGroup(group_analytics/one)
2020-11-15 00:32:52.543 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(group_analytics/one) pendingLogCount=0 batchTimeInterval=3000
2020-11-15 00:32:52.544 8677-8702/com.cotwf.yilibaitech D/AppCenter: addGroup(group_analytics_critical)
2020-11-15 00:32:52.560 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(group_analytics_critical) pendingLogCount=0 batchTimeInterval=3000
2020-11-15 00:32:52.561 8677-8702/com.cotwf.yilibaitech D/AppCenter: addGroup(group_analytics_critical/one)
2020-11-15 00:32:52.571 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(group_analytics_critical/one) pendingLogCount=0 batchTimeInterval=3000
2020-11-15 00:32:52.583 8677-8702/com.cotwf.yilibaitech I/AppCenter: Analytics service started from application.
2020-11-15 00:32:52.584 8677-8702/com.cotwf.yilibaitech D/AppCenter: removeGroup(groupErrors)
2020-11-15 00:32:52.584 8677-8702/com.cotwf.yilibaitech D/AppCenter: removeGroup(groupErrors/one)
2020-11-15 00:32:52.588 8677-8702/com.cotwf.yilibaitech D/AppCenter: addGroup(groupErrors)
2020-11-15 00:32:52.595 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(groupErrors) pendingLogCount=1 batchTimeInterval=3000
2020-11-15 00:32:52.607 8677-8702/com.cotwf.yilibaitech D/AppCenter: triggerIngestion(groupErrors) pendingLogCount=1
2020-11-15 00:32:52.608 8677-8702/com.cotwf.yilibaitech D/AppCenter: Trying to get 1 logs from the Persistence database for groupErrors
2020-11-15 00:32:52.994 8677-8702/com.cotwf.yilibaitech D/AppCenter: Returning 1 log(s) with an ID, 0ba72ab2-16ac-4efe-9515-c81bfaf87a36
2020-11-15 00:32:52.994 8677-8702/com.cotwf.yilibaitech D/AppCenter: The SID/ID pairs for returning log(s) is/are:
2020-11-15 00:32:53.001 8677-8702/com.cotwf.yilibaitech D/AppCenter: 	188002ba-d539-4295-a2fb-031b231a6235 / 24
2020-11-15 00:32:53.001 8677-8702/com.cotwf.yilibaitech D/AppCenter: ingestLogs(groupErrors,0ba72ab2-16ac-4efe-9515-c81bfaf87a36) pendingLogCount=0
2020-11-15 00:32:53.041 8677-8702/com.cotwf.yilibaitech D/AppCenter: addGroup(groupErrors/one)
2020-11-15 00:32:53.053 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(groupErrors/one) pendingLogCount=0 batchTimeInterval=3000
2020-11-15 00:32:53.063 8677-8702/com.cotwf.yilibaitech D/AppCenterCrashes: No previous minidump sub-folders.
2020-11-15 00:32:53.075 8677-8702/com.cotwf.yilibaitech I/AppCenter: Crashes service started from application.
2020-11-15 00:32:53.119 8677-8702/com.cotwf.yilibaitech D/AppCenter: Storing a log to the Persistence database for log type startService with flags=1
2020-11-15 00:32:53.153 8677-8702/com.cotwf.yilibaitech D/AppCenter: Stored a log to the Persistence database for log type startService with databaseId=29
2020-11-15 00:32:53.153 8677-8702/com.cotwf.yilibaitech D/AppCenter: enqueue(group_core) pendingLogCount=12
2020-11-15 00:32:53.159 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(group_core) pendingLogCount=12 batchTimeInterval=3000
2020-11-15 00:32:53.162 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(groupErrors) pendingLogCount=0 batchTimeInterval=3000
2020-11-15 00:32:53.517 8677-8707/com.cotwf.yilibaitech V/AppCenter: Calling https://in.appcenter.ms/logs?api-version=1.0.0...
2020-11-15 00:32:53.518 8677-8707/com.cotwf.yilibaitech V/AppCenter: Headers: {Content-Encoding=gzip, Install-ID=2e0c627f-2fb2-4e8f-8f30-30377b2a3ff4, App-Secret=****************************854766cd, Content-Type=application/json}
2020-11-15 00:32:53.518 8677-8707/com.cotwf.yilibaitech V/AppCenter: {"logs":[{"type":"managedError","timestamp":"2020-11-14T16:00:57.922Z","sid":"188002ba-d539-4295-a2fb-031b231a6235","device":{"sdkName":"appcenter.android","sdkVersion":"3.3.1","model":"Mi Watch","oemName":"Xiaomi","osName":"Android","osVersion":"9","osBuild":"PXDP.200825.001.XM098","osApiLevel":28,"locale":"zh_CN","timeZoneOffset":480,"screenSize":"368x448","appVersion":"0.1","appBuild":"1","appNamespace":"com.cotwf.yilibaitech"},"id":"0b5684c4-cadb-4d41-b583-4ad5a34b9fce","processId":7044,"processName":"com.cotwf.yilibaitech","errorThreadId":2,"errorThreadName":"main","fatal":true,"appLaunchTimestamp":"2020-11-14T15:54:59.282Z","architecture":"armeabi-v7a","exception":{"type":"java.lang.RuntimeException","message":"Unable to start activity ComponentInfo{com.cotwf.yilibaitech\/com.cotwf.yilibaitech.ui.MainActivity}: java.lang.IllegalStateException: NavController is not available before onCreate()","frames":[{"className":"android.app.ActivityThread","methodName":"performLaunchActivity","lineNumber":2914,"fileName":"ActivityThread.java"},{"className":"android.app.ActivityThread","methodName":"handleLaunchActivity","lineNumber":3049,"fileName":"ActivityThread.java"},{"className":"android.app.ActivityThread","methodName":"handleRelaunchActivityInner","lineNumber":4785,"fileName":"ActivityThread.java"},{"className":"android.app.ActivityThread","methodName":"handleRelaunchActivity","lineNumber":4694,"fileName":"ActivityThread.java"},{"className":"android.app.servertransaction.ActivityRelaunchItem","methodName":"execute","lineNumber":69,"fileName":"ActivityRelaunchItem.java"},{"className":"android.app.servertransaction.TransactionExecutor","methodName":"executeCallbacks","lineNumber":108,"fileName":"TransactionExecutor.java"},{"className":"android.app.servertransaction.TransactionExecutor","methodName":"execute","lineNumber":68,"fileName":"TransactionExecutor.java"},{"className":"android.app.ClientTransactionHandler","methodName":"executeTransaction","lineNumber":55,"fileName":"ClientTransactionHandler.java"},{"className":"android.app.ActivityThread","methodName":"handleRelaunchActivityLocally","lineNumber":4744,"fileName":"ActivityThread.java"},{"className":"android.app.ActivityThread","methodName":"access$3200","lineNumber":200,"fileName":"ActivityThread.java"},{"className":"android.app.ActivityThread$H","methodName":"handleMessage","lineNumber":1819,"fileName":"ActivityThread.java"},{"className":"android.os.Handler","methodName":"dispatchMessage","lineNumber":106,"fileName":"Handler.java"},{"className":"android.os.Looper","methodName":"loop","lineNumber":193,"fileName":"Looper.java"},{"className":"android.app.ActivityThread","methodName":"main","lineNumber":6680,"fileName":"ActivityThread.java"},{"className":"java.lang.reflect.Method","methodName":"invoke","lineNumber":-2,"fileName":"Method.java"},{"className":"com.android.internal.os.RuntimeInit$MethodAndArgsCaller","methodName":"run","lineNumber":501,"fileName":"RuntimeInit.java"},{"className":"com.android.internal.os.ZygoteInit","methodName":"main","lineNumber":858,"fileName":"ZygoteInit.java"}],"innerExceptions":[{"type":"java.lang.IllegalStateException","message":"NavController is not available before onCreate()","frames":[{"className":"androidx.navigation.fragment.NavHostFragment","methodName":"getNavController","lineNumber":184,"fileName":"NavHostFragment.java"},{"className":"androidx.navigation.fragment.NavHostFragment","methodName":"findNavController","lineNumber":105,"fileName":"NavHostFragment.java"},{"className":"androidx.navigation.fragment.FragmentKt","methodName":"findNavController","lineNumber":29,"fileName":"Fragment.kt"},{"className":"com.cotwf.yilibaitech.ui.MainFr$navController$2","methodName":"invoke","lineNumber":27,"fileName":"MainFr.kt"},{"className":"com.cotwf.yilibaitech.ui.MainFr$navController$2","methodName":"invoke","lineNumber":23,"fileName":"MainFr.kt"},{"className":"kotlin.SynchronizedLazyImpl","methodName":"getValue","lineNumber":74,"fileName":"LazyJVM.kt"},{"className":"com.cotwf.yilibaitech.ui.MainFr
2020-11-15 00:32:54.476 8677-8702/com.cotwf.yilibaitech D/AppCenterAnalytics: onActivityResumed
2020-11-15 00:32:54.483 8677-8702/com.cotwf.yilibaitech D/AppCenter: Storing a log to the Persistence database for log type startSession with flags=1
2020-11-15 00:32:54.495 8677-8702/com.cotwf.yilibaitech D/AppCenter: Stored a log to the Persistence database for log type startSession with databaseId=30
2020-11-15 00:32:54.495 8677-8702/com.cotwf.yilibaitech D/AppCenter: enqueue(group_analytics) pendingLogCount=17
2020-11-15 00:32:54.500 8677-8702/com.cotwf.yilibaitech D/AppCenter: checkPendingLogs(group_analytics) pendingLogCount=17 batchTimeInterval=3000
2020-11-15 00:32:54.559 8677-8677/com.cotwf.yilibaitech W/AppCenter: Try #1 failed and will be retried in 7052 ms
    java.net.ConnectException: Failed to connect to in.appcenter.ms/52.232.222.105:443
        at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:143)
        at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
        at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
        at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
        at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
        at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
        at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:26)
        at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doHttpCall(DefaultHttpClientCallTask.java:226)
        at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:279)
        at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:48)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
@vvechkanov
Copy link
Contributor

Hello @liangchenhe55!
Thank you for contacting us. We are looking into this problem and trying to reproduce it. Could you please tell, is this problem happens only on one specific device? Or on all your devices?

@ichenhe
Copy link
Author

ichenhe commented Nov 17, 2020

@vvechkanov There are two different types of exception.

1.SSLHandshakeException: You can reproduce it easily with any types of Wear OS emulator in Android studio.
2. java.net.ConnectException: May be on any Wear OS real devices. But only XiaoMi Watch and Mobvoi TicWatchPro are tested.

@vvechkanov
Copy link
Contributor

@liangchenhe55
We tried several computers with Wear OS emulators in different networks. All of them working with App Center correctly. No network exception, analytic data is sending correctly. Could you please try to check SSLHandshakeException exception on some other computer? May be some environment cofiguration cause this issue.

About 'java.net.ConnectException' issue on real device, we are working now, on reproducing it on different Wear OS real devices.

@ichenhe
Copy link
Author

ichenhe commented Nov 17, 2020

@vvechkanov I have tried an other computer but the problem still there. I don't think it is an host computer releated issue since my phone emulator is fine,

I will try an other computer in the other city and network environment tomorrow and share the result with you.

@ichenhe
Copy link
Author

ichenhe commented Nov 17, 2020

I have captured the tcp packages on emulator with tcpdump. So it seems that the server did not send the pub cert but rest the connection after the emlator sent TLS Hello.

@ichenhe
Copy link
Author

ichenhe commented Nov 18, 2020

@vvechkanov Unfortunately, the emulator in an other city and network environment failed again. May be we can find out something from the tcp packages above?
capture.zip

@vvechkanov
Copy link
Contributor

Hi @liangchenhe55!
Thank you for checking this on an additional machine. This problem is not reproducing on any of our machines, that's why I asked you to check. We a trying to reproduce it in some specific environment and analyze the logs you provided to understand the reason, why this exception happens. But unfortunately, we need some additional time. I am sorry, but I can assure you we are working on investigating this problem.

@ichenhe
Copy link
Author

ichenhe commented Nov 20, 2020

@vvechkanov copy that, thanks. I also find some real devices have no problem. However those devices belongs to our users so we can not get it and do some analysis. I am trying more models of devices and more network envs.

@russelarms
Copy link
Contributor

Hi @liangchenhe55, do you still experience the issue?
You've mentioned that retrofit2 works for you on Wear OS. Can you access appcenter api endpoint through retrofit2 (not using the App Center SDK) on Wear OS? Here's the quick guide on Appcenter API: https://intercom.help/appcenter/en/articles/1841885-how-to-use-app-center-s-api

Also is it possible to try the SDK with a proxy?

@ichenhe
Copy link
Author

ichenhe commented Nov 25, 2020

Hi @russelarms , yes, the problem is still there.

  1. I tried to GET https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/analytics/versions shown in the docs with Retrofit2, it worked fine. But I noticed that its domain is different from SDK (in.appcenter.ms).
  2. It difficult to set a proxy on Wear OS. Instead I set it on my gateway router and it solved the problem.

I apologize for my carelessness since I once said that there is no problem on the phone, because my phone usually runs an proxy, but it still a problem. It seems that in.appcenter.ms is blocked (or not stable enough) for some reasons in few regions in China mainland. This question is very tricky and may need the wider team to handle.


For the sake of caution, I tested on some servers with better network environments. e.g. Alibaba Clould Shanghai Node, Tencent Cloud Shanghai /Beijing Node. Run command curl/wget https://in.appcenter.ms. More than half the chance of failure.

[root@VM-0-2-centos ~]# wget https://in.appcenter.ms
--2020-11-26 00:24:12--  https://in.appcenter.ms/
Resolving in.appcenter.ms (in.appcenter.ms)... 52.232.209.85
Connecting to in.appcenter.ms (in.appcenter.ms)|52.232.209.85|:443... connected.
Unable to establish SSL connection.

[root@localhost ~]# curl https://in.appcenter.ms
curl: (35) TCP connection reset by peer

@russelarms
Copy link
Contributor

I apologize for my carelessness since I once said that there is no problem on the phone, because my phone usually runs an proxy, but it still a problem.

@liangchenhe55 As I understand it's not the case for the Wear OS only, you have the same problem on the phone if you turn off the proxy, right?

@ichenhe
Copy link
Author

ichenhe commented Nov 26, 2020

I apologize for my carelessness since I once said that there is no problem on the phone, because my phone usually runs an proxy, but it still a problem.

@liangchenhe55 As I understand it's not the case for the Wear OS only, you have the same problem on the phone if you turn off the proxy, right?

@russelarms right.

@ichenhe ichenhe changed the title Failed to connect to in.appcenter.ms on Wear OS device Failed to connect to in.appcenter.ms in some areas of China mainland Nov 26, 2020
@russelarms
Copy link
Contributor

@liangchenhe55 we've moved our endpoint to another IP pool. Could you try again?

@ichenhe
Copy link
Author

ichenhe commented Nov 27, 2020

@russelarms Now the data can be sent successfully in some cases, but it will still fail in some cases with the following errors:

  • javax.net.ssl.SSLHandshakeException: Connection closed by peer
  • java.net.SocketTimeoutException: failed to connect to api.appcenter.ms/52.138.116.79 (port 443)
  • java.net.SocketTimeoutException: SSL handshake timed out

May be I can set up an VPN for you to debug this problem. If necessary, please give me an email so that I can send the VPN account to you.

@russelarms
Copy link
Contributor

Our engineers are working on investigating this problem, but there's not much that we can do apart from changing the IPs at the moment.
Some middleware seems to block some SSL connections in China.

@ichenhe
Copy link
Author

ichenhe commented Nov 27, 2020

Copy that and thanks. I am glad to provide any assistance and information at any time.

@russelarms
Copy link
Contributor

java.net.SocketTimeoutException: failed to connect to api.appcenter.ms/52.138.116.79 (port 443)

Hi, @liangchenhe55! Another question just to be sure that we are on the same line:
I see you've tried App Center API (api.appcenter.ms), but we've moved IPs only for in.appcenter.ms (which is used by SDK). Have you checked the problem with SDK or only with App Center API?

@ichenhe
Copy link
Author

ichenhe commented Dec 2, 2020

Hi @russelarms , yes. I tried the SDK (v4.0.0) on the 27th Nov. UTC+8.

At the same time, the test code for api.appcenter.ms is retained. So this domain name also shown in the log. It can be concluded that the api.appcenter.ms is not very stable, just the same as in.appcenter.ms.

@ichenhe
Copy link
Author

ichenhe commented Dec 2, 2020

@mzekrallah
Copy link

mzekrallah commented Dec 2, 2020

I think we are getting the same issue here (but not a 100% sure) (we are in Jordan) .. also not sure if its related to our upgrade to major AppCenter SDK v4.0 (we were on old 2.1.1) but we're definitely not getting lots of crash reports and when investigated, started seeing these in the logs:

[AppCenter] Try #2 failed and will be retried in 165208 ms
[AppCenter] java.net.SocketTimeoutException: failed to connect to in.appcenter.ms/52.232.209.85 (port 443) from /192.168.1.66 (port 52436) after 10000ms
[AppCenter] 	at libcore.io.IoBridge.connectErrno(IoBridge.java:191)
[AppCenter] 	at libcore.io.IoBridge.connect(IoBridge.java:135)
[AppCenter] 	at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:142)
[AppCenter] 	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
[AppCenter] 	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
[AppCenter] 	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
[AppCenter] 	at java.net.Socket.connect(Socket.java:621)
[AppCenter] 	at com.and12-02 13:46:09.736 W/AppCenter(  650): 	at com.android.okhttp.internal.Platform.connectSocket(Platform.java:182)
[AppCenter] 	at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:1407)
[AppCenter] 	at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:1359)
[AppCenter] 	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:221)
[AppCenter] 	at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:144)
[AppCenter] 	at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:106)
[AppCenter] 	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:400)
[AppCenter] 	at com.microsoft.appcenter.http.DefaultHttpClroid.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:333)
[AppCenter] 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:483)
[AppCenter] 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:135)
[AppCenter] 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:266)
[AppCenter] 	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
[AppCenter] 	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
[AppCenter] 	at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doHttpCall(DefaultHttpClientCallTask.java:226)
[AppCenter] 	at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:48)
[AppCenter] 	at android.os.AsyncTask$3.call(AsyncTask.java:378)
[AppCenter] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[AppCenter] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
[AppCenter] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
[AppCenter] 	at java.lang.Thread.run(Thread.java:919)

Seen on Samsung Galaxy A20 - Android 10
Xamarin.Android TargetSdkversion = 10
Http client Implementation in Xamarin Settings => 'AndroidClientHandler'
AppCenter (v4.0)
Square.OkHttp (v2.7.5.1)
Square.OkIO (v2.4.3)

@russelarms
Copy link
Contributor

Hi @mzekrallah, how often do you see these errors?

@DmitriyKirakosyan
Copy link
Contributor

Due to country specific policies and laws, we cannot guarantee that App Center works in all countries. For some users in China region, Analytics and Diagnostics SDK data may experience significant delay or not make it to our servers based in the United States.
Since we have not heard any new reports recently, I am closing this issue.
Please feel free to reopen it if someone faces a similar problem again.

@ichenhe
Copy link
Author

ichenhe commented Apr 27, 2021

@DmitriyKirakosyan Thanks fou your work and I'am sorry to hear that. Maybe Microsoft can optimize the routing by, for example, CDN. Of course, I know it's a big project. If things get worse in China such as google(you know 😞 ), I will reopen this issue.

@AbdullahJaved-dev
Copy link

@DmitriyKirakosyan Facing this connection issue continuously on every device. Can you please provide any solution for this?

Device: Google Pixel 5a
Android Version: 13
App Center Version: 5.0.0
IDE: Android Studio
Location: Pakistan

17:54:56.495 AppCenter        W  Try #1 failed and will be retried in 7756 ms
                                 java.net.SocketException: Connection reset
                                 	at java.net.SocketInputStream.read(SocketInputStream.java:191)
                                 	at java.net.SocketInputStream.read(SocketInputStream.java:143)
                                 	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readFromSocket(ConscryptEngineSocket.java:945)
                                 	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:909)
                                 	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.-$$Nest$mprocessDataFromSocket(Unknown Source:0)
                                 	at com.android.org.conscrypt.ConscryptEngineSocket.doHandshake(ConscryptEngineSocket.java:241)
                                 	at com.android.org.conscrypt.ConscryptEngineSocket.startHandshake(ConscryptEngineSocket.java:220)
                                 	at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:196)
                                 	at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:153)
                                 	at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
                                 	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
                                 	at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
                                 	at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
                                 	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
                                 	at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
                                 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
                                 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
                                 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
                                 	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
                                 	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
                                 	at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doHttpCall(DefaultHttpClientCallTask.java:226)
                                 	at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:279)
                                 	at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:48)
                                 	at android.os.AsyncTask$3.call(AsyncTask.java:394)
                                 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
                                 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
                                 	at java.lang.Thread.run(Thread.java:1012)

@AnatolyPristensky
Copy link
Contributor

AnatolyPristensky commented Jan 31, 2023

Hello @AbdullahJaved-dev, according to AppCenter Services Status page - all services works as expected. Most likely your connection issues are related to your location.

@lisonge
Copy link

lisonge commented Jan 15, 2024

how to custom the dns of in.appcenter.ms ?

I found that the IP I got in mainland China is 93.46.8.90

But if I look it up in dns.google I get an ip of 40.70.161.102

40.70.161.102 is work for me

@rupa-singh
Copy link

Still no solution is present in this thread, I am facing the same issue.
Try #2 failed and will be retried in 151787 ms
javax.net.ssl.SSLHandshakeException: SSL handshake aborted: ssl=0xa67e8218: I/O error during system call, Connection reset by peer
at com.google.android.gms.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.google.android.gms.org.conscrypt.NativeSsl.doHandshake(:com.google.android.gms@240515018@24.05.15 (100300-607433892):11)
at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(:com.google.android.gms@240515018@24.05.15 (100300-607433892):126)
at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:192)
at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:149)
at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:26)
at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doHttpCall(DefaultHttpClientCallTask.java:226)
at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:279)
at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:48)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

@Mustafax06
Copy link

I'm having a similar issue on my native Android app

Try #2 failed and will be retried in 239637 ms
java.net.SocketTimeoutException: failed to connect to in.appcenter.ms/40.70.161.7 (port 443) from /192.168.1.50 (port 55282) after 10000ms
at libcore.io.IoBridge.connectErrno(IoBridge.java:235)
at libcore.io.IoBridge.connect(IoBridge.java:179)
at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:142)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
at java.net.Socket.connect(Socket.java:646)
at com.android.okhttp.internal.Platform.connectSocket(Platform.java:182)
at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:145)
at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doHttpCall(DefaultHttpClientCallTask.java:226)
at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:279)
at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:48)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants