D/com.amazonaws.request(11974): Received error response: com.amazonaws.services.s3.model.AmazonS3Exception: The provided token is malformed or otherwise invalid. (Service: null; Status Code: 400; Error Code: InvalidToken; Request ID: 6FD6FD119D9C816C), S3 Extended Request ID: xFrE98R4i4nagXH35KlRKbc0qnqSA3voMemHJ5xN92ehP3w7QZeqsQ9O94iJhGdeBOmz0S5aS9A=
E/UploadTask(11974): Error encountered during multi-part upload: 6 due to The provided token is malformed or otherwise invalid. (Service: Amazon S3; Status Code: 400; Error Code: InvalidToken; Request ID: 6FD6FD119D9C816C)
E/UploadTask(11974): com.amazonaws.services.s3.model.AmazonS3Exception: The provided token is malformed or otherwise invalid. (Service: Amazon S3; Status Code: 400; Error Code: InvalidToken; Request ID: 6FD6FD119D9C816C), S3 Extended Request ID: xFrE98R4i4nagXH35KlRKbc0qnqSA3voMemHJ5xN92ehP3w7QZeqsQ9O94iJhGdeBOmz0S5aS9A=
E/UploadTask(11974): at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:730)
E/UploadTask(11974): at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:405)
E/UploadTask(11974): at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:212)
E/UploadTask(11974): at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4659)
E/UploadTask(11974): at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1752)
E/UploadTask(11974): at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.uploadSinglePartAndWaitForCompletion(UploadTask.java:221)
E/UploadTask(11974): at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:99)
E/UploadTask(11974): at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:55)
E/UploadTask(11974): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/UploadTask(11974): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/UploadTask(11974): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/UploadTask(11974): at java.lang.Thread.run(Thread.java:919)
I/System.out(11974):
I/System.out(11974): ❌ upload failed
The plugin takes host as "bucket-name.s3.us-gov-west-1.amazonaws.com" no matter whichever region I specify.
Here is the code snippet:
String uploadedImageUrl = await AmazonS3Cognito.upload( _image.path, "bucket-name", "us-east-1:****----****", "Test Image", AwsRegion.US_EAST_1, AwsRegion.AP_SOUTH_1, );
There Error:
D/com.amazonaws.request(11974): Received error response: com.amazonaws.services.s3.model.AmazonS3Exception: The provided token is malformed or otherwise invalid. (Service: null; Status Code: 400; Error Code: InvalidToken; Request ID: 6FD6FD119D9C816C), S3 Extended Request ID: xFrE98R4i4nagXH35KlRKbc0qnqSA3voMemHJ5xN92ehP3w7QZeqsQ9O94iJhGdeBOmz0S5aS9A= E/UploadTask(11974): Error encountered during multi-part upload: 6 due to The provided token is malformed or otherwise invalid. (Service: Amazon S3; Status Code: 400; Error Code: InvalidToken; Request ID: 6FD6FD119D9C816C) E/UploadTask(11974): com.amazonaws.services.s3.model.AmazonS3Exception: The provided token is malformed or otherwise invalid. (Service: Amazon S3; Status Code: 400; Error Code: InvalidToken; Request ID: 6FD6FD119D9C816C), S3 Extended Request ID: xFrE98R4i4nagXH35KlRKbc0qnqSA3voMemHJ5xN92ehP3w7QZeqsQ9O94iJhGdeBOmz0S5aS9A= E/UploadTask(11974): at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:730) E/UploadTask(11974): at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:405) E/UploadTask(11974): at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:212) E/UploadTask(11974): at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4659) E/UploadTask(11974): at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1752) E/UploadTask(11974): at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.uploadSinglePartAndWaitForCompletion(UploadTask.java:221) E/UploadTask(11974): at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:99) E/UploadTask(11974): at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.call(UploadTask.java:55) E/UploadTask(11974): at java.util.concurrent.FutureTask.run(FutureTask.java:266) E/UploadTask(11974): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/UploadTask(11974): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/UploadTask(11974): at java.lang.Thread.run(Thread.java:919) I/System.out(11974): I/System.out(11974): ❌ upload failed