Skip to content

PutBucketLifecycleConfiguration writing fails with MalformedXML #1944

Answered by RanVaknin
rabarar asked this question in Q&A
Discussion options

You must be logged in to vote

@rabarar ,

After taking a deeper look into this here is what I have found.

The SDK serializes Golang strcuts into XML. When you send a request without that field in the request you're essentially leaving it out of the XML.
When the service reads the XML body sent by the GO SDK Client and sees that your LifeCycleRule doesn't have a <Filter> tag, it looks for <Prefix> type and if both are missing it throws this exception.

This is all handled on the service-side, and is documented.

To show that its not a GO SDK bug I've tested it on JS SDK V3 with the following code:

❌ Incorrect:

import { S3Client, PutBucketLifecycleConfigurationCommand } from '@aws-sdk/client-s3';

const client = new S3Client(

Replies: 14 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by RanVaknin
Comment options

You must be logged in to vote
2 replies
@RanVaknin
Comment options

@joel-costigliola
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug This issue is a bug. p3 This is a minor priority issue s Effort estimation: small
4 participants
Converted from issue

This discussion was converted from issue #1722 on December 01, 2022 00:20.