s3proxy
s3proxy copied to clipboard
Unable to do CompleteMultipart to s3
Hello Guys,
I'm trying to do the "CompleteMultipartUpload" using the java restTemplate as follows, and I see below errors. Here my endpoint is pointing to s3proxy service, that was configured to AWS-S3.
CompleteMultipartUpload requestBody = new CompleteMultipartUpload(
parts.stream().map(part -> new CompleteMultipartUpload.Part(part.getPartNumber(), part.getETag()))
.sorted(Comparator.comparingInt(CompleteMultipartUpload.Part::getPartNumber)).collect(Collectors.toList()));
HttpEntity<CompleteMultipartUpload> requestEntity = new HttpEntity<>(requestBody, headers);
try {
ResponseEntity<Map> response = restTemplate.exchange(uri, HttpMethod.POST, requestEntity, Map.class);
log.info("Completed multipart upload :'{}'", response.getBody());
}catch (Throwable e) {
throw new MultipartUploadFailureException("Error completing multipart upload for uploadId "
+ uploadId + "at path " + path, e);
}
"{<EOL>"cause0":"com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "etag" (class org.gaul.s3proxy.CompleteMultipartUploadRequest$Part), not marked as ignorable (2 known properties: "PartNumber", "ETag"])\n at [Source: (org.gaul.shaded.org.eclipse.jetty.server.HttpInput); line: 1, column: 148] (through reference chain: org.gaul.s3proxy.CompleteMultipartUploadRequest["Part"]->java.util.ArrayList[0]->org.gaul.s3proxy.CompleteMultipartUploadRequest$Part["etag"])",<EOL>"message":"com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "etag" (class org.gaul.s3proxy.CompleteMultipartUploadRequest$Part), not marked as ignorable (2 known properties: "PartNumber", "ETag"])\n at [Source: (org.gaul.shaded.org.eclipse.jetty.server.HttpInput); line: 1, column: 148] (through reference chain: org.gaul.s3proxy.CompleteMultipartUploadRequest["Part"]->java.util.ArrayList[0]->org.gaul.s3proxy.CompleteMultipartUploadRequest$Part["etag"])",<EOL>"url":"/saas-dev-connection-catalog-bucket/7413117d-d496-4a34-839e-cc9ccbe866fa/133285bf-35a5-4092-83ce-0c2790b9ed95.file",<EOL>"status":"500"<EOL>}"
Please let me know what is going wrong.
Thanks
How do you issue this REST request? It appears that the client is sending etag when it should send ETag (partially capitalized). Ideally you can fix the client to do this. Otherwise you could try setting MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES in the XmlMapper instance.
Thank you by fixing the Mapper to read from "ETag", it resolved