Closed nick3389 closed 6 years ago
Hi @nick3389, Thanks for reporting to us. The limit of 50 minutes is imposed by Amazon Cognito Federated Identities. The Cognito credentials need to be refreshed after every 50 minutes and this is required for the S3 operations to succeed. Hence, AWSS3TransferUtilityTimeoutIntervalForResource is a constant.
@kvasukib So, if I use only the AWSS3TransferUtility and not the Cognito service, am I restricted to this timeout?
The AWSS3TransferUtility creates PreSigned URLs that rely on the Cognito Identity to retrieve temporary credentials. http://docs.aws.amazon.com/mobile/sdkforios/developerguide/s3transferutility.html#limitations. You can use AWSS3 class instead which is the low-level client and you will not be having this interval limit when you use it with STS (Security Token Service) or AWS Access / Secret Access Keys.
@kvasukib Do you mean the AWSS3Service class?. Is there any documentation for using this?
It would be this one: http://docs.aws.amazon.com/AWSiOSSDK/latest/Classes/AWSS3.html
Does it support handleEventsForBackgroundURLSession?
The AWSS3 client (http://docs.aws.amazon.com/AWSiOSSDK/latest/Classes/AWSS3.html) doesn't support background transfers. The AWSS3TransferUtility only supports background transfers.
Ok. So, I guess I am stuck with AWSS3TransferUtility. Is there any plan to support background transfers with the AWSS3 client?
Hello nick3389
Thank you for your continued feedback on this topic. The TransferUtility component currently has a hard limit of 50 minutes as already mentioned by kvasukib. I have added the following enhancements requests to the SDK backlog.
Please check back on this thread ( or look for general forum announcements) for updates on these items.
That said, if you are currently blocked and need a solution for longer lived background uploads, you can do a background transfer with S3 using pre-signed URLs and NSURLSession. (see https://docs.aws.amazon.com/mobile/sdkforios/developerguide/s3-pre-signed-urls.html for further details)
Would be so nice if AWSS3TransferUtility
could have a configurable timeout.
So, I am also stuck with that at the moment :(
@nick3389 Have you found any solution for the moment?
@chrisscholly no. I still use transfer utility, but every time I do a pod update
, I change manually the timeoutInterval. Probably I will wait for the changes @cbommas mentioned. For now, I leave it as it is.
@nick3389 Thank you for the update. Changing manually the timeoutInterval is enough to overcome the 50 minutes limitation? @cbommas @kvasukib could you also confirm?
@chrisscholly Yes, it's working.
@nick3389 Are you sure? Only by tweaking the timeoutInterval? Seems like we should also pass in credentials to the TransferUtility instead of letting Cognito Identity retrieve temporary credentials.
@chrisscholly Sorry, I forgot to mention that I don't use Cognito. I use accessKey and secretKey for S3 (static credentials). You should setup your own defaultServiceConfiguration
and then register in AWSS3TransferUtility
with:
+ (void)registerS3TransferUtilityWithConfiguration:(AWSServiceConfiguration *)configuration forKey:(NSString *)key;
@nick3389 Okay, thank you, will have a try :)
@nick3389 Seems like it works like a charm 👌 Thanks bro!
@nick3389 Just noticed that TransferUtility
does not support multi-parts 😔
So it will be very tricky to upload large files.
What is your strategy in terms of network loss, pause/resume, etc.?
@chrisscholly We are working on adding multi-part functionality to the Transfer Utility and adding enhanced error handling/retry to tackle network loss, pause/resume etc. Please check back on this thread (or look for general forum announcements) for updates on these items.
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.
We have added support for Mulit-part in uploads in AWSS3TransferUtility
in 2.6.13
. Please upgrade and let us know any feedback you have.
Hello @nick3389 @chrisscholly
The latest version of the SDK, 2.6.20 released on 6/1/2018, contains this feature.
let serviceConfiguration = AWSServiceManager.default().defaultServiceConfiguration
let transferUtilityConfiguration = AWSS3TransferUtilityConfiguration()
//Set the timeoutIntervalForResource parameter (in seconds)
transferUtilityConfigurationWithRetry.timeoutIntervalForResource = 15*60 //15 minutes
AWSS3TransferUtility.register(
with: serviceConfiguration!,
transferUtilityConfiguration: transferUtilityConfiguration,
forKey: "custom-timeout"
)
//Instantiate the transfer utility
let transferUtility = AWSS3TransferUtility.s3TransferUtility(forKey: "custom-timeout")
Will there be a future possibility to customize the AWSS3TransferUtilityTimeoutIntervalForResource static property of AWSS3TransferUtility class?
Thank you!