Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Content-MD5 on PutObjectLockConfigurationRequest #5848

Open
1 task done
Se7enShawn opened this issue Jan 31, 2025 · 2 comments
Open
1 task done

Missing Content-MD5 on PutObjectLockConfigurationRequest #5848

Se7enShawn opened this issue Jan 31, 2025 · 2 comments
Assignees
Labels
bug This issue is a bug. p1 This is a high priority issue potential-regression Marking this issue as a potential regression to be checked by team member

Comments

@Se7enShawn
Copy link

Se7enShawn commented Jan 31, 2025

Describe the bug

From 2.30 version calling PutObjectLockConfigurationRequest Content-MD5 header is no longer generated

Regression Issue

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

Expected Behavior

This is the log with 2.29.x:

Sending Request: DefaultSdkHttpFullRequest(httpMethod=PUT, protocol=https, host=****-**.******.it, encodedPath=/202513116343bucket, headers=[amz-sdk-invocation-id, Content-Length, Content-MD5, Content-Type, User-Agent], queryParameters=[object-lock])

Current Behavior

This is the log with 2.30.x:

Sending Request: DefaultSdkHttpFullRequest(httpMethod=PUT, protocol=https, host=****-**.******.it, encodedPath=/202513116104bucket, headers=[amz-sdk-invocation-id, Content-Length, Content-Type, User-Agent], queryParameters=[object-lock])

Reproduction Steps

PutObjectLockConfigurationRequest polcr = PutObjectLockConfigurationRequest.builder()
		.bucket(bucketName)
		.objectLockConfiguration(ObjectLockConfiguration.builder()
			.objectLockEnabled(ObjectLockEnabled.ENABLED)
			.rule(ObjectLockRule.builder()
								
.defaultRetention(DefaultRetention.builder().mode(ObjectLockRetentionMode.COMPLIANCE).days(Integer.valueOf(1)).build())
			.build())
		.build())
	.build();
CompletableFuture<PutObjectLockConfigurationResponse> polc = s3Client.putObjectLockConfiguration(polcr);

Possible Solution

Generate the Content-MD5 for the request

Additional Information/Context

No response

AWS Java SDK version used

2.30.10

JDK version used

17

Operating System and version

Windows 11 and Unix

@Se7enShawn Se7enShawn added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 31, 2025
@bhoradc
Copy link

bhoradc commented Jan 31, 2025

Hi @Se7enShawn,

Thank you for reporting the issue. In AWS SDK for Java 2.30.0, we introduced changes to the S3 client that adopts new default integrity protections, as announced in discussion #5802.

From the logs, I see you are connecting to a third-party S3-compatible storage (host=sgws-ts.insiel.it), and seem affected by the new checksum changes mentioned above.

Did you get a chance to try the temporary workaround mentioned in the shared announcement? You can disable the new behavior with the WHEN_REQUIRED value for the request_checksum_calculation and response_checksum_validation configuration options covered in Data Integrity Protections for Amazon S3.

You should check with the third-party storage provider regarding the support for the changes introduced on v2.30.0.

Let me know if you see any concerns regarding this change when using the AWS S3 directly.

Regards,
Chaitanya

@bhoradc bhoradc added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p1 This is a high priority issue potential-regression Marking this issue as a potential regression to be checked by team member and removed needs-triage This issue or PR still needs to be triaged. labels Jan 31, 2025
@bhoradc bhoradc self-assigned this Jan 31, 2025
@Se7enShawn
Copy link
Author

Se7enShawn commented Feb 3, 2025

Thank you,
also setting the system properties:

System.setProperty("aws.requestChecksumCalculation", "WHEN_REQUIRED");
System.setProperty("aws.responseChecksumValidation", "WHEN_REQUIRED");

Content-MD5 is not generated on PutObjectLockConfigurationRequest:

Sending Request: DefaultSdkHttpFullRequest(httpMethod=PUT, protocol=https, host=****-**.******.it, encodedPath=/202523102917bucket, headers=[amz-sdk-invocation-id, Content-Length, Content-Type, User-Agent], queryParameters=[object-lock])

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p1 This is a high priority issue potential-regression Marking this issue as a potential regression to be checked by team member
Projects
None yet
Development

No branches or pull requests

2 participants