Giter Site home page Giter Site logo

Comments (4)

Objective-Cloud avatar Objective-Cloud commented on June 15, 2024

+1 I have similar issues...

from aws-sdk-ios-v1.

turacma avatar turacma commented on June 15, 2024

Apologies for the lack of contact on this issue. Can you clarify how you're using the library? Specifically:

  1. Are you using the low level AmazonS3Client or S3TransferManager?
  2. You indicated that you queue up requests and process them serially, how are you accomplishing this?
  3. What region is your bucket in? Does this happen with other buckets?
  4. Are these uploads done over Wifi or cellular?
  5. What version of iOS are you targeting and what version is running on the device?

Given that we're relying on the behavior of NSURLConnection to handle connections we may need to follow up with Apple, but if we can narrow down the cause that will go a long way to being able to file a report if necessary.

from aws-sdk-ios-v1.

turacma avatar turacma commented on June 15, 2024

Closing issue due to lack of follow up. Please feel free to reopen if you continue to have the issue.

from aws-sdk-ios-v1.

mat avatar mat commented on June 15, 2024

I ran into the same issue today and it looks like this type of error is happening to non-iOS S3 clients, too.

The article "Broken Pipe Error when using Boto + S3" at http://reterwebber.wordpress.com/2013/08/22/broken-pipe-error-when-using-boto-s3/ lead me to the solution that worked for me, too:

Tell the S3 library which region (host) you are using.

@turacma, to answer your questions:

  1. Happened with both AmazonS3Client and S3TransferManager
  2. eu-west-1 (ireland)
  3. Over Wifi, haven't tested otherwise.
  4. Simulator running iOS 7.0.4, built against SDK 7.

Incidentally I ran into the same issue last week when using http://s3tools.org/s3cmd (which is written in python) while writing into my Ireland located bucket. The symptom (Broken Pipe) was the same, the solution (explicit region host selection) as well.

Here is the code I used:

- (void) uploadFileToS3
{
//    NSString* hostname = @"s3.amazonaws.com"; // Triggered "Broken Pipe" error!
    NSString* hostname = @"s3-eu-west-1.amazonaws.com";
    NSString* bucketName = @"iosbucket";

    NSString* accessKey = @"XXX";
    NSString* secretKey = @"YYY";

    NSString* localImageName = @"galaxy.jpg"; // ~15MB
    NSString* keyName = @"galaxy.jpg";

    AmazonS3Client* s3 = [[AmazonS3Client alloc] initWithAccessKey:accessKey withSecretKey:secretKey];

    S3PutObjectRequest* por = [[S3PutObjectRequest alloc] initWithKey:keyName inBucket:bucketName];
    por.data = UIImageJPEGRepresentation([UIImage imageNamed:localImageName], 0.8);;
    por.contentType = @"image/jpeg";
    por.hostName = hostname;

    BOOL useTransferManager = YES;
    if (useTransferManager)
    {
        S3TransferManager* tm = [S3TransferManager new];
        tm.s3 = s3;
        [tm upload:por];
    }
    else
    {
        [s3 putObject:por];
    }
}

from aws-sdk-ios-v1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.