Skip to content

@aws-sdk/lib-storage: Checksum Type mismatch when uploading larger filesΒ #6922

@s-h-a-d-o-w

Description

@s-h-a-d-o-w

Checkboxes for prior research

Describe the bug

Uploading large files to S3 fails. This starts to happen at some point after 5 MB.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v22.12.0

Reproduction Steps

Run the following code:

import { S3Client } from "@aws-sdk/client-s3";
import { Upload } from "@aws-sdk/lib-storage";
import { createReadStream } from "node:fs";
import { writeFile } from "node:fs/promises";
import { join } from "node:path";

async function main() {
  const s3Client = new S3Client({
    region: ...,
    credentials: {
      accessKeyId: ...,
      secretAccessKey: ...,
    },
  });

  // const largeContent = "a".repeat(1000 * 1000); // βœ…
  // const largeContent = "a".repeat(5 * 1000 * 1000); // βœ…
  const largeContent = "a".repeat(9 * 1000 * 1000); // πŸ’₯
  const key = "large-file.txt";
  const filePath = join(__dirname, key);

  await writeFile(filePath, largeContent);
  await new Upload({
    client: s3Client,
    params: {
      Bucket: ...,
      Key: key,
      Body: createReadStream(filePath),
    },
  }).done();
}

void main();

Observed Behavior

Upload fails with InvalidRequest: Checksum Type mismatch occurred, expected checksum Type: crc32, actual checksum Type: null.

Expected Behavior

Upload succeeds.

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions