In the last couple hours my app started giving this error whenever I try to upload something to S3.
Unable to unmarshall error response (Unable to parse JSON String.). Response Code: 504, Response Text: Gateway Time-out, Response Headers: {X-Android-Selected-Protocol=http/1.1, Server=awselb/2.0, Connection=keep-alive, X-Android-Response-Source=NETWORK 504, X-Android-Sent-Millis=1606318289732, Content-Length=132, X-Android-Received-Millis=1606318300066, Date=Wed, 25 Nov 2020 15:31:41 GMT, Content-Type=text/html}
We are using this to instantiante and upload our files:
sTransferUtility = TransferUtility.builder()
.context(mActivity)
.awsConfiguration(AWSMobileClient.getInstance().getConfiguration())
.s3Client(new AmazonS3Client(sCredProvider, Region.getRegion(Regions.US_EAST_1)))
.build();
...
TransferObserver observer = sTransferUtility.upload(MY_BUCKET, mPictureFile.getName(), mPictureFile);
...
observer.setTransferListener(new TransferListener() {
@Override
public void onStateChanged(int id, TransferState state) {
if (state == TransferState.COMPLETED) {
...
} else if (state == TransferState.CANCELED || state == TransferState.FAILED) {
...
}
}
@Override
public void onProgressChanged(int id, long bytesCurrent, long bytesTotal) {
}
@Override
public void onError(int id, Exception ex) {
//THIS IS WHERE THE ERROR RETURNS
}
});