Firestore networking error when reading but is able to write documents
Description
When trying to read documents in a collection or setting up a listener, I am getting a networking error. However, I am able to write and create docs so network is available. I see the created docs via the console.
Read error occurs on both simulator (iPhone 17.5) and device (iPad 18.1 Beta)
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1726469557.131855 4311892 config.cc:230] gRPC experiments enabled: call_status_override_on_cancellation, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
Error get collectionSnapshot for mycollection (null)
NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed
nw_endpoint_flow_failed_with_error [C3 2607:f8b0:4005:806::200a.443 failed parent-flow (unsatisfied (No network route), ipv4, dns)] already failing, returning
nw_connection_get_connected_socket_block_invoke [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection
TCP Conn 0x302011220 Failed : error 0:50 [50]
I0000 00:00:1726469557.819759 4311922 subchannel.cc:806] subchannel 0x105257c00 {address=ipv6:%5B2607:f8b0:4005:806::200a%5D:443, args={grpc.client_channel_factory=0x3013178d0, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x30352c960, grpc.internal.client_channel_call_destination=0x102d9f4a8, grpc.internal.event_engine=0x301332490, grpc.internal.security_connector=0x303f08b80, grpc.internal.subchannel_pool=0x303a111f0, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x301fa8720, grpc.server_uri=dns:///firestore.googleapis.com}}: connect failed (UNKNOWN:(domain:NSPOSIXErrorDomain, code:50, description:The operation couldn’t be completed. Network is down) {grpc_status:2, created_time:"2024-09-15T23:52:37.81969-07:00", file_line:150, file:"/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/ZipRelease/2024-07-25T04-01-28/project-ios/Pods/gRPC-Core/src/core/lib/transport/error_utils.cc"}), backing off for 994 ms
Found a Stackoverflow thread reporting exact same issue as mine -> https://stackoverflow.com/questions/78929426/swiftui-with-firebasefirestore
Reproducing the issue
It's a very basic project that writes a document to a one level collection and then tries to read an array of docs from that collection and tries to setup a snapshot listener.
Firebase SDK Version
11.2.0
Xcode Version
15.4
Installation Method
Swift Package Manager
Firebase Product(s)
Firestore
Targeted Platforms
iOS
Relevant Log Output
No response
If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!
Hi @aashishpatil, thank you for reporting this issue. Could you please try these?
- Set logLevel to "kLogLevelDebug" and run the app again
- Check firestore rules, is there any rules that could forbid reading?
- Provide a minimal repro app, it would be easier if we can reproduce the bug at our end
- Is the error happening in each run or intermittently?
- Could this be simulator/device specific: Xcode 14 vs 15, iOS vs ipadOS, alpha vs beta?
Hey @aashishpatil. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 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!
I am facing similar issue.
Same Thing
nw_endpoint_flow_failed_with_error [C1 2607:f8b0:4007:813::200a.443 failed parent-flow (unsatisfied (No network route), ipv4, dns)] already failing, returning
nw_connection_get_connected_socket_block_invoke [C1] Client called nw_connection_get_connected_socket on unconnected nw_connection
TCP Conn 0x30340ea80 Failed : error 0:50 [50]
Hi @aashishpatil, thank you for reporting this issue. Could you please try these?
- Set logLevel to "kLogLevelDebug" and run the app again
- Check firestore rules, is there any rules that could forbid reading?
- Provide a minimal repro app, it would be easier if we can reproduce the bug at our end
- Is the error happening in each run or intermittently?
- Could this be simulator/device specific: Xcode 14 vs 15, iOS vs ipadOS, alpha vs beta?
Here is the log after setting debug.
There aren't any rules - confirmed. It's able to write successfully but a read immediately after fails with the network error which is odd since write just worked.
Error is consistently happening.
Environment: (I've updated since my original comment) Xcode 16, iPhone Sim iOS 18.0. Firebase 11.3.0
(Error log was captured before update but same issue happens even after update)
having same issue
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1727865214.199402 2103817 config.cc:230] gRPC experiments enabled: call_status_override_on_cancellation, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
nw_endpoint_flow_failed_with_error [C1 2607:f8b0:4023:1004::5f.443 failed parent-flow (unsatisfied (No network route), ipv4, dns)] already failing, returning
nw_connection_get_connected_socket_block_invoke [C1] Client called nw_connection_get_connected_socket on unconnected nw_connection
TCP Conn 0x303edef80 Failed : error 0:50 [50]
I0000 00:00:1727865214.721636 2103867 subchannel.cc:806] subchannel 0x1091ab000 {address=ipv6:%5B2607:f8b0:4023:1004::5f%5D:443, args={grpc.client_channel_factory=0x300de84c0, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x302bf1b60, grpc.internal.client_channel_call_destination=0x105c24328, grpc.internal.event_engine=0x300de88a0, grpc.internal.security_connector=0x3021d8d80, grpc.internal.subchannel_pool=0x3024f6530, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x3001700f0, grpc.server_uri=dns:///firestore.googleapis.com}}: connect failed (UNKNOWN:(domain:NSPOSIXErrorDomain, code:50, description:The operation couldn’t be completed. Network is down) {file:"/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/ZipRelease/2024-07-25T04-01-28/project-ios/Pods/gRPC-Core/src/core/lib/transport/error_utils.cc", file_line:150, created_time:"2024-10-02T03:33:34.72014-07:00", grpc_status:2}), backing off for 500 ms
I0000 00:00:1727865215.266836 2103865 subchannel.cc:761] subchannel 0x1091ab000 {address=ipv6:%5B2607:f8b0:4023:1004::5f%5D:443, args={grpc.client_channel_factory=0x300de84c0, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x302bf1b60, grpc.internal.client_channel_call_destination=0x105c24328, grpc.internal.event_engine=0x300de88a0, grpc.internal.security_connector=0x3021d8d80, grpc.internal.subchannel_pool=0x3024f6530, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x3001700f0, grpc.server_uri=dns:///firestore.googleapis.com}}: backoff delay elapsed, reporting IDLE
Environment: Xcode 16, Firebase 11.3.0. Checked on iphone 15, 16, ios 17, 18. Same issue everywhere both in simulator and on physical device
Same issue is happening for both simulator and OS device, on different versions, I think we can rule them out.
Out of curiosity, is this happening to SDK version 10.x.x as well? So far, it is reported on 11.2.0 and 11.3.0
Log has showed that the network is connected and the app have been receiving responses from backend. However, no docs has been sent over.
I am unable to reproduce the same error on my app. Could you please provide a minimal repro app?
To others who reported the same issue: Are you able to see the documents while receiving the erros, or no documents can be seen on the frontend at all?
Issue started appears in all 11.X versions starting with 11.0.0 Latest 10.X version does NOT have the issue Issue happens every time I start the app and the documents actually are loaded despite the errors Debug logs:
11.3.0 - [FirebaseCore][I-COR000001] Configuring the default app.
11.3.0 - [GoogleUtilities/AppDelegateSwizzler][I-SWZ001008] Successfully created App Delegate Proxy automatically. To disable the proxy, set the flag GoogleUtilitiesAppDelegateProxyEnabled to NO (Boolean) in the Info.plist
11.3.0 - [GoogleUtilities/SceneDelegateSwizzler][I-SWZ001114] Successfully created Scene Delegate Proxy automatically. To disable the proxy, set the flag GoogleUtilitiesAppDelegateProxyEnabled to NO (Boolean) in the Info.plist
11.3.0 - [FirebaseCore][I-COR000033] Data Collection flag is not set.
11.3.0 - [FirebaseFirestore][I-FST000001] Initializing. Current user: boucR3OCVAONBMD3Wk6FtIWjZPz1
11.3.0 - [FirebaseFirestore][I-FST000001] Using /var/mobile/Containers/Data/Application/9A281A34-DC37-4977-B1BA-063E51D7581D/Library/Application Support/firestore/__FIRAPP_DEFAULT/todo-app-7b13b/main for LevelDB storage
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Start LevelDB: 0 changes (0 bytes):>
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1727996131.509588 505470 config.cc:230] gRPC experiments enabled: call_status_override_on_cancellation, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Start MutationQueue: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Start IndexManager: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction migrate overlays: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Allocate target: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Re-using previous result from Timestamp(seconds=1727865155, nanoseconds=326931000) to execute query: Query(canonical_id=tasks|f:date==2024-10-03user_id==boucR3OCVAONBMD3Wk6FtIWjZPz1|ob:__name__asc)
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction ExecuteQuery: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (689c456f01) start
11.3.0 - [FirebaseAuth][I-AUT000002] Token auto-refresh enabled.
11.3.0 - [FirebaseAuth][I-AUT000004] Token auto-refresh scheduled in 18:53 for the new token.
11.3.0 - [FirebaseAuth][I-AUT000017] Has valid access token. Estimated expiration date:2024-10-03 23:19:23 +0000, current date: 2024-10-03 22:55:31 +0000
11.3.0 - [FirebaseFirestore][I-FST000001] Creating Firestore stub.
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) watch: <ListenRequest 0x16f45a460>: {
database: "projects/todo-app-7b13b/databases/(default)"
add_target {
query {
parent: "projects/todo-app-7b13b/databases/(default)/documents"
structured_query {
from {
collection_id: "tasks"
}
where {
composite_filter {
op: AND
filters {
field_filter {
field {
field_path: "date"
}
op: EQUAL
value {
string_value: "2024-10-03"
}
}
}
filters {
field_filter {
field {
field_path: "user_id"
}
op: EQUAL
value {
string_value: "boucR3OCVAONBMD3Wk6FtIWjZPz1"
}
}
}
}
}
order_by {
field {
field_path: "__name__"
}
direction: ASCENDING
}
}
}
resume_token: "\n\t\010\217\205\212\245\246\363\210\003"
target_id: 8
expected_count {
value: 1
}
}
}
nw_endpoint_flow_failed_with_error [C1 2607:f8b0:4023:1000::5f.443 failed parent-flow (unsatisfied (No network route), ipv4, dns)] already failing, returning
nw_connection_get_connected_socket_block_invoke [C1] Client called nw_connection_get_connected_socket on unconnected nw_connection
TCP Conn 0x300a58e60 Failed : error 0:50 [50]
I0000 00:00:1727996131.956341 505519 subchannel.cc:806] subchannel 0x10729a000 {address=ipv6:%5B2607:f8b0:4023:1000::5f%5D:443, args={grpc.client_channel_factory=0x30396c7e0, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x301f78d80, grpc.internal.client_channel_call_destination=0x103d0d128, grpc.internal.event_engine=0x30396cbc0, grpc.internal.security_connector=0x301569000, grpc.internal.subchannel_pool=0x301070a80, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x3035f5740, grpc.server_uri=dns:///firestore.googleapis.com}}: connect failed (UNKNOWN:(domain:NSPOSIXErrorDomain, code:50, description:The operation couldn’t be completed. Network is down) {grpc_status:2, created_time:"2024-10-03T15:55:31.954918-07:00", file_line:150, file:"/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/ZipRelease/2024-07-25T04-01-28/project-ios/Pods/gRPC-Core/src/core/lib/transport/error_utils.cc"}), backing off for 587 ms
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) headers (allowlisted): date: Thu, 03 Oct 2024 22:55:32 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) response: <ListenResponse 0x16f3ce640>: {
target_change {
target_change_type: ADD
target_ids: 8
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) headers (allowlisted): date: Thu, 03 Oct 2024 22:55:32 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) response: <ListenResponse 0x16f3ce640>: {
target_change {
resume_token: "\n\t\010\217\205\212\245\246\363\210\003"
read_time {
seconds: 1727995880
nanos: 571535000
}
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) headers (allowlisted): date: Thu, 03 Oct 2024 22:55:32 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) response: <ListenResponse 0x16f342640>: {
filter {
target_id: 8
count: 1
unchanged_names {
bits {
bitmap: "\263\367\000"
padding: 7
}
hash_count: 12
}
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) headers (allowlisted): date: Thu, 03 Oct 2024 22:55:32 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) response: <ListenResponse 0x16f342640>: {
target_change {
target_change_type: CURRENT
target_ids: 8
resume_token: "\n\t\010\231\327\232\235\247\363\210\003"
read_time {
seconds: 1727996132
nanos: 502425000
}
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) headers (allowlisted): date: Thu, 03 Oct 2024 22:55:32 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) response: <ListenResponse 0x16f342640>: {
target_change {
resume_token: "\n\t\010\231\327\232\235\247\363\210\003"
read_time {
seconds: 1727996132
nanos: 502425000
}
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Apply remote event: 1 changes (20 bytes):
- Put [target_global:] (20 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction NotifyLocalViewChanges: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (60405d0303) unwatch: <ListenRequest 0x16f342540>: {
database: "projects/todo-app-7b13b/databases/(default)"
remove_target: 8
}
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Release target: 2 changes (235 bytes):
- Put [target: target_id=8] (215 bytes)
- Put [target_global:] (20 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) headers (allowlisted): date: Thu, 03 Oct 2024 22:55:32 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (4093440301) response: <ListenResponse 0x16f3ce640>: {
target_change {
target_change_type: REMOVE
target_ids: 8
}
}
@AlexEzzeddine, still no docs being sent over. expected_count { value: 1} indicates that there is one doc in your persistence, so you might be reading it from the cache. Can you clear cache first, and try restarting the app?
here are the logs with cache cleared:
11.3.0 - [FirebaseCore][I-COR000001] Configuring the default app.
11.3.0 - [GoogleUtilities/AppDelegateSwizzler][I-SWZ001008] Successfully created App Delegate Proxy automatically. To disable the proxy, set the flag GoogleUtilitiesAppDelegateProxyEnabled to NO (Boolean) in the Info.plist
11.3.0 - [FirebaseFirestore][I-FST000001] Clearing persistence for path: /var/mobile/Containers/Data/Application/5A34AAAB-5368-4DAD-99A0-BFB4979ED8E1/Library/Application Support/firestore/__FIRAPP_DEFAULT/todo-app-7b13b/main
11.3.0 - [GoogleUtilities/SceneDelegateSwizzler][I-SWZ001114] Successfully created Scene Delegate Proxy automatically. To disable the proxy, set the flag GoogleUtilitiesAppDelegateProxyEnabled to NO (Boolean) in the Info.plist
11.3.0 - [FirebaseCore][I-COR000033] Data Collection flag is not set.
onchange new date: 2024-10-04
11.3.0 - [FirebaseFirestore][I-FST000001] Initializing. Current user: boucR3OCVAONBMD3Wk6FtIWjZPz1
11.3.0 - [FirebaseFirestore][I-FST000001] Using /var/mobile/Containers/Data/Application/5A34AAAB-5368-4DAD-99A0-BFB4979ED8E1/Library/Application Support/firestore/__FIRAPP_DEFAULT/todo-app-7b13b/main for LevelDB storage
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1728068987.120989 48436 config.cc:230] gRPC experiments enabled: call_status_override_on_cancellation, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Delete everything with prefix: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Delete everything with prefix: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Delete everything with prefix: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Delete everything with prefix: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Drop query cache: 2 changes (1 bytes):
- Put [target_global:] (0 bytes)
- Put [version:] (1 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Ensure sentinel rows: 1 changes (1 bytes):
- Put [version:] (1 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction remove acknowledged mutations: 1 changes (1 bytes):
- Put [version:] (1 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Ensure Collection Parents Index: 1 changes (1 bytes):
- Put [version:] (1 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Rewrite Targets Canonical Ids: 1 changes (1 bytes):
- Put [version:] (1 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Ensure overlay data migration is marked as required: 2 changes (1 bytes):
- Put [data_migration: data_migration_name=overlay_migration] (0 bytes)
- Put [version:] (1 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Start LevelDB: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Start MutationQueue: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Start IndexManager: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction migrate overlays: 1 changes (0 bytes):
- Delete [data_migration: data_migration_name=overlay_migration]>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Allocate target: 3 changes (180 bytes):
- Put [query_target: canonical_id=tasks|f:date==2024-10-04user_id==boucR3OCVAONBMD3Wk6FtIWjZPz1|ob:__name__asc target_id=2] (0 bytes)
- Put [target: target_id=2] (174 bytes)
- Put [target_global:] (6 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Using full collection scan to execute query: Query(canonical_id=tasks|f:date==2024-10-04user_id==boucR3OCVAONBMD3Wk6FtIWjZPz1|ob:__name__asc)
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction ExecuteQuery: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (685c496d01) start
11.3.0 - [FirebaseAuth][I-AUT000002] Token auto-refresh enabled.
11.3.0 - [FirebaseAuth][I-AUT000004] Token auto-refresh scheduled in 23:7 for the new token.
11.3.0 - [FirebaseAuth][I-AUT000017] Has valid access token. Estimated expiration date:2024-10-04 19:37:53 +0000, current date: 2024-10-04 19:09:47 +0000
11.3.0 - [FirebaseFirestore][I-FST000001] Creating Firestore stub.
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) watch: <ListenRequest 0x16d4965b0>: {
database: "projects/todo-app-7b13b/databases/(default)"
add_target {
query {
parent: "projects/todo-app-7b13b/databases/(default)/documents"
structured_query {
from {
collection_id: "tasks"
}
where {
composite_filter {
op: AND
filters {
field_filter {
field {
field_path: "date"
}
op: EQUAL
value {
string_value: "2024-10-04"
}
}
}
filters {
field_filter {
field {
field_path: "user_id"
}
op: EQUAL
value {
string_value: "boucR3OCVAONBMD3Wk6FtIWjZPz1"
}
}
}
}
}
order_by {
field {
field_path: "__name__"
}
direction: ASCENDING
}
}
}
target_id: 2
}
}
nw_endpoint_flow_failed_with_error [C1 2607:f8b0:4007:809::200a.443 failed parent-flow (unsatisfied (No network route), ipv4, dns)] already failing, returning
nw_connection_get_connected_socket_block_invoke [C1] Client called nw_connection_get_connected_socket on unconnected nw_connection
TCP Conn 0x3006bb200 Failed : error 0:50 [50]
I0000 00:00:1728068987.699584 48475 subchannel.cc:806] subchannel 0x15e264800 {address=ipv6:%5B2607:f8b0:4007:809::200a%5D:443, args={grpc.client_channel_factory=0x303594940, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x301384de0, grpc.internal.client_channel_call_destination=0x105cf9128, grpc.internal.event_engine=0x30359d9d0, grpc.internal.security_connector=0x30199d500, grpc.internal.subchannel_pool=0x301c8a840, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x303913f30, grpc.server_uri=dns:///firestore.googleapis.com}}: connect failed (UNKNOWN:(domain:NSPOSIXErrorDomain, code:50, description:The operation couldn’t be completed. Network is down) {grpc_status:2, created_time:"2024-10-04T12:09:47.697823-07:00", file_line:150, file:"/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/ZipRelease/2024-07-25T04-01-28/project-ios/Pods/gRPC-Core/src/core/lib/transport/error_utils.cc"}), backing off for 451 ms
I0000 00:00:1728068988.263918 48474 subchannel.cc:761] subchannel 0x15e264800 {address=ipv6:%5B2607:f8b0:4007:809::200a%5D:443, args={grpc.client_channel_factory=0x303594940, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x301384de0, grpc.internal.client_channel_call_destination=0x105cf9128, grpc.internal.event_engine=0x30359d9d0, grpc.internal.security_connector=0x30199d500, grpc.internal.subchannel_pool=0x301c8a840, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x303913f30, grpc.server_uri=dns:///firestore.googleapis.com}}: backoff delay elapsed, reporting IDLE
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) headers (allowlisted): date: Fri, 04 Oct 2024 19:09:48 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) response: <ListenResponse 0x16d8f6640>: {
target_change {
target_change_type: ADD
target_ids: 2
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) headers (allowlisted): date: Fri, 04 Oct 2024 19:09:48 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) response: <ListenResponse 0x16d37e640>: {
target_change {
target_change_type: CURRENT
target_ids: 2
resume_token: "\n\t\010\334\231\325\321\266\365\210\003"
read_time {
seconds: 1728068988
nanos: 521692000
}
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) headers (allowlisted): date: Fri, 04 Oct 2024 19:09:48 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) response: <ListenResponse 0x16d37e640>: {
target_change {
resume_token: "\n\t\010\334\231\325\321\266\365\210\003"
read_time {
seconds: 1728068988
nanos: 521692000
}
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Apply remote event: 2 changes (221 bytes):
- Put [target: target_id=2] (201 bytes)
- Put [target_global:] (20 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction NotifyLocalViewChanges: 0 changes (0 bytes):>
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) headers (allowlisted): date: Fri, 04 Oct 2024 19:09:48 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) response: <ListenResponse 0x16d8f6640>: {
filter {
target_id: 2
unchanged_names {
bits {
}
}
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) headers (allowlisted): date: Fri, 04 Oct 2024 19:09:48 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (9855430501) response: <ListenResponse 0x16d37e640>: {
target_change {
resume_token: "\n\t\010\361\301\332\321\266\365\210\003"
read_time {
seconds: 1728068988
nanos: 608753000
}
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Apply remote event: 1 changes (20 bytes):
- Put [target_global:] (20 bytes)>
11.3.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction NotifyLocalViewChanges: 0 changes (0 bytes):>
Update: the issue seems to be introduced by the SDK 11.0.0, where it have upgraded the gRPC version. This ticket is brought to related team's attention.
The issue is not reproducible locally. A minimal repro app will be greatly appreciated.
Hey @aashishpatil. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 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!
Since there haven't been any recent updates here, I am going to close this issue.
@aashishpatil 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.
Hi, I'm still experiencing the issue with Firebase 11.4.0 and gRPC 1.65.1.
Hi @michallangmajer, is it possible to provide a minimal repro app/code? I have tried locally, but cannot reproduce the issue.
Hi, don't you already have minimum repo, logs and everything else you need from previous conversation with other people? You mentioned here that you're also aware of the issue: https://github.com/firebase/firebase-ios-sdk/issues/13644#issuecomment-2397399940 I will try to put it together
Hi @michallangmajer, user has confirmed that the issue started at the version 11.0.0, which is the version that grpc dependency has been updated. Thus we are suspecting that it is the cause. But we haven't been able to reproduce and debug it at our end.
Hi, having the same issue, everything was working fine for a few days, and a day before yesterday it just stopped working throwing error every time. Tried to create small test app and download data there, it fails as well. WARNING: All log messages before absl::InitializeLog() is called are written to STDERR I0000 00:00:1732220814.999461 1947994 config.cc:230] gRPC experiments enabled: call_status_override_on_cancellation, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache nw_connection_get_connected_socket_block_invoke [C2] Client called nw_connection_get_connected_socket on unconnected nw_connection TCP Conn 0x30309c640 Failed : error 0:50 [50] I0000 00:00:1732220817.323491 1948026 subchannel.cc:806] subchannel 0x12de787a0 {address=ipv6:%5B2a00:1450:401b:800::200a%5D:443, args={grpc.client_channel_factory=0x3003a4b50, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x3025bc000, grpc.internal.client_channel_call_destination=0x106301ae8, grpc.internal.event_engine=0x3003a4f00, grpc.internal.security_connector=0x302fada80, grpc.internal.subchannel_pool=0x302a972c0, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x300f39e60, grpc.server_uri=dns:///firestore.googleapis.com}}: connect failed (UNKNOWN:(domain:NSPOSIXErrorDomain, code:50, description:The operation couldn’t be completed. Network is down) {grpc_status:2, created_time:"2024-11-21T21:26:57.320551+01:00", file_line:150, file:"/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/ZipRelease/2024-07-25T04-01-28/project-ios/Pods/gRPC-Core/src/core/lib/transport/error_utils.cc"}), backing off for 973 ms Total invoices after fetch: 0 Total invoices after fetch: 0 11.5.0 - [FirebaseFirestore][I-FST000001] WatchStream (98c739) Stream error: 'Unavailable: Network connectivity changed' Have no idea what has gone south.
@Dmy-Volokhovskyi, could you please share your test app and repro steps via github repository?
@milaGGL Has anyone attempted to reproduce it?
I just created a project from scratch, initialized Firebase, and queried a document to reproduce it. https://github.com/wellen-ai/firestore-networking-error-repro/tree/main
Only thing missing is the GoogleService-Info.plist
Here are the logs from the run, there are things there that i'm not sure would be relevant but perhaps they are. I added other Firebase dependencies to replicate my main project in case that had something to do with it.
11.6.0 - [FirebaseCore][I-COR000008] The project's Bundle ID is inconsistent with either the Bundle ID in 'GoogleService-Info.plist', or the Bundle ID in the options if you are using a customized options. To ensure that everything can be configured correctly, you may need to make the Bundle IDs consistent. To continue with this plist file, you may change your app's bundle identifier to 'com.welling.Welling'. Or you can download a new configuration file that matches your bundle identifier from https://console.firebase.google.com/ and replace the current one.
11.6.0 - [FirebaseMessaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
[Firebase/Crashlytics] Version 11.6.0
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1733589263.456774 19508955 config.cc:230] gRPC experiments enabled: call_status_override_on_cancellation, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
11.6.0 - [FirebaseFirestore][I-FST000001] AppCheck failed: 'The operation couldn’t be completed. The attestation provider DeviceCheckProvider is not supported on current platform and OS version.'
nw_endpoint_flow_failed_with_error [C1 2607:f8b0:400a:804::200a.443 failed parent-flow (unsatisfied (No network route))] already failing, returning
nw_connection_get_connected_socket_block_invoke [C1] Client called nw_connection_get_connected_socket on unconnected nw_connection
TCP Conn 0x60000330d400 Failed : error 0:50 [50]
I0000 00:00:1733589263.476689 19508995 subchannel.cc:806] subchannel 0x10352dc70 {address=ipv6:%5B2607:f8b0:400a:804::200a%5D:443, args={grpc.client_channel_factory=0x600000038ec0, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x600002613cc0, grpc.internal.client_channel_call_destination=0x1060f3ae8, grpc.internal.event_engine=0x600000005b20, grpc.internal.security_connector=0x600002c37180, grpc.internal.subchannel_pool=0x600002936140, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x600000ca6e50, grpc.server_uri=dns:///firestore.googleapis.com}}: connect failed (UNKNOWN:(domain:NSPOSIXErrorDomain, code:50, description:The operation couldn’t be completed. Network is down) {file:"/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/ZipRelease/2024-07-25T04-01-28/project-ios/Pods/gRPC-Core/src/core/lib/transport/error_utils.cc", file_line:150, created_time:"2024-12-07T08:34:23.476362-08:00", grpc_status:2}), backing off for 994 ms
nw_connection_copy_connected_local_endpoint_block_invoke [C3] Connection has no local endpoint
nw_connection_copy_connected_local_endpoint_block_invoke [C3] Connection has no local endpoint
11.6.0 - [FirebaseFirestore][I-FST000001] Listen for query at users/1 failed: Missing or insufficient permissions.
Hi @irwinb, thank you for providing a repro app. I will try reproduce the bug ASAP.
Having the same issue inside of a flutter application when triggering a background service with iOS. The background service is correctly triggered confirming that there is a network connection present, yet, fails when reading firestore
nw_endpoint_flow_failed_with_error [C18 2a00:1450:4009:80b::200a.443 failed parent-flow (unsatisfied (No network route), ipv4, dns)] already failing, returning nw_connection_get_connected_socket_block_invoke [C18] Client called nw_connection_get_connected_socket on unconnected nw_connection TCP Conn 0x3034ade00 Failed : error 0:50 [50] I0000 00:00:1735657344.386618 12504862 subchannel.cc:806] subchannel 0x13d4cd000 {address=ipv6:%5B2a00:1450:4009:80b::200a%5D:443, args={grpc.client_channel_factory=0x3007ac970, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x3021b9d40, grpc.internal.client_channel_call_destination=0x105d72e88, grpc.internal.event_engine=0x300708260, grpc.internal.security_connector=0x302bf0200, grpc.internal.subchannel_pool=0x302eaf250, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x300b736f0, grpc.server_uri=dns:///firestore.googleapis.com}}: connect failed (UNKNOWN:(domain:NSPOSIXErrorDomain, code:50, description:The operation couldn’t be completed. Network is down) {file:"/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/ZipRelease/2024-07-25T04-01-28/project-ios/Pods/gRPC-Core/src/core/lib/transport/error_utils.cc", file_line:150, created_time:"2024-12-31T15:02:24.386522+00:00", grpc_status:2}), backing off for 998 ms 11.4.0 - [FirebaseFirestore][I-FST000001] WatchStream (f81173) Stream error: 'Unavailable: Network connectivity changed'
@irwinb , I am still unable to reproduce the error, the app worked fine locally and successfully fetched the doc.
Same for me. Happen when run Listner
let db = Firestore.firestore()
self.listener = db.document(path).addSnapshotListener { document, error in
if let document, let data = document.data() {
handler(data)
} else {
handler(nil)
}
}
Hi @ivanvorobei, is it possible to provide a minimal repro app?
I encountered this same error message. In my case, the issue was that the name of the collection in my code didn’t match the one in Firestore. Make sure to carefully check the names of your collections and documents in Firestore before diving into more complex solutions. This could save you a lot of time.
following, getting same error
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1737353489.901726 32988 config.cc:230] gRPC experiments enabled: call_status_override_on_cancellation, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
gRPC experiments enabled: call_status_override_on_cancellation, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
I0000 00:00:1737353490.761902 33057 subchannel.cc:806] subchannel 0x110bebc00 {address=ipv6:%5B2607:f8b0:4006:80b::200a%5D:443, args={grpc.client_channel_factory=0x3032bde20, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x3014a95c0, grpc.internal.client_channel_call_destination=0x106a16568, grpc.internal.event_engine=0x3032ad8f0, grpc.internal.security_connector=0x301eb0200, grpc.internal.subchannel_pool=0x301b34540, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x303ff80f0, grpc.server_uri=dns:///firestore.googleapis.com}}: connect failed (UNKNOWN:(domain:NSPOSIXErrorDomain, code:50, description:The operation couldn’t be completed. Network is down) {grpc_status:2, created_time:"2025-01-20T01:11:30.759438-05:00", file_line:150, file:"/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/ZipRelease/2024-07-25T04-01-28/project-ios/Pods/gRPC-Core/src/core/lib/transport/error_utils.cc"}), backing off for 814 ms
subchannel 0x110bebc00 {address=ipv6:%5B2607:f8b0:4006:80b::200a%5D:443, args={grpc.client_channel_factory=0x3032bde20, grpc.default_authority=firestore.googleapis.com, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x3014a95c0, grpc.internal.client_channel_call_destination=0x106a16568, grpc.internal.event_engine=0x3032ad8f0, grpc.internal.security_connector=0x301eb0200, grpc.internal.subchannel_pool=0x301b34540, grpc.keepalive_time_ms=30000, grpc.primary_user_agent=grpc-c++/1.65.1, grpc.resource_quota=0x303ff80f0, grpc.server_uri=dns:///firestore.googleapis.com}}: connect failed (UNKNOWN:(domain:NSPOSIXErrorDomain, code:50, description:The operation couldn’t be completed. Network is down) {grpc_status:2, created_time:"2025-01-20T01:11:30.759438-05:00", file_line:150, file:"/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/ZipRelease/2024-07-25T04-01-28/project-ios/Pods/gRPC-Core/src/core/lib/transport/error_utils.cc"}), backing off for 814 ms
I have this error on swift package version 11.5.0
Oddly enough simulator successfully does a basic docs fetch but real device does not. Simulator produces same debug output WARNINGs so warnings might be a red herring
I tried using v10.29 and 11.7, no luck
private func setUpMarketListening() {
Task {
try! await Task.sleep(for: .seconds(2))
let x = try! await Firestore.firestore()
.collection("polymarket_markets")
.limit(to: 10)
.getDocuments()
log.debug("doc count: \(x.documents.count)") // 0
}
rules:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read: if true;
allow write: if request.auth != null && request.auth.token.admin == true;
}
}
}
Hi everyone, there is another issue ticket which is related to grpc version 1.65.x and hard to reproduce as well.
Could you please check your grpc version, and try locking it to others, as suggested on the other ticket, like 1.65.1, 1.65.6-pre1, or 1.65.6-pre2?
I thought the error would be resolved after 11.9.0, but no.
addSnapshotListener code:
func fetchData() {
if listenerRegistration == nil {
listenerRegistration = db.collection("items").addSnapshotListener { (querySnapshot, error) in
guard let documents = querySnapshot?.documents else {
print("No documents")
return
}
print("Mapping \(documents.count) documents")
self.items = documents.compactMap { (queryDocumentSnapshot) -> Item? in
do {
let item = try queryDocumentSnapshot.data(as: Item.self)
print("Document ID: \(queryDocumentSnapshot.documentID)")
print("Document data: \(queryDocumentSnapshot.data())")
return item
} catch {
print("Error decoding item: \(error)")
return nil
}
}
}
}
}
At first the program receives the document data, but then an error occurs. Log:
Mapping 4 documents
Document ID: S6erQgEEmkjGv7xBpUXF
Document data: ["dateCreated": <FIRTimestamp: seconds=1740529497 nanoseconds=486712000>, "deleted": 0, "isBought": 0, "text": 33333, "dateBought": <FIRTimestamp: seconds=1740529498 nanoseconds=76000000>]
Document ID: bg6tyzkXcbo2Qr7Nz6QP
Document data: ["dateCreated": <FIRTimestamp: seconds=1740530686 nanoseconds=986608000>, "deleted": 0, "isBought": 0, "text": Ggg, "dateBought": <FIRTimestamp: seconds=1740530687 nanoseconds=484000000>]
Document ID: fgkcHP30FixdiOTfYeAY
Document data: ["dateCreated": <FIRTimestamp: seconds=1740529482 nanoseconds=311438000>, "deleted": 0, "isBought": 0, "text": 111111, "dateBought": <FIRTimestamp: seconds=1740529483 nanoseconds=248000000>]
Document ID: q8ZVnEaqnsgQYB0cl0Zl
Document data: ["dateCreated": <FIRTimestamp: seconds=1740529494 nanoseconds=588560000>, "deleted": 0, "isBought": 0, "text": 22222, "dateBought": <FIRTimestamp: seconds=1740529495 nanoseconds=179000000>]
nw_endpoint_flow_failed_with_error [C2 2a00:1450:4010:c01::5f.443 failed parent-flow (unsatisfied (No network route))] already failing, returning
nw_connection_get_connected_socket_block_invoke [C2] Client called nw_connection_get_connected_socket on unconnected nw_connection
TCP Conn 0x60000330e800 Failed : error 0:50 [50]
Could the problem be that it is trying to use an ipv6 address (2a00:1450:4010:c01::5f.443)?