Aws-sdk-ios: Issue 180 still not resolved

Created on 3 Jul 2016  路  14Comments  路  Source: aws-amplify/aws-sdk-ios

When user on a wifi network without internet or poor internet like edge and even if Transfer manager is asked to download the image once, images are still being corrupted.

bug closing-soon-if-no-response question s3

Most helpful comment

@bruce-lumo Set AWSServiceConfiguration.maxRetryCount = 0

All 14 comments

Steps:
Started 3 downloads on Edge network no data or very less is coming with very poor connection
Do some dirty stuff like below
Go to airport mode and come back
Take app in background and come back again.
Results corrupted images. Not every time but sometimes when below line gets printed on Log

2016-07-08 21:37:02.362 App[7608:3508123] AWSiOSSDK v2.4.5 [Debug] AWSURLSessionManager.m line:424 | -[AWSURLSessionManager URLSession:dataTask:didReceiveResponse:completionHandler:] | target file already exists, will be appended at the file path: file:///private/var/mobile/Containers/Data/Application/4AA90DBD-7CB1-469A-86A1-DB3AC16F41A5/tmp/xxxx.jpg8C3EAF70-964D-4AA0-9DAF-431DDBFE46A4-7608-000008C42B9B378F

I have made sure that TransferManager gets download call only once per file still images are being corrupted please check.

thanks for reporting this. Will update when resolved.

Thanks for reporting this. We will update the thread when issue resolved.

Thanks for your quick update!
Can you please suggest any workaround for this if any?

Hi Team,

We are facing the same issue with AWS S3. Corrupt images are being retrieved with weak (below 3G) connectivity. Going through the threads, I see various people facing this issue and have reported the same.

This is of great concern to us as Corrupted images are being sent to our end Users, affecting the overall user experience.

Would like to urge you for your support in having this resolved at the earliest. Look forward to hearing from you.

Hi,

I tried multiple network configurations to try and reproduce this issue but without success. I tried multiple network profiles with 5kbps without packet loss, 15kbps with 90% packet loss, etc. and still could not reproduce the issue. Can any one provide a code snippet by which we can reproduce the issue?

Also,
Does the code explicitly set the downloadingFilePath on the download request? Can you try to reproduce without using downloadingFilePath property?

Thanks,
Rohan

Please find code snippet.
`
let downloadRequest = AWSS3TransferManagerDownloadRequest()

    downloadRequest.bucket = AWSManager.s3BucketName()

    downloadRequest.key = key

    let transferManager = AWSS3TransferManager.defaultS3TransferManager()

    return transferManager.download(downloadRequest)`

I have tried with both setting downloadingFilePath and without it. Issue remains.

Currently the work around that we are following is to set maxRetryCount to 0 for AWSServiceConfiguration.

I met the same issue. My network connection was bad, I started downloading photos and waited them to complete.
The logs as following:

2016-12-21 21:38:14.669 xxx[17316:569501] AWSiOSSDK v2.4.11 [Debug] AWSURLSessionManager.m line:425 | -[AWSURLSessionManager URLSession:dataTask:didReceiveResponse:completionHandler:] | target file already exists, will be appended at the file path: file:///Users/vale/Library/Developer/CoreSimulator/Devices/4445A553-6720-48A2-AABF-198B83C11A64/data/Containers/Data/Application/52B6422A-2293-4B0A-987C-7FD81D8C8C8A/tmp/130591.jpg97130FC0-CD1F-4B03-9801-639E4899093A-17316-00002291B2275E12
2016-12-21 21:38:34.048 xxx[17316:569861] AWSiOSSDK v2.4.11 [Debug] AWSURLSessionManager.m line:553 | -[AWSURLSessionManager printHTTPHeadersForResponse:] | Response headers:
{
    "Accept-Ranges" = bytes;
    "Content-Length" = 119887;
    "Content-Type" = "image/jpeg";
    Date = "Wed, 21 Dec 2016 13:38:07 GMT";
    Etag = "\"0ac527312aa40733ebde1936fa2946bd\"";
    "Last-Modified" = "Tue, 20 Dec 2016 17:10:28 GMT";
    Server = AmazonS3;
    "x-amz-id-2" = "oJXGJ/qw5kPajBRuKHnDuzVi6UVRVfdzedgRVGaBFVK1Zah/4dqBLcnUFZIY1xpWXTWHNIbhpCo=";
    "x-amz-request-id" = 620078565851AD73;
}
----------------------------------------
2016-12-21 21:38:34:053 AWSAPI.swift=>downloadFileAsync(serverFileName:destinationPath:completionHandler:)[98]=>task.isFaulted false
----------------------------------------
2016-12-21 21:38:34:053 AWSAPI.swift=>downloadFileAsync(serverFileName:destinationPath:completionHandler:)[99]=>task.isCompleted true
----------------------------------------
2016-12-21 21:38:34:054 AWSAPI.swift=>downloadFileAsync(serverFileName:destinationPath:completionHandler:)[100]=>task.isCancelled false
----------------------------------------
2016-12-21 21:38:34:054 AWSAPI.swift=>downloadFileAsync(serverFileName:destinationPath:completionHandler:)[101]=>task.error nil
----------------------------------------
2016-12-21 21:38:34:055 AWSAPI.swift=>downloadFileAsync(serverFileName:destinationPath:completionHandler:)[102]=>task.exection nil

I had planted to see if the error is existing, then I can delete the broken photo, but you see the logs:
task.isCompleted true, task.isFaulted false. These information can't help me delete the broken photo.

Here are the photos I downloaded.
qq20161221-0

Any resolution on this? I am having some realm files get corrupted when I upload them to S3 over a poor network.

@bruce-lumo Set AWSServiceConfiguration.maxRetryCount = 0

Setting the maxRetryCount = 0 in our testing does indeed fix the download corruption issue. However, it also prevents the SDK from detecting and fixing clock skew errors and retrying the request a 2nd time in that case. So users that have manually set their clocks on their phones incorrectly will get errors. In one app with even a fairly small user base we're seeing this happen with some regularity.

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.

Please use TransferUtility from now on. Samples can be found here

Was this page helpful?
0 / 5 - 0 ratings