Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" Firebase Storage iOS

Viewed 657

I am uploading files to FirebaseStorage and i am getting this error on iOS :

Task <24E18897-20B7-45FD-9621-85FF09DC6326>.<1> finished with error [-1017] Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" UserInfo={_kCFStreamErrorCodeKey=-1, _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundUploadTask <24E18897-20B7-45FD-9621-85FF09DC6326>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "BackgroundUploadTask <24E18897-20B7-45FD-9621-85FF09DC6326>.<1>",
    "LocalUploadTask <24E18897-20B7-45FD-9621-85FF09DC6326>.<1>"
), NSLocalizedDescription=cannot parse response, _kCFStreamErrorDomainKey=4, NSErrorFailingURLStringKey=https://firebasestorage.googleapis.com/v0/b/mybucket/o/user%2FNyq7dMqe1kcAZ77R1YwH5fsAkV83%2Fcontent%2F43aa2d41-7a19-11ec-bd39-85fcd9d025?uploadType=resumable&name=user%2FNqe1kcAZ77R1YwH5fsAkV83%2Fcontent%2F43aa2d41-7a19-11ec-bd39-8508fcd025&upload_id=ADPycdv0-OYZPx3zAGzLrn25ZdI9srgkgABHGKb_1fCqUO7AAPHsZTkz_iVX1NfuYQsn0LHgCCiOsSzhLiP4Ho7VynSf_ceJJw&upload_protocol=resumable, NSErrorFailingURLKey=https://firebasestorage.googleapis.com/v0/b/mybucket/o/user%2FNyqMqe1kcAZ77R1YwH5fsAkV83%2Fcontent%2F43aa2d41-7a19-11ec-bd39-8508fcd9d025?uploadType=resumable&name=user%2FNyq7dMqe1kcAZ77R1YwH5V83%2Fcontent%2F432d41-7a19-11ec-bd39-8508f9d025&upload_id=ADPycdv0-OYZPx3zAGzLrn25ZdI9srgkgABHGKb_1fCqUO7AAPHsZTkz_iVX1NfuYQsn0LHgCCiOsSzhLiP4Ho7VynSf_ceJJw&upload_protocol=resumable}
GTMSessionFetcher invoking fetch callbacks, data (null), error Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" UserInfo={_kCFStreamErrorCodeKey=-1, _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundUploadTask <24E18897-20B7-45FD-9621-85FF09DC6326>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "BackgroundUploadTask <24E18897-20B7-45FD-9621-85FF09DC6326>.<1>",
    "LocalUploadTask <24E18897-20B7-45FD-9621-85FF09DC6326>.<1>"
), NSLocalizedDescription=cannot parse response, _kCFStreamErrorDomainKey=4, NSErrorFailingURLStringKey=https://firebasestorage.googleapis.com/v0/b/mybucket/o/users%2FNyq7dMqe1kcAZ77R1YwH5fsAkV83%2Fcontent%2F43aa2d41-7a19-11ec-bd39-8508fcd9d025?uploadType=resumable&name=users%2FNyq7dMqe1kcAZ77R1YwH5fsAkV83%2Fposts%2F43aa2d41-7a19-11ec-bd39-8508fcd9d025s&upload_id=ADPycdv0-OYZPx3zAGzLrn25ZdI9srgkgABHGKb_1fCqUO7AAPHsZTkz_iVX1NfuYQsn0LHgCCiOsSzhLiP4Ho7VynSf_ceJJw&upload_protocol=resumable, NSErrorFailingURLKey=https://firebasestorage.googleapis.com/v0/b/mybucket/o/user%2FNyq7dMqe1kcAZ77R1YwH5fsAkV83%2Fcontent%2F43aa2d41-7a19-11ec-bd39-8508fcd9d025-low_res?uploadType=resumable&name=user%2FNyq7dMqe1kcAZ77R1YwH5fsAkV83%2Fposts%2F43aa2d41-7a19-11ec-bd39-8508f&upload_id=ADPycdv0-OYZPx3zAGzLrn25ZdI9srgkgABHGKb_1fCqUO7AAPHsZTkz_iVX1NfuYQsn0LHgCCiOsSzhLiP4Ho7VynSf_ceJJw&upload_protocol=resumable}

This result in a [firebase_storage/unknown] An unknown error occurred, please check the server response.
But this time i can see the iOS failure, not the server response unfortunately...

So what does Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" mean and how to fix it please ?

Note : I have seen this question but it's not really something i can fix myself as i am using the Firebase iOS SDK...

EDIT :

I have opened an issue and a case in Firebase Support to get more information about this as no one seem to have some for now unfortunately.
This is probably a bug server-side as i can't reproduce it 100% of the time and the error is also not useful for debug.

EDIT 2 :

Firebase support was able to reproduce this issue with quite low internet connections, but in my case this happens also with normal connectivity.
I have also set the metadata specifying the content-type to avoid an extra "parsing" server side but it didn't change anything unfortunately.

1 Answers

I have same problem.
But I got it why occured this problem.
Maybe,this problem is occured by weakly network level.
If you want to reproduce this problem,Please Use "Network Link Conditioner.prefPane" in "Hardware" of "Additional tools for Xcode"
Additional tools for Xcode Download link

I could reproduce below settings.

Downlink Bandwidth: 10 Kbps
Downlink Packets Dropped: 5 %
Downlink Delay: 440 ms

Uplink Bandwidth: 10 Kbps
Uplink Packets Dropped: 5 %
Uplink Delay: 440 ms

DNS Delay: NO SET VALUE

It setting could add by manage profiles.
Good Luck, and I apporogy my English.

Related