ecs-object-client-java icon indicating copy to clipboard operation
ecs-object-client-java copied to clipboard

Sending SetObjectRetentionRequest doesn't work

Open snekkboii opened this issue 2 years ago • 1 comments

Whenever I send a SetObjectRetentionRequest, I get an error saying the content is empty:

com.emc.object.s3.S3Exception: This happens when the user sends an empty xml document as a request. The error message is, "Request body is empty." at com.emc.object.s3.jersey.ErrorFilter.parseErrorResponse(ErrorFilter.java:134) at com.emc.object.s3.jersey.ErrorFilter.handle(ErrorFilter.java:69) at com.emc.object.s3.jersey.RetryFilter.handle(RetryFilter.java:65) ...

Here's my code:

public void putRetentionTimeOnObjectEcm(String bucket, String key, Date date){
        var request = new com.emc.object.s3.request.SetObjectRetentionRequest(bucket,key)
                .withRetention(new com.emc.object.s3.bean.ObjectLockRetention()
                        .withMode(com.emc.object.s3.bean.ObjectLockRetentionMode.GOVERNANCE)
                        .withRetainUntilDate(date));

        ecmS3Client.setObjectRetention(request);
    }

snekkboii avatar Nov 02 '23 14:11 snekkboii

@snekkboii we cannot reproduce the issue on the latest version and ECS 3.8. Please kindly provide ECS version, object client version and your OS information, if you are still facing the issue from your side. Thanks.

dunedodo avatar Dec 04 '23 10:12 dunedodo

@snekkboii As it has been a long time since the last response, I'll close the ticket. Please feel free to reopen it if you hit the same issue.

dunedodo avatar Jul 09 '24 07:07 dunedodo