Aws-sdk-android: Get MalformedJsonException error

Created on 25 Nov 2020  路  3Comments  路  Source: aws-amplify/aws-sdk-android

I am getting this error:

ServiceException in submit all, the last request is presumed to be the cause and will be dropped
    com.amazonaws.AmazonClientException: 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=1606325661023, Content-Length=132, X-Android-Received-Millis=1606325671186, Date=Wed, 25 Nov 2020 17:34:31 GMT, Content-Type=text/html}

Caused by: com.amazonaws.AmazonClientException: Unable to parse JSON String.
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

When I attempt to call firehoseRecorder.submitAllRecords(), it raises an error.

What I'm doing is basically going through a list of objects and saving them as JSON strings. Then calling submitAllRecords

for (obj in objs) {
            Timber.d("Attempt to save record on Firehose ${pkt.jsonString}")
            firehoseRecorder.saveRecord("${obj.jsonString}\n", streamName)
        }

Most helpful comment

Yesterday night, all of a sudden even I was getting this issue. I thought of searching the issue on Github and I found out this issue was created recently. We use Aws Presigned URL which internally uses AwsCognito (I think for authentication). My guess is your issue might be related to Aws Outage which occurred last night and services in us-east-1 regions are affected because of the same. For more info: https://www.theverge.com/2020/11/25/21719396/amazon-web-services-aws-outage-down-internet. This morning when I checked our app it was working fine.

All 3 comments

Yesterday night, all of a sudden even I was getting this issue. I thought of searching the issue on Github and I found out this issue was created recently. We use Aws Presigned URL which internally uses AwsCognito (I think for authentication). My guess is your issue might be related to Aws Outage which occurred last night and services in us-east-1 regions are affected because of the same. For more info: https://www.theverge.com/2020/11/25/21719396/amazon-web-services-aws-outage-down-internet. This morning when I checked our app it was working fine.

This issue also affected our apps in production very negatively.

This error was the result of a Large Scale Event (AWS), which is now resolved per the AWS Service Health Dashboard.

Was this page helpful?
0 / 5 - 0 ratings