Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in AWSS3TransferUtility Upload Since Version 2.4.2 #390

Closed
treyrich opened this issue May 23, 2016 · 28 comments
Closed

Error in AWSS3TransferUtility Upload Since Version 2.4.2 #390

treyrich opened this issue May 23, 2016 · 28 comments
Labels
bug Something isn't working

Comments

@treyrich
Copy link

treyrich commented May 23, 2016

I've tested back and forth on 2.4.2 vs 2.4.1 and I can confirm that prior to 2.4.2 this issue didn't exist.

Basically when attempting to make an upload via AWSS3TransferUtility the upload appears to go through successfully (progress call back is called until progress reaches 100%), then in the completion block the following error is thrown: Error Domain=com.amazonaws.AWSS3TransferUtilityErrorDomain Code=1 "(null)"

I've looked through the release notes, and existing issues and can't see any mention of why this would occur? So I just rolled back to 2.4.1 until I have time to dig into it, but any insight would be helpful as to why this breaking change would have been introduced in v.2.4.2.

I'm happy to help with a PR once I have time to track down why this is happening.

@karthiksaligrama
Copy link
Contributor

can you print the response headers and body for your request and paste them here?

@treyrich
Copy link
Author

Here's the redacted response data (can't pull the body because the error is being thrown in - (void)URLSession (NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error):

po task.response
▿ Optional<NSHTTPURLResponse>
  - Some : <NSHTTPURLResponse: 0x12e3111f0> { URL: https://my-bucket.s3.amazonaws.com/useruploads/threaduploads/57364afd7a4e76dd30047042/A5CBF696-B2F4-4B70-A1E2-D139406152D9-2210-0000021F1585A343.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=cred&X-Amz-Date=20160524T001646Z&X-Amz-Expires=2999&X-Amz-SignedHeaders=content-type%3Bhost&x-amz-security-token=token&X-Amz-Signature=sig } { status code: 403, headers {
    Connection = close;
    "Content-Type" = "application/xml";
    Date = "Tue, 24 May 2016 00:16:47 GMT";
    Server = AmazonS3;
    "Transfer-Encoding" = Identity;
    "x-amz-id-2" = "ID";

Let me know if there's anything else you'd like to see. The 403 makes me think it's related to authentication (we're using Developer Authenticated IDs), but seems odd that all of the rest of our AWS calls would work except uploads...

@karthiksaligrama
Copy link
Contributor

what is the content type setting when you upload the request?

@treyrich
Copy link
Author

image/jpeg

@yosuke-matsuda yosuke-matsuda added the bug Something isn't working label May 24, 2016
@philipengberg
Copy link

philipengberg commented May 24, 2016

I see exactly the same issue - ever since 2.4.2

@shebbys
Copy link

shebbys commented May 24, 2016

I just got bitten by this bug. Rolling back to 2.4.1 worked for me.

@whiskey
Copy link

whiskey commented May 25, 2016

I spent the last two days on this before I checked this place… 🙄

@yosuke-matsuda
Copy link
Contributor

This issue will be addressed in the next release. See this pull request for more details. Thanks.

@helloniklas
Copy link

@yosuke-matsuda I have the same issue now on a live app on the App Store, which breaks the whole app. Any fix I can issue now?

@helloniklas
Copy link

@yosuke-matsuda Ok, just read the other thread, and seems I can add something to the code. Still have to upload a new binary to App Store.

@karthiksaligrama
Copy link
Contributor

fixed with 2.4.3

@philipengberg
Copy link

Confirmed, it works in 2.4.3. Thanks guys.

@m-etka
Copy link

m-etka commented Jun 1, 2016

It's working again. Thanks.

@serg2007
Copy link

v2.4.3 not work for iphone 4s

@serg2007
Copy link

v2.4.6 not work for all device

@dougw
Copy link

dougw commented Aug 23, 2016

I had the same error as reported originally. It turned out I was using the wrong region in my configuration.

<key>AWS</key>
    <dict>
        <key>CredentialsProvider</key>
        <dict>
            <key>CognitoIdentity</key>
            <dict>
                <key>Default</key>
                <dict>
                    <key>PoolId</key>
                    <string>us-west-2:xxxxx</string>
                    <key>Region</key>
                    <string>USWest2</string>
                </dict>
            </dict>
        </dict>
        <key>S3TransferUtility</key>
        <dict>
            <key>Default</key>
            <dict>
                <key>Region</key>
                <string>**USEast1**</string>
            </dict>
        </dict>
    </dict>

I was using USWest1 when I needed USEast2. Your mileage may vary.

@steven274
Copy link

I have this bug in 2.4.7

@PriyankaGupta05
Copy link

I am getting the same Error in 2.4.7. I checked everything from region to code debugging and explored various forums on Amazon but it does not seems to work. :(

@NiteshKumarPal
Copy link

NiteshKumarPal commented Sep 6, 2016

hi guys, I am also facing same issue with 2.4.7, I have tried all methods to upload image, did not get success.
with AWSS3TransferManager getting following error each time:

<Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message><Bucket>bucketName</Bucket><Endpoint>bucketName.s3.amazonaws.com</Endpoint><RequestId>requestId</RequestId><HostId>hostID</HostId></Error>

and with AWSS3TransferUtility getting following error :

"Error Domain=com.amazonaws.AWSS3TransferUtilityErrorDomain Code=2 "(null)" UserInfo={Server=AmazonS3, Transfer-Encoding=Identity, Connection=close, Content-Type=application/xml, Date=Tue, 06 Sep 2016 19:56:22 GMT, x-amz-request-id=requestID, x-amz-id-2=someId}"

@Daxito
Copy link

Daxito commented Oct 25, 2016

+1
Same error here, using 2.4.11, please help :-(

"Error Domain=com.amazonaws.AWSS3TransferUtilityErrorDomain Code=1 "(null)" UserInfo={Server=AmazonS3, Transfer-Encoding=Identity, Connection=close, Content-Type=application/xml, Date=Tue, 25 Oct 2016 21:03:41 GMT, x-amz-request-id=F4E1C7D4A21A53, x-amz-id-2=yPEHYjXwcPtMEePxP+ctmovAY8y175QjyJzzpwz3GVvcsMqHsMSrgkZzv8ckO7Kl4oZVdo=}"

@gianlucainnocente
Copy link

+1 same error

Error: Optional(Error Domain=com.amazonaws.AWSS3TransferUtilityErrorDomain Code=1 "(null)" UserInfo={Server=AmazonS3, Transfer-Encoding=Identity, Connection=close, Content-Type=application/xml, Date=Mon, 31 Oct 2016 18:24:32 GMT, x-amz-request-id=7CC1D7BC5D76D19C, x-amz-id-2=sPqHD28/nWQhBut26zfUnMahN+J4TtCxyCOF2B8tHe0iKyTaWl8NP4CfBMa1V63Cd8dMZ1NgOPw=})

@Daxito
Copy link

Daxito commented Oct 31, 2016

Not an error anymore for me, my bucket and my code had different region, they have to match.

@patelmayank
Copy link

patelmayank commented Mar 8, 2017

same problem any one ? i am using (2.4.16) this version

Error : Error Domain=com.amazonaws.AWSS3TransferUtilityErrorDomain Code=2 "(null)" UserInfo={Server=AmazonS3, Transfer-Encoding=Identity, Connection=close, Content-Type=application/xml, Date=Wed, 08 Mar 2017 06:44:05 GMT, x-amz-request-id=7E378925DBB28EE1, x-amz-id-

@jhondge
Copy link

jhondge commented Mar 15, 2017

I face the same issue, It's the system date is the future time.

@FelixNiu512
Copy link

FelixNiu512 commented Sep 7, 2017

+1 same issue, and I am using version 2.5.5.
upload error : Error Domain=com.amazonaws.AWSServiceErrorDomain Code=11 "(null)" UserInfo={HostId=fCa9+koh9+Zkj1vqNwzWF/P1IjVqanYtghUEFkJdFKH34xIpEsUGvEjLPSrpbdfZpOCzh3Abnjw=, Message=Access Denied, Code=AccessDenied, RequestId=783EFDBA73343BB0}

@ddDeName
Copy link

same problem any one ? i am using (2.4.16) this version

Error : Error Domain=com.amazonaws.AWSS3TransferUtilityErrorDomain Code=2 "(null)" UserInfo={Server=AmazonS3, Transfer-Encoding=Identity, Connection=close, Content-Type=application/xml, Date=Wed, 08 Mar 2017 06:44:05 GMT, x-amz-request-id=7E378925DBB28EE1, x-amz-id-

Have you solved this problem?

@frankmuellr
Copy link
Contributor

Hello @ddDeName,

The version of the SDK you are using is quite old. Please upgrade to the latest version, and open a new issue if you still need help.

@Hema1Latha
Copy link

Hema1Latha commented Jun 25, 2019

Error RAW: Optional(Error Domain=com.amazonaws.AWSS3TransferUtilityErrorDomain Code=1 "(null)" UserInfo={Server=AmazonS3, Transfer-Encoding=Identity, Connection=close, Content-Type=application/xml, Date=Tue, 25 Jun 2019 15:49:12 GMT, x-amz-request-id=5FB137472340081A, x-amz-id-2=rxyS0KtBSSpGx8awu7J5zyET6g+wE3CbVozXI8Rhh+AWRrTyxJf8Z9DxTnK2gWZqTB+WFZL5Lvo=, x-amz-bucket-region=eu-west-1})
i'm facing this issue when i'm changing the region from one region to another region can anyone help me to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests