com.amazonaws.AmazonClientException: Data read has a different length than the expected: dataLength=0; expectedLength=26; includeSkipped=false; in.getClass()=class com.amazonaws.internal.ResettableInputStream; markedSupported=true; marked=0; resetSinceLastMarked=false; markCount=1; resetCount=0

GitHub | jglogan | 5 months ago
  1. 0

    S3MessageHandler upload fails for File message.

    GitHub | 5 months ago | jglogan
    com.amazonaws.AmazonClientException: Data read has a different length than the expected: dataLength=0; expectedLength=26; includeSkipped=false; in.getClass()=class com.amazonaws.internal.ResettableInputStream; markedSupported=true; marked=0; resetSinceLastMarked=false; markCount=1; resetCount=0
  2. 0

    https://github.com/spring-projects/spring-integration-aws/issues/41 I have configured an `S3MessageHandler` from spring-integration-aws to upload a `File` object to S3. The upload fails with the following trace: > Caused by: com.amazonaws.AmazonClientException: Data read has a different length than the expected: dataLength=0; expectedLength=26; includeSkipped=false; in.getClass()=class com.amazonaws.internal.ResettableInputStream; markedSupported=true; marked=0; resetSinceLastMarked=false; markCount=1; resetCount=0 at com.amazonaws.util.LengthCheckInputStream.checkLength(LengthCheckInputStream.java:152) ... Looking at the source code for `S3MessageHandler`, I'm not sure how uploading a `File` would ever succeed. The `s3MessageHandler.upload()` method does the following when I trace its execution: - Creates a FileInputStream for the File. - Computes the MD5 hash for the file contents, using the input stream. - Resets the stream if it can be reset (not possible for FileInputStream). - Sets up the S3 transfer using the input stream. This fails because the stream is at the EOF, so the number of transferable bytes doesn't match what's in the Content-Length header.

    Spring JIRA | 5 months ago | John Logan
    com.amazonaws.AmazonClientException: Data read has a different length than the expected: dataLength=0; expectedLength=26; includeSkipped=false; in.getClass()=class com.amazonaws.internal.ResettableInputStream; markedSupported=true; marked=0; resetSinceLastMarked=false; markCount=1; resetCount=0
  3. 0

    AmazonClientException: Data read has a different length than the expected

    programwith.com | 12 months ago
    com.amazonaws.AmazonClientException: Data read has a different length than the expected: dataLength=8192; expectedLength=79352; includeSkipped=false; in.getClass()=class com.amazonaws.internal.ResettableInputStream; markedSupported=true; marked=0; resetSinceLastMarked=false; markCount=1; resetCount=0
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    AmazonClientException: Data read has a different length than the expected

    Stack Overflow | 2 years ago | Mangesh Bhapkar
    com.amazonaws.AmazonClientException: Data read has a different length than the expected: dataLength=8192; expectedLength=79352; includeSkipped=false; in.getClass()=class com.amazonaws.internal.ResettableInputStream; markedSupported=true; marked=0; resetSinceLastMarked=false; markCount=1; resetCount=0
  6. 0

    Cannot upload log files that are being appended to during upload

    GitHub | 6 months ago | pako-pl
    com.amazonaws.AmazonClientException: More data read than expected: dataLength=48170; expectedLength=47956; includeSkipped=false; in.getClass()=class com.amazonaws.internal.ReleasableInputStream; markedSupported=false; marked=0; resetSinceLastMarked=false; markCount=0; resetCount=0

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.amazonaws.AmazonClientException

      Data read has a different length than the expected: dataLength=0; expectedLength=26; includeSkipped=false; in.getClass()=class com.amazonaws.internal.ResettableInputStream; markedSupported=true; marked=0; resetSinceLastMarked=false; markCount=1; resetCount=0

      at com.amazonaws.util.LengthCheckInputStream.checkLength()
    2. AWS SDK for Java - Core
      LengthCheckInputStream.checkLength
      1. com.amazonaws.util.LengthCheckInputStream.checkLength(LengthCheckInputStream.java:152)
      1 frame