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

s3 transferUtility upload fail error in specific region(ex: ap-northeast-2) #234

Closed
jazzparty opened this issue Dec 28, 2016 · 6 comments
Closed
Milestone

Comments

@jazzparty
Copy link

To help us solve your problem better, please answer the following list of questions.

  • What service are you using?
    s3 and cognito service;

  • In what version of SDK are you facing the problem?
    asw-sdk-android SDK 2.3.8

  • Is the issue limited to Simulators / Actual Devices?
    Android real Device with version 6.0

  • Can your problem be resolved if you bump to a higher version of SDK?
    nop

  • Is this problem related to specific Android/OS version?
    Only android, iOS is ok.

  • Can you give us steps to reproduce with a minimal, complete, and verifiable example? Please include any specific network conditions that might be required to reproduce the problem.
    I tried android aws-sdk sample of S3TransferUtility. I setup Region : ap-northeast-2. then happened an error. But changing region with ap- northeast-1, is ok.

  • Please include a stacktrace if applicable.
    When uploading small file(maybe 300K under), happened below error.

12-28 17:06:02.673 3971-4024/com.amazonaws.demo.s3transferutility E/UploadTask: Failed to upload: 21 due to The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. (Service: Amazon S3; Status Code: 400; Error Code: InvalidRequest; Request ID: 7BBFB71FDEA7AC15)
12-28 17:06:02.683 3971-3971/com.amazonaws.demo.s3transferutility E/UploadActivity: Error during upload: 21
com.amazonaws.services.s3.model.AmazonS3Exception: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. (Service: Amazon S3; Status Code: 400; Error Code: InvalidRequest; Request ID: 7BBFB71FDEA7AC15), S3 Extended Request ID: s7PHLFnLHI+f+0I4E1dtYHraxmVXMny75pOAkHIovhlqXNtHcFBOdFArZHaocpcpXwubGVFMNfY=
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:712)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:388)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:199)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4375)
at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1704)
at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.uploadSinglePartAndWaitForCompletion(UploadTask.java:203)
at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:85)
at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:44)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
12-28 17:06:02.713 3971-3971/com.amazonaws.demo.s3transferutility D/UploadActivity: onProgressChanged: 21, total: 19878, current: 19878
12-28 17:06:02.713 3971-3971/com.amazonaws.demo.s3transferutility D/UploadActivity: onStateChanged: 21, FAILED

If uploading the bigger file more then 300K , it occurred another error.

E/UploadTask: Failed to upload: 19 due to Unable to execute HTTP request: Write error: ssl=0xb8c03110: I/O error during system call, Connection reset by peer
12-28 16:34:04.543 7614-7614/test.complete.mirror_client E/UploadActivity: Error during upload: 19
com.amazonaws.AmazonClientException: Unable to execute HTTP request: Write error: ssl=0xb8c03110: I/O error during system call, Connection reset by peer
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:424)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:199)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4375)
at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1704)
at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.uploadSinglePartAndWaitForCompletion(UploadTask.java:203)
at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:85)
at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:44)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: javax.net.ssl.SSLException: Write error: ssl=0xb8c03110: I/O error during system call, Connection reset by peer
at com.android.org.conscrypt.NativeCrypto.SSL_write(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:877)
at com.android.okhttp.okio.Okio$1.write(Okio.java:81)
at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155)
at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176)
at com.android.okhttp.okio.RealBufferedSink.write(RealBufferedSink.java:46)
at com.android.okhttp.internal.http.HttpConnection$FixedLengthSink.write(HttpConnection.java:350)
at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176)
at com.android.okhttp.okio.RealBufferedSink$1.write(RealBufferedSink.java:198)
at com.amazonaws.http.UrlHttpClient.write(UrlHttpClient.java:245)
at com.amazonaws.http.UrlHttpClient.writeContentToConnection(UrlHttpClient.java:165)
at com.amazonaws.http.UrlHttpClient.execute(UrlHttpClient.java:70)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:356)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:199) 
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4375) 
at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1704) 
at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.uploadSinglePartAndWaitForCompletion(UploadTask.java:203) 
at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:85) 
at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:44) 
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818) 
12-28 16:34:04.543 7614-7614/test.complete.mirror_client D/UploadActivity: onStateChanged: 19, FAILED

@karthiksaligrama
Copy link
Contributor

Thanks will take a look.

@jazzparty
Copy link
Author

Did you check this issue?
we are waiting for you to resolve this issue.

@karthiksaligrama
Copy link
Contributor

it seems like ap-northeast-2 is not whitelisted to switch to sigv4 for s3 by default. Will fix in the next release.

@macpraveen
Copy link

macpraveen commented Feb 20, 2017

@karthiksaligrama we have the same pblm. Only workaround is to use other regions. We are using Mumbai (ap-south-1) and have to create a new bucket in Singapore. Cognito and AWS4 causing pblms. When can we expect a fix?

@JacobMuchow
Copy link

JacobMuchow commented Mar 2, 2017

@karthiksaligrama I seem to be having this problem as well... I simply followed the tutorials with a bucket setup in us-east-1 and have been googling everywhere for a solution. I suppose I will try a different region.

Edit: Disregard... turns out my bucket was in Ohio (us-east-2) while my Cognito roles were in us-east-1. That was fun :P

@karthiksaligrama karthiksaligrama added this to the 2.4.0 milestone Mar 20, 2017
@karthiksaligrama
Copy link
Contributor

resolved with 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants