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

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.

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

NSConnection throwing 303 error after large data POST

ERROR: Error Domain=kCFErrorDomainCFNetwork Code=303 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 303.)" UserInfo=0x1cd24f40 {NSErrorFailingURLKey=http://test.com/test/, NSErrorFailingURLStringKey=http://test.com/test/}
I can POST without an attachment and it wont break but as soon as I attach an image and POST it all other requests after that fail with 303 error. If I restart the App everything works again until I post another image.
To clarify the post works fine, the image is uploaded correctly and returns.

Facebook error: Encountered an error while processing the request: 502 Error parsing server response. Got EOF while waiting for outstanding responses

Today I started receiving errors from Facebook when my app tries to post a message.
The app successfully authorised, Facebook message window pops up, everything looks fine (links, pics, description) , but when I press post. it times out with this message
Encountered an error while processing the request: 502 Error parsing server response. Got EOF while waiting for outstanding responses Please try resending your request. This is probably not a bug in proxygen. Based on experience, either intern or latest is temporarily down due to a SEV or push. Please check in e FYI or #e first. If the error persists through retries, or if you have good reason to suspect this is a bug in proxygen, please report the issue to ti-bugs#lists or #ti with the following debug information: 2012-05-20 22:24:40 slb010.02.snc5 1585267068836963531
UPDATE: It is a Facebook issue. There is an opened and assigned bug report here You can subscribe there to follow the process.
It looks like Facebook fixed the issue. My apps work fine.
If you still experience the same problem, you can check out the progress here: http://developers.facebook.com/bugs/411849912170144?browse=search_4fb9fb43db2468a28526107
If this issue comes up again check whether there is an already submitted bug here: http://developers.facebook.com/bugs/ if there isn't submit one

NSCocoaErrorDomain Code=256

I have been stuck with this for a while and don't seem to get around this.
I am trying to read the contents of an URL as a string from an URL, But i get a weird
Error -> Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)"
My code :
fetchedString = [[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:#"www.example.com/iphone"] encoding:NSUTF8StringEncoding error:&error];
NSLog(#"%#",fetchedString);
// if there is something wrong with the URL
if (error) {
NSLog(#"Error -> %#", error);
return ;
}
What am I doing wrong? I tried using getting as NSData as well, but I get null back.
Yes, the URL is missing the scheme: "http://".
"Error -> Error Domain=NSCocoaErrorDomain Code=256"
For the error code check the Apple documentation:
NSError codes in the Cocoa error domain.
NSFileReadUnknownError = 256,
NSFileReadUnknownError
"Read error, reason unknown"
Not that the error definition is very helpful. :-)
Also do not check if error is nil to determine if there is an error, check the return value for nil. error is not guaranteed to be nil on successful execution.
I had a similar problem accessing files located on my device. I followed NSURL isFileURL always returns NO
and used [NSURL fileURLWithPath] instead of [NSURL URLWithString] - this worked!
I got this error (Error Domain=NSCocoaErrorDomain Code=256) as soon as our ssl certificate expired. that may not help you but could help someone else.
Sandboxing
If you're using sandboxing in your app, you might want to check that com.apple.security.network.client is set to YES. It's in the the General tab of your Target in Xcode 5 under
Network: Outgoing Connections (Client)
Also be aware that if you see a code 257 when trying to reach a file:/// url, that's also probably because of sandboxing, but this time rather the File Access part. Because I didn't want to open it to anything else than `com.apple.security.files.user-selected.read-write'
User selected files
I preferred to use A Dead Simple Fileserver and use http://localhost:3000 when in Debug mode.
More reasons that might be causing this specific error:
SSL is misconfigured on the server
The server redirects (301) the http URL to https (see #1)
App transport security also uses this code for blocked requests.
I got the same error. The above marked answer is perfect. But in my case, I had the "http://" in the url but had to add the port number in the url request since there is a service running on a specific port that is actually responding to your request.
#"http://example.com:8084/yyy.zzz"
I got the same error, the above solution didn't work for me, in my case i was calling dataWithContentsOfURL from within a UNNotificationServiceExtension so i had to update the info.plist file of the UNNotificationServiceExtension with the app transport security entries.

How to remove request url error from twitter apis in iphone

I am integrating twitter api in my application.
When I am trying to tweet I am getting an error:
Request A2C3E4D7-D3E8-47AD-A47C-3AC0DF2975A7 failed with error: Error Domain=HTTP Code=401 The operation couldn’t be completed. (HTTP error 401.)
I saw there is function defined with sendUpdate name. It is looking for parameter updateID and it is having zero (0) value all time. I am supposing this is occurring due to zero value in updateID.
Please help me. How to update in twitter from iPhone application. My consumerkey and consumersecretkey is right.
Thanks

is this problem from LinkedIn-API, or my code?

I use LinkedIn-iPhone API to update LinkedIn status, which worked for several times, but most times it does not work well, and it has never worked for the last 5 days. I don't know whether it is the problem of the LinkedIn web site or API connections.
The console log:
++ LinkedIn engine reports failure for connection
98A66D65-A8EB-4ADF-9B03-76EA54AE5DAE
The operation couldn’t be completed.
(HTTP error 400.), error: Error
Domain=HTTP Code=400 "The operation
couldn’t be completed. (HTTP error
400.)"
Is the error from the unstable LinkedIn API? or my code?
Silly me, I found the problem of HTTP error 400, which means: Duplicate updates. I changed the message for updating then it works fine.
Not sure whether moderator should delete this post or not? or how do I close it?