firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Firestore networking error when reading but is able to write documents

Open aashishpatil opened this issue 1 year ago • 29 comments

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!

aashishpatil avatar Sep 16 '24 07:09 aashishpatil