Skip to content

Firebase Storage / Vertex AI: HTTP3 failures (-1005, -1017) #14677

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
Kirow opened this issue Apr 8, 2025 · 6 comments
Open

Firebase Storage / Vertex AI: HTTP3 failures (-1005, -1017) #14677

Kirow opened this issue Apr 8, 2025 · 6 comments

Comments

@Kirow
Copy link

Kirow commented Apr 8, 2025

Description

I just moved from i9 Intel to Silicon M4. And now I see strange errors in my app during testing on files downloading. A lot of -1005 Connection Lost or -1017 cannot parse response with following lines like

nw_protocol_implementation_lookup_path [C38.1.1.2:2] No path found for 5410496762cbf3     <- com.apple.network
0x1178cf818 38 Server protocol violation 0x02                                             <- com.apple.cfnetwork h3connect
0x1178cf818 38 Control stream closed but connection is alive                              <- com.apple.cfnetwork h3connect

App iterate through the list of storage refs and tries to download (StorageReference.writeAsync(toFile:)) the file if it does not exist locally. Mostly it happens sequentially, sometimes a little bit in parallel. If file failed it will be moved to the end of queue and retries later. Failures happens on the same files multiple time and at some rare occasions it does download.

Error appears only on simulator on M4 laptop, it does work on old laptop and on real device. I've notice that simulator on M4 using http3, so I start proxy that does not support http3 - and it start working fine.

So my conclusion is that problem with HTTP3

I still investigating, but maybe someone will drop idea or solution to this problem.

Reproducing the issue

not available at this moment

Firebase SDK Version

11.11.0

Xcode Version

16.3 (16E140)

Installation Method

Swift Package Manager

Firebase Product(s)

Storage

Targeted Platforms

iOS

Relevant Log Output

MyCode.swift:46
 👀 Start downloading - 9bfjwHShMvRLjHJowCx7
11.11.0 - [FirebaseAuth][I-AUT000017] Has valid access token. Estimated expiration date:2025-04-08 18:28:36 +0000, current date: 2025-04-08 17:28:59 +0000
11.11.0 - [FirebasePerformance][I-PRF300005] URL length exceeds limits, truncating recorded URL - https://firebasestorage.googleapis.com:443/v0/b/******.appspot.com/o/PATH_TO_FILE_1.zip.
11.11.0 - [FirebasePerformance][I-PRF300005] URL length exceeds limits, truncating recorded URL - https://firebasestorage.googleapis.com:443/v0/b/******.appspot.com/o/PATH_TO_FILE_1.zip.
nw_connection_copy_connected_local_endpoint_block_invoke [C196] Connection has no local endpoint
nw_connection_copy_connected_local_endpoint_block_invoke [C196] Connection has no local endpoint
quic_conn_change_current_path [C196.1.1.1:2] [-e2ec972bce4de892] tried to change paths, but no alternatives were found
nw_connection_copy_connected_local_endpoint_block_invoke [C196] Connection has no local endpoint
nw_protocol_implementation_lookup_path [C196.1.1.1:2] No path found for 54fb7d625518029c
0x10a9d5e18 196 Server protocol violation 0x02
0x10a9d5e18 196 Control stream closed but connection is alive
nw_connection_copy_connected_local_endpoint_block_invoke [C198] Connection has no local endpoint
nw_connection_copy_connected_local_endpoint_block_invoke [C198] Connection has no local endpoint
quic_conn_change_current_path [C198.1.1.1:2] [-fc34761712275213] tried to change paths, but no alternatives were found
nw_connection_copy_connected_local_endpoint_block_invoke [C198] Connection has no local endpoint
nw_protocol_implementation_lookup_path [C198.1.1.1:2] No path found for 54ac50c7cc3bb4d
0x13b1af018 198 Server protocol violation 0x02
0x13b1af018 198 Control stream closed but connection is alive
nw_connection_copy_connected_local_endpoint_block_invoke [C200] Connection has no local endpoint
nw_connection_copy_connected_local_endpoint_block_invoke [C200] Connection has no local endpoint
quic_conn_change_current_path [C200.1.1.1:2] [-fcd7bf60df245c86] tried to change paths, but no alternatives were found
Task <02CDA635-F3B7-4625-970B-582603A62AD4>.<117> HTTP load failed, 2450/0 bytes (error code: -1017 [4:-1])
nw_connection_copy_connected_local_endpoint_block_invoke [C200] Connection has no local endpoint
nw_protocol_implementation_lookup_path [C200.1.1.1:2] No path found for d504b2162ebcddb1
Task <02CDA635-F3B7-4625-970B-582603A62AD4>.<117> finished with error [-1017] Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" UserInfo={_kCFStreamErrorCodeKey=-1, NSUnderlyingError=0x60000135c000 {Error Domain=kCFErrorDomainCFNetwork Code=-1017 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x6000064ad270 [0x1e6ebb4f0]>{length = 16, capacity = 16, bytes = 0x100201bb8efa4b0a0000000000000000}, _kCFStreamErrorCodeKey=-1, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <02CDA635-F3B7-4625-970B-582603A62AD4>.<117>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDownloadTask <02CDA635-F3B7-4625-970B-582603A62AD4>.<117>"
), NSLocalizedDescription=cannot parse response, NSErrorFailingURLStringKey=https://firebasestorage.googleapis.com:443/v0/b/******.appspot.com/o/PATH_TO_FILE_1.zip?alt=media, NSErrorFailingURLKey=https://firebasestorage.googleapis.com:443/v0/b/******.appspot.com/o/PATH_TO_FILE_1.zip?alt=media, _kCFStreamErrorDomainKey=4}
0x109881618 200 Server protocol violation 0x02
0x109881618 200 Control stream closed but connection is alive

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!
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@matej-io
Copy link

matej-io commented Apr 9, 2025

I got similar http3/QUIC issue on iOS simulator, specifically iOS v18.4, accessing storage.googleapis.com

@weakfl
Copy link

weakfl commented Apr 9, 2025

It's a bug in the 18.4 iOS simulator, see https://developer.apple.com/forums/thread/777999 for details.

@Kirow
Copy link
Author

Kirow commented Apr 9, 2025

Ok, thanks. I was focused on the fact that I changed desktop arch and have not notice that I have different iOS and Xcode.
Actually same problem on intel with 18.4 simulator and it does work correctly on the device with 18.4.
But truth to be told - I haven't checked whether the device uses http3 or not.

So meanwhile I will not use 18.4 simulator during testing.
But if I will need to use it
Is there any simple way to disable http3? maybe something to Info.plist or Firebase configuration itself?

In general problem is understood and seems to be not related to the Firebase. Probably could be closed.
I will leave this decision to the contributors.

@andrewheard andrewheard changed the title Firebase Storage: HTTP3 failures (-1005, -1017) Firebase Storage / Vertex AI: HTTP3 failures (-1005, -1017) Apr 10, 2025
@andrewheard
Copy link
Contributor

Thanks for the link, @weakfl. That thread pointed out a reasonable workaround that worked for the Vertex AI in Firebase SDK that was also impacted by this bug in URLSession (#14696).

@Kirow Unfortunately I'm not aware of any way to disable HTTP3. For now I'd recommend using the iOS 18.3.1 simulator from Xcode 16.2. I've been using the 18.3.1 simulator with Xcode 16.3 without any issues.

We'll also investigate whether a similar workaround to #14696 can be used in the Firebase Storage SDK but it depends on URLSession transitively, rather than directly, so we can't guarantee that it will work.

@ncooke3
Copy link
Member

ncooke3 commented May 19, 2025

The Xcode 16.4 release notes mention a fix to URLSession that look promising in addressing these errors: https://developer.apple.com/documentation/xcode-release-notes/xcode-16_4-release-notes#Simulator

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

No branches or pull requests

7 participants