1

I am running into this problem in the course of working on a rest api that accepts PUT calls and then streams that contents of the push into S3 using the AWS S3 Java API.

The error I am getting was this:

Caused by: com.amazonaws.AmazonClientException: Data read has a different length than the expected: dataLength=365; expectedLength=366; includeSkipped=false; in.getClass()=class org.duracloud.common.stream.ChecksumInputStream; markedSupported=false; marked=0; resetSinceLastMarked=false; markCount=0; resetCount=0

I'm using aws-java-sdk 1.9.1.

The problem has appeared since I upgraded from v.1.7.3

  • I have made a minor change. When mentioning an error, use the ">" character to indent it. Have a good day –  Mar 11 '15 at 00:57
  • For any one still looking out for a solution. https://stackoverflow.com/a/53364574/2373449 – Vikram Nov 18 '18 at 19:25

1 Answers1

1

While it is not clear to me what exactly in the aws sdk is causing the problem, I fixed the issue by explicitly setting the content-type http header to something other than "application/x-www-form-urlencoded" which is the default value sent by both curl and jquery.