Closed ilijapuaca closed 6 years ago
Have you enabled keychain access for your app?
You mean Keychain Sharing? I wasn't aware that it would be necessary.
Either way, enabled it just now and re-ran the sample code provided. Still getting all of the above. Did you try running this on your end?
Guys, anything?
the debug statements below is not related (I think that newer version of xcode spews some socket logs)
[] nw_endpoint_flow_prepare_output_frames [6.1 52.216.224.219:443 ready socket-flow (satisfied)] Failed to use 1 frames, marking as failed
[] nw_endpoint_handler_add_write_request [6.1 52.216.224.219:443 failed socket-flow (satisfied)] cannot accept write requests
[] __tcp_connection_write_eof_block_invoke Write close callback received error: [22] Invalid argument
The thing is, as I noted above, whenever these show up, the request times out after 60 seconds.
It is super frustrating as there is no way to detect this and retry, instead I have to wait for 60 seconds before and error gets thrown and retry, which delays the whole upload logic by a minute.
Hi @ilijapuaca Under what scenarios do you get the 60 second timeout? I used your code provided above and tried to reproduce the issue, but never I saw the 60 second timeout. The mismatch in signature should be fixed immediately in the retry.
Thanks, Rohan
I guess I should have included timestamps as well. For an example, exactly 60 seconds after system logs from above get printed out, this is the response I get (you can see it in the log I provided in the OP):
AWSiOSSDK v2.5.0 [Error] AWSURLSessionManager.m line:212 | -[AWSURLSessionManager URLSession:task:didCompleteWithError:] | Session task failed with error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSUnderlyingError=0x610000246240 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=https://s3.amazonaws.com/im-demo/S3TestSample/TestFile1.jpg, NSErrorFailingURLKey=https://s3.amazonaws.com/im-demo/S3TestSample/TestFile1.jpg, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out.}
Is that not the case when you tried the code above? In that case I should test with more configurations as it happens every single time for me, both on simulator and device.
Still happens even with 2.5.2.
Did anyone try running the sample, am I really the only person with this issue?
I have that too and no success so far. I tried authenticated and not authenticated setups but with the same random problem
Hi @ilijapuaca
Did you try the iOS SDK TransferUtilitySample app provided here? https://github.com/awslabs/aws-sdk-ios-samples/tree/master/S3TransferUtility-Sample
Could you please mention if the issue occur with the above sample app as well?
Thanks, Rohan
The sample you provided is not completely relevant to this issue. It uploads a single image, and as the title of the issue suggests, problems seem to occur when there's multiple uploads being started at the same time.
The sample project also crashes on iOS10.0+ with following:
S3TransferUtilitySampleSwift[62125:1988075] [access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
After fixing that, I modified the code so that it uploads the same image multiple times.
I did not run into any issues. However, this sample uses different code from what is provided in the getting started section. It uploads raw data vs loading the file from given URL. I am not sure whether that changes anything, I didn't have enough time to modify it so that it uses the same API.
What I'm getting no feedback on is whether any of the devs managed to reproduce the issues I described above by running the simplest sample I provided entire code for in the OP?
I guess I'll try modifying my own code and use the API thats being used in the sample and see how that works out.
@ilijapuaca, Did you find the issue regarding below error.
I am trying in with only one image to upload nothing else then also I am getting the same error.
So if you found this then please let me know.
Thanks
I am having the exact same issue:
AWSiOSSDK v2.4.9 [Verbose] AWSSignature.m line:660 | -[AWSS3ChunkedEncodingInputStream nextChunk] | stream read: 32677, chunk size: 32768 [] nw_endpoint_flow_prepare_output_frames [7.1 52.216.0.123:443 ready socket-flow (satisfied)] Failed to use 1 frames, marking as failed [] nw_endpoint_handler_add_write_request [7.1 52.216.0.123:443 failed socket-flow (satisfied)] cannot accept write requests [] tcp_connection_write_eof_block_invoke Write close callback received error: [22] Invalid argument
Let's say it's a matter of having too many requests, how can I increase the chunk size? I modified the default chunk size from 32 1024 -91 to 128 1024 - 91 on AWSSignature.m and it still would upload 32768 chunk sizes....
same issue with [] nw_endpoint_flow_prepare_output_frames [7.1 52.216.0.123:443 ready socket-flow (satisfied)] Failed to use 1 frames, marking as failed [] nw_endpoint_handler_add_write_request [7.1 52.216.0.123:443 failed socket-flow (satisfied)] cannot accept write requests [] tcp_connection_write_eof_block_invoke Write close callback received error: [22] Invalid argument
any luck for this?
I'm seeing the same issue, anyone have any workaround for this? it happens about 40% of the time
I am currently trying to upload multiple images in parallel to an S3 bucket and still hitting the HTTP 403 SignatureDoesNotMatch error intermittently. Any luck solving this?
I come to an end and working perfect I was using wrong "S3BucketName" and "AWSRegionType" so make sure these both should be correct.
There is no matter if you are getting these below three lines in your log. Ignore them. Because still I am getting these errors and working fine for me. Failed to use 1 frames, marking as failed cannot accept write requests Invalid argument
Enjoy Thanks.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.
iOS Version:
10.2
AWS SDK Version:2.5.0
(not using2.5.1
due to #592)I started incorporating AWSS3 SDK into my own app, and ran into some issues. In order to make sure problems were not related to my app code, I created a super simple app that consists of code from the documentation:
AppDelegate.swift
ViewController.swift
As you can see, it is pretty simple. It tries starting the uploads for 4 sample files that are part of the app bundle. The same thing happens with 2 files too, and some of the errors (
SignatureDoesNotMatch
) pop up for a single file sometimes.Here's the log. I filtered and replaced any user/session/secret key related strings (hopefully) in order to avoid potentially compromising any credentials.
So a few things here:
OSStatus error: [-25299] Security error has occurred.
seems to be printed every time when I try uploading more than 1 file at the same time (3 times in this case for 4 files). I assume it is related to storing credentials in the keychain?SignatureDoesNotMatch
pops up occasionally. I assume it might be a race condition and that the credentials are somehow not ready to be used yet? As we can see from the log though, it does retry immediately, with the same header(?) and the upload goes through successfully, which is weird.When these get printed out, the upload request seems to become a zombie. It will time out after 60 seconds (
Code=-1001 "The request timed out."
), then retry again, after which it succeeds.The last one is the most frustrating one as it practically delays the upload by 60 seconds (I could reduce the timeout, but it's not a solution).
I guess these can be broken up into multiple issues, but I think this is a good summary of all the things that go wrong for such a simple use case.
Please let me know if there's any additional info you need or whether I'm overlooking something.