# 由于AWS SDK gem版本升级和新的AWS数据完整性保护，无法重建

**URL:** <https://meta.discourse.org/t/cant-rebuild-due-to-aws-sdk-gem-bump-and-new-aws-data-integrity-protections/354217>\
**Category:** Self-hosting\
**Created:** [2025 年2 月 24 日 17:39 UTC](https://meta.discourse.org/t/cant-rebuild-due-to-aws-sdk-gem-bump-and-new-aws-data-integrity-protections/354217 "2025-02-24T17:39:21Z")\
**Posts on this page:** 1\
**Showing post:** 30

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2025 年2 月 26 日 03:27 UTC](https://meta.discourse.org/t/cant-rebuild-due-to-aws-sdk-gem-bump-and-new-aws-data-integrity-protections/354217/30 "2025-02-26T03:27:28Z")

</div>

> [@PatPatterson](#):
>
> 但了解它不包括一些场景很有帮助，包括：
> 
> - 删除文件 - Discourse 正在使用 `DeleteObjects` S3 操作一次 API 调用删除多个文件，这正是它应该做的。

是的，AWS SDK 的维护者对此不予理睬

> <https://github.com/aws/aws-sdk-js-v3/issues/6819#issuecomment-2625426822>
>
> \### Checkboxes for prior research
> 
> \- \[x\] I've gone through \[Developer Guide\](htt…ps://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide) and \[API reference\](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest)
> \- \[x\] I've checked \[AWS Forums\](https://forums.aws.amazon.com) and \[StackOverflow\](https://stackoverflow.com/questions/tagged/aws-sdk-js).
> \- \[x\] I've searched for \[previous similar issues\](https://github.com/aws/aws-sdk-js-v3/issues) and didn't find any solution.
> 
> \### Describe the bug
> 
> s3.deleteObjects sends CRC32 checksum even if \`requestChecksumCalculation\` is set to \`WHEN\_REQUIRED\`
> 
> \### Regression Issue
> 
> \- \[x\] Select this option if this issue appears to be a regression.
> 
> \### SDK version number
> 
> @aws-sdk/client-s3@2.729.0
> 
> \### Which JavaScript Runtime is this issue in?
> 
> Node.js
> 
> \### Details of the browser/Node.js/ReactNative version
> 
> All
> 
> \### Reproduction Steps
> 
> \`\`\`js
> import { S3 } from "@aws-sdk/client-s3";
> import { NodeHttpHandler } from "@smithy/node-http-handler";
> 
> class CustomHandler extends NodeHttpHandler {
> constructor() {
> super();
> }
> 
> printChecksumHeaders(prefix, headers) {
> for (const \[header, value\] of Object.entries(headers)) {
> if (
> header === "content-md5" ||
> header.startsWith("x-amz-checksum-") ||
> header.startsWith("x-amz-sdk-checksum-")
> ) {
> console.log(\`${prefix}\['${header}'\]: '${value}'\`);
> }
> }
> }
> 
> async handle(request, options) {
> this.printChecksumHeaders("request", request.headers);
> const response = await super.handle(request, options);
> this.printChecksumHeaders("response", response.response.headers);
> return response;
> }
> }
> 
> const client = new S3({
> requestHandler: new CustomHandler(),
> requestChecksumCalculation: "WHEN\_REQUIRED",
> });
> 
> const Bucket = "test-flexible-checksums-v2"; // Update to your test bucket name.
> 
> const prepareClient = new S3();
> // Populate an object in the bucket, as deleteObjects requires at least one.
> await prepareClient.putObject({ Bucket, Key: "helloworld.txt", Body: "helloworld" });
> 
> // Get list of objects to delete.
> const response = await prepareClient.listObjectsV2({ Bucket });
> const Objects = response.Contents.map(({ Key }) =\> ({ Key }));
> 
> await client.deleteObjects({ Bucket, Delete: { Objects } });
> \`\`\`
> 
> \### Observed Behavior
> 
> The CRC32 checksum is sent even if \`requestChecksumCalculation\` is set to \`WHEN\_REQUIRED\`
> 
> \`\`\`console
> $ node test.mjs
> request\['x-amz-sdk-checksum-algorithm'\]: 'CRC32'
> request\['x-amz-checksum-crc32'\]: 'uDrkBQ=='
> \`\`\`
> 
> \### Expected Behavior
> 
> When \`requestChecksumCalculation\` is set to \`WHEN\_REQUIRED\`, should it send \`md5\` like it was done in \`\<=v3.729.0\`?
> 
> Example output in \`v3.726.0\`
> \`\`\`console
> $ node test.mjs
> request\['content-md5'\]: 'rl/UEqX25ygZIHP8TWK6/g=='
> \`\`\`
> 
> \### Possible Solution
> 
> \_No response\_
> 
> \### Additional Information/Context
> 
> \_No response\_

---

_[View the full topic](https://meta.discourse.org/t/cant-rebuild-due-to-aws-sdk-gem-bump-and-new-aws-data-integrity-protections/354217)._
