firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.67k stars 1.49k forks source link

network connection refused #3698

Closed luoyingli closed 5 years ago

luoyingli commented 5 years ago

Recently, our application firebase statistics on the ios platform dropped sharply, and the network connection was rejected through debug. Below is the debug log.

My environment

Debug log

2019-08-27 18:29:29.098573+0800 ****[7943:2205019] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x281421520, domain=1, instance=1>

2019-08-27 18:29:29.241659+0800 ****[7943:2205017] TIC TCP Conn Failed [8:0x282172c40]: 12:8 Err(-65554)

2019-08-27 18:29:29.247623+0800 ****[7943:2205019] Task <AF90ADC6-A917-4865-863C-7DA2821779D0>.<1> HTTP load failed (error code: -1003 [12:8])

2019-08-27 18:29:29.254467+0800 ****[7943:2205017] Task <AF90ADC6-A917-4865-863C-7DA2821779D0>.<1> finished with error - code: -1003

2019-08-27 18:29:29.259693+0800 ****[7943:2205017] 6.5.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60004000 started

2019-08-27 18:29:29.374159+0800 ****[7943:2205019] [BoringSSL] nw_protocol_boringssl_error(1584) [C7.2:2][0x10605a1c0] Lower protocol stack error: 54

2019-08-27 18:29:29.375644+0800 ****[7943:2205019] TIC TCP Conn Failed [7:0x282177180]: 1:54 Err(54)

2019-08-27 18:29:29.377242+0800 ****[7943:2205019] Task <8241006A-08BE-4E66-A147-453C49615379>.<1> HTTP load failed (error code: -1005 [1:54])

2019-08-27 18:29:29.378214+0800 ****[7943:2205019] Task <8241006A-08BE-4E66-A147-453C49615379>.<1> finished with error - code: -1005

2019-08-27 18:29:32.414978+0800 ****[7943:2204876] Task <8241006A-08BE-4E66-A147-453C49615379>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={_kCFStreamErrorCodeKey=54, NSUnderlyingError=0x281ad5710 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=54, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <8241006A-08BE-4E66-A147-453C49615379>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalUploadTask <8241006A-08BE-4E66-A147-453C49615379>.<1>"
), NSLocalizedDescription=网络连接已中断。, NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorFailingURLKey=https://play.googleapis.com/log, _kCFStreamErrorDomainKey=1} [-1005]

2019-08-27 18:29:32.424861+0800 ****[7943:2204876] <Google/Utilities/Network/ERROR> Encounter network error. Code, error: -1005, Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={_kCFStreamErrorCodeKey=54, NSUnderlyingError=0x281ad5710 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=54, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <8241006A-08BE-4E66-A147-453C49615379>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalUploadTask <8241006A-08BE-4E66-A147-453C49615379>.<1>"
), NSLocalizedDescription=网络连接已中断。, NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorFailingURLKey=https://play.googleapis.com/log, _kCFStreamErrorDomainKey=1}

2019-08-27 18:29:32.727468+0800 ****[7943:2205044] 6.5.0 - [Firebase/RemoteConfig][I-RCN000020] Failed to register InstanceID with error : Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={NSUnderlyingError=0x281acccc0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=54, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://device-provisioning.googleapis.com/checkin, NSErrorFailingURLKey=https://device-provisioning.googleapis.com/checkin, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=54, NSLocalizedDescription=网络连接已中断。}.

2019-08-27 18:29:32.727646+0800 ****[7943:2205044] 6.5.0 - [GULNetwork][I-NET901017] <Google/Utilities/Network/ERROR> Encounter network error. Code, error: -1005, Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={_kCFStreamErrorCodeKey=54, NSUnderlyingError=0x281ad5710 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=54, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <8241006A-08BE-4E66-A147-453C49615379>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalUploadTask <8241006A-08BE-4E66-A147-453C49615379>.<1>"
), NSLocalizedDescription=网络连接已中断。, NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorFailingURLKey=https://play.googleapis.com/log, _kCFStreamErrorDomainKey=1}

2019-08-27 18:29:32.777329+0800 ****[7943:2205010] 6.5.0 - [Firebase/Core][I-COR000020] Error posting to Clearcut: Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={_kCFStreamErrorCodeKey=54, NSUnderlyingError=0x281ad5710 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=54, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <8241006A-08BE-4E66-A147-453C49615379>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalUploadTask <8241006A-08BE-4E66-A147-453C49615379>.<1>"
), NSLocalizedDescription=网络连接已中断。, NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorFailingURLKey=https://play.googleapis.com/log, _kCFStreamErrorDomainKey=1}, with Status Code: 0
google-oss-bot commented 5 years ago

I found a few problems with this issue:

paulb777 commented 5 years ago

@luoyingli Thanks for the report. This looks like #3381. While we haven't been able to diagnose, this section of code was replaced in Firebase 6.6.0, so pod update will likely resolve the issue.

luoyingli commented 5 years ago

We have upgraded Firebase to 6.7.0, and in the case of DebugView debug mode, there is also uploading data, but there is still a network outage in the console log. Does this have anything to do with active users? The following are active users, DebugView, and console logs.

active users screenshot

DebugView screenshot

console logs


2019-08-28 14:22:42.209086+0800 ****[8243:2275509] 6.7.0 - [Firebase/Performance][I-PRF200004] Trace feature is disabled.
2019-08-28 14:22:42.215419+0800 ****[8243:2275509] 6.7.0 - [Firebase/Performance][I-PRF900002] Session Id generated - 21c1360dd18c424baa1f188cf81037fa
2019-08-28 14:22:45.601124+0800 ****[8243:2275518] 6.7.0 - [Firebase/Core][I-COR000001] Configuring the default app.
2019-08-28 14:22:45.609555+0800 ****[8243:2275518] 6.7.0 - [Firebase/Core][I-COR000033] Data Collection flag is not set.
2019-08-28 14:22:45.796775+0800 ****[8243:2275509] 6.7.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-08-28 14:22:45.799038+0800 ****[8243:2275509] 6.7.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-08-28 14:22:45.803575+0800 ****[8243:2275509] 6.7.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-08-28 14:22:45.804988+0800 ****[8243:2275509] 6.7.0 - [Firebase/InstanceID][I-IID009000] No keypair info is found with tag com.google.iid-|K|
2019-08-28 14:22:45.805350+0800 ****[8243:2275509] 6.7.0 - [Firebase/InstanceID][I-IID009006] There's no legacy keypair so no need to do migration.
2019-08-28 14:22:45.805745+0800 ****[8243:2275509] 6.7.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-08-28 14:22:45.810401+0800 ****[8243:2275509] 6.7.0 - [Firebase/Performance][I-PRF100009] Recording trace: _p
2019-08-28 14:22:45.810837+0800 ****[8243:2275509] 6.7.0 - [Firebase/Performance][I-PRF300005] URL length exceeds limits, truncating recorded URL - https://nim.qiyukf.com/webapi/user/da/config.
2019-08-28 14:22:45.822599+0800 ****[8243:2275509] 6.7.0 - [Firebase/RemoteConfig][I-RCN000062] Loading database at path /var/mobile/Containers/Data/Application/066ED2A7-D831-42DA-BF5C-6CB977DBCBB9/Library/Application Support/Google/RemoteConfig/RemoteConfig.sqlite3
2019-08-28 14:22:45.824163+0800 ****[8243:2275509] 6.7.0 - [Firebase/RemoteConfig][I-RCN000039] Starting requesting token.
2019-08-28 14:22:45.825413+0800 ****[8243:2275509] 6.7.0 - [Firebase/InstanceID][I-IID007006] Checkin parameters: {
2019-08-28 14:22:45.840346+0800 ****[8243:2275523] 6.7.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60101000 started
2019-08-28 14:22:45.840724+0800 ****[8243:2275523] 6.7.0 - [Firebase/Analytics][I-ACS023008] To disable debug logging set the following application argument: -noFIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2019-08-28 14:22:45.842007+0800 ****[8243:2275523] 6.7.0 - [Firebase/Analytics][I-ACS023009] Debug logging enabled
2019-08-28 14:22:45.874365+0800 ****[8243:2275509] 6.7.0 - [Firebase/Analytics][I-ACS029014] Successfully parsed a configuration. Version: 1566888572150691
2019-08-28 14:22:45.875023+0800 ****[8243:2275509] 6.7.0 - [Firebase/Analytics][I-ACS023016] Analytics is ready to receive events
2019-08-28 14:22:45.885446+0800 ****[8243:2275525] 6.7.0 - [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2019-08-28 14:22:45.887725+0800 ****[8243:2275518] 6.7.0 - [Firebase/Analytics][I-ACS023024] No data to upload. Upload task will not be scheduled
2019-08-28 14:22:45.888117+0800 ****[8243:2275518] 6.7.0 - [Firebase/Analytics][I-ACS023012] Analytics enabled

2019-08-28 14:22:46.244725+0800 ****[8243:2275518] 6.7.0 - [Firebase/InstanceID][I-IID007000] Device checkin HTTP fetch error. Error Code: -1005

2019-08-28 14:22:46.247709+0800 ****[8243:2275518] 6.7.0 - [Firebase/InstanceID][I-IID005003] Failed to checkin device Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={NSUnderlyingError=0x280c78420 {Error Domain=kCFErrorDomain2019-08-28 14:22:48.538040+0800 AiJia[8243:2275538] 6.7.0 - [Firebase/Performance][I-PRF300005] URL length exceeds limits, truncating recorded URL - https://lbs.netease.im/lbs/conf.jsp._

2019-08-28 14:22:48.538163+0800 AiJia[8243:2275538] 6.7.0 - [Firebase/Performance][I-PRF300005] URL length exceeds limits, truncating recorded URL - https://wanproxy.127.net/lbs.

2019-08-28 14:22:48.542158+0800 AiJia[8243:2275570] 6.7.0 - [Firebase/Performance][I-PRF100009] Recording network trace: https://api.sit.ihomefnt.org/log/addOperationLog

2019-08-28 14:22:48.762668+0800 AiJia[8243:2275508] 6.7.0 - [Firebase/RemoteConfig][I-RCN000020] Failed to register InstanceID with error : Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={NSUnderlyingError=0x280c78420 {Error D2019-08-28 14:22:48.765379+0800 AiJia[8243:2275508] 6.7.0 - [Firebase/InstanceID][I-IID005004] Checkin is in progress_

2019-08-28 14:22:48.765700+0800 ****[8243:2275508] 6.7.0 - [Firebase/Performance][I-PRF100009] Recording network trace: https://nim.qiyukf.com/webapi/user/da/config

2019-08-28 14:22:48.766003+0800 ****[8243:2275508] 6.7.0 - [Firebase/InstanceID][I-IID007006] Checkin parameters: {
2019-08-28 14:22:49.052477+0800 ****[8243:2275572] 6.7.0 - [Firebase/InstanceID][I-IID007000] Device checkin HTTP fetch error. Error Code: -1005

_2019-08-28 14:22:49.053008+0800 ****[8243:2275572] 6.7.0 - [Firebase/InstanceID][I-IID005003] Failed to checkin device Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={NSUnderlyingError=0x280c09080 {Error Domain=kCFErrorDomain2019-08-28 14:22:49.062715+0800 AiJia[8243:2275572] 6.7.0 - [Firebase/RemoteConfig][I-RCN000023] Failed to fetch checkin info: Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={NSUnderlyingError=0x280c09080 {Error Domain=kCFErro2019-08-28_ 

14:22:49.062891+0800 AiJia[8243:2275572] 6.7.0 - [Firebase/RemoteConfig][I-RCN000060] Fetch with user properties completed.
2019-08-28 14:22:49.078117+0800 ****[8243:2275536] 6.7.0 - [Firebase/Performance][I-PRF100009] Recording network trace: https://lbs.netease.im/lbs/conf.jsp
2019-08-28 14:22:49.089836+0800 ****[8243:2275536] 6.7.0 - [Firebase/Performance][I-PRF100009] Recording network trace: https://api.sit.ihomefnt.org/push/pullPersonalMessageList
2019-08-28 14:22:49.092338+0800 ****[8243:2275536] 6.7.0 - [Firebase/Analytics][I-ACS033003] Scheduling user engagement timer
2019-08-28 14:22:49.092484+0800 ****[8243:2275536] 6.7.0 - [Firebase/Analytics][I-ACS002002] Engagement timer scheduled to fire in approx. (s): 3600
2019-08-28 14:22:49.097244+0800 ****[8243:2275573] 6.7.0 - [Firebase/RemoteConfig][I-RCN000061] Fetch with user properties initiated.
2019-08-28 14:22:49.097757+0800 ****[8243:2275573] 6.7.0 - [Firebase/RemoteConfig][I-RCN000040] Start config fetch.
2019-08-28 14:22:49.099575+0800 ****[8243:2275573] 6.7.0 - [Firebase/RemoteConfig][I-RCN000061] Making remote config fetch.
2019-08-28 14:22:49.099997+0800 ****[8243:2275573] 6.7.0 - [Firebase/RemoteConfig][I-RCN000046] Making config request: https://firebaseremoteconfig.googleapis.com/v1/projects/aijia-de6f0/namespaces/fireperf:fetch?key=AIzaSyBU6shFDoN4twTWNFXvMgKTYKwaiZFjkc0
2019-08-28 14:22:49.101699+0800 ****[8243:2275573] 6.7.0 - [Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: auto, screen_view (_vs), {
2019-08-28 14:22:49.355939+0800 ****[8243:2275525] 6.7.0 - [Firebase/Performance][I-PRF300005] URL length exceeds limits, truncating recorded URL - https://firebaseremoteconfig.googleapis.com/v1/projects/aijia-de6f0/namespaces/fireperf:fetch.

2019-08-28 14:22:49.357667+0800 ****[8243:2275525] 6.7.0 - [Firebase/InstanceID][I-IID003009] Failed to fetch default token Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={NSUnderlyingError=0x280c09080 {Error Domain=kCFErrorD2019-08-28 14:22:49.360450+0800 ****[8243:2275525] 6.7.0 - [Firebase/Performance][I-PRF100009] Recording network trace: https://wanproxy.127.net/lbs_

2019-08-28 14:22:49.360870+0800 ****[8243:2275525] 6.7.0 - [Firebase/Performance][I-PRF300005] URL length exceeds limits, truncating recorded URL - https://firebaseremoteconfig.googleapis.com/v1/projects/aijia-de6f0/namespaces/fireperf:fetch.
2019-08-28 14:22:49.363076+0800 ****[8243:2275525] 6.7.0 - [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: RDVTabBarController, -6038296090521122426
paulb777 commented 5 years ago

From the log, this looks like an InstanceID problem, perhaps related to the network or particular device. Does it happen on multiple devices?

luoyingli commented 5 years ago

According to the data of ios on the firebase statistical platform, it should be a common phenomenon. The ios data collected every day now has only a few user data.

xiamingyu commented 5 years ago

same problem,we use both google analytics sdk and firebase sdk,and ios data collected has few user data near days,is there any infuence? android runs well,and a few days ago, ios runs well too.

xiamingyu commented 5 years ago

From the log, this looks like an InstanceID problem, perhaps related to the network or particular device. Does it happen on multiple devices?

maybe you should test sdk use in China

morganchen12 commented 5 years ago

@luoyingli, @xiamingyu, are you able to reproduce on device locally? Can you confirm that it occurs only in China?

xiamingyu commented 5 years ago

are you able to reproduce on device locally

yes,stable reproduce,but i cannot confirm that it occurs only in China,i guess it‘s probably the reason. we just update our react-native version and ios data was unable to upload.

xiamingyu commented 5 years ago

its works well in debugView ,but no data in release.and it also works well on android

xiamingyu commented 5 years ago

another clue is google analytics sdk also runs bad on ios . almost no data was uploaded in our latest version

morganchen12 commented 5 years ago

@xiamingyu, @luoyingli -- if you have a sample project that reproduces this issue, can you send it to me?

google-oss-bot commented 5 years ago

Hey @luoyingli. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 5 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@luoyingli if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.