Skip to content

Network connection lost error (-1005) on iOS Simulator using reCAPTCHA SDK #141

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

Open
rashidlatif55 opened this issue Apr 16, 2025 · 7 comments
Assignees

Comments

@rashidlatif55
Copy link

I'm integrating the reCAPTCHA Enterprise Mobile SDK into my iOS app. When running on the iOS Simulator, I consistently receive the error:

Full log:

nw_connection_copy_connected_local_endpoint_block_invoke [C23] Connection has no local endpoint
nw_connection_copy_connected_local_endpoint_block_invoke [C23] Connection has no local endpoint
quic_conn_change_current_path [C23.1.1.1:2] [-edd11e60723c5a73] tried to change paths, but no alternatives were found
nw_flow_service_writes Failing write request <nw_write_request> [57: Socket is not connected]
nw_write_request_report [C23] Send failed with error "Socket is not connected"
Task <F287C097-F14E-4D20-8ED4-5BDEDEB546F9>.<7> HTTP load failed, 134/0 bytes (error code: -1005 [4:-4])
nw_connection_copy_connected_local_endpoint_block_invoke [C23] Connection has no local endpoint
Task <F287C097-F14E-4D20-8ED4-5BDEDEB546F9>.<7> finished with error [-1005] Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=-4, NSUnderlyingError=0x600000ccec40 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x600002159c70 [0x1e6ebb4f0]>{length = 16, capacity = 16, bytes = 0x100201bb8efab5630000000000000000}, _kCFStreamErrorCodeKey=-4, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <F287C097-F14E-4D20-8ED4-5BDEDEB546F9>.<7>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <F287C097-F14E-4D20-8ED4-5BDEDEB546F9>.<7>"
), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=https://www.recaptcha.net/recaptcha/api3/mlg, NSErrorFailingURLKey=https://www.recaptcha.net/recaptcha/api3/mlg, _kCFStreamErrorDomainKey=4}
nw_protocol_implementation_lookup_path [C23.1.1.1:2] No path found for b074b290925e636
0x10d868818 23 Server protocol violation 0x02
0x10d868818 23 Control stream closed but connection is alive

What I’ve tried:

Would appreciate any guidance or workarounds on this. Happy to help debug further or provide test logs.

@walterjgsp
Copy link
Collaborator

walterjgsp commented Apr 17, 2025

Hi @rashidlatif55, thanks for creating the bug. Some questions so I can investigate this from my side. What's the Xcode version being used? Is this happening in a real device or just in the simulator? Is this error crashing your app and stopping you from using the SDK or is just a warning in the console log?

@josh150
Copy link

josh150 commented Apr 17, 2025

I've also been seeing this on some of my simulators (but my physical device has been fine) with Xcode 16.3. I created a new simulator running iOS 18.2 and that device is working for now. But existing simulators running iOS 18.4 have this behavior.

It is not a crash but it prevents the execute action request from working which means I cannot authenticate with my API.

If it helps, these simulators appear to be blocking most if not all third party requests. My logs are full of similar logs for Firebase, Sentry, and Heap. I tried adding tracking details to the privacy info file but that didn't appear to help.

@walterjgsp
Copy link
Collaborator

Seems related to https://developer.apple.com/forums/thread/777999.

@walterjgsp walterjgsp self-assigned this Apr 17, 2025
@rashidlatif55
Copy link
Author

@walterjgsp Thank you for the quick response!

Here are the details you asked for:

Xcode version: 16.3

Simulator version: 18.4

Device: The issue only occurs on the Simulator (18.4); it works fine on a real device.

I also downloaded the iOS 18.3 simulator, and the SDK works correctly there, no errors in the console and everything functions as expected.

The error does not crash the app, but it prevents authentication from completing, so the SDK is effectively unusable on the 18.4 simulator due to this issue.

Let me know if I can provide any additional info or logs to help with debugging. Thanks again for looking into this!

@loinsir
Copy link

loinsir commented Apr 18, 2025

I have the same problem with the same version

@mcorner
Copy link
Collaborator

mcorner commented Apr 18, 2025

More info here: firebase/firebase-ios-sdk#14728

@ernestofndz
Copy link

The problem is definitely on the 18.4 simulator. So far I haven't seen issues with Xcode 16.4 RC running on 18.5 simulator.

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

No branches or pull requests

6 participants