Skip to content
Advertisement

boto3 s3 Object expiration “MalformedXML” error

I’m trying to set the lifecycle configuration of a subdirectory in Amazon S3 bucket by using boto3 put_bucket_lifecycle_configuration. I used this code from aws documentation as referece:

JavaScript

I removed Transitions and added Expiration, to better fit my purpouses. Here is my code:

JavaScript

The error I’m receiving is:

JavaScript

What could be causing this error?

Advertisement

Answer

I followed @Michael-sqlbot suggestion and found the reason it wasn’t working.

The problem in this settings is in 'ExpiredObjectDeleteMarker': True that is inside Expiration key. In boto3 documentation there is an observation about it.

'ExpiredObjectDeleteMarker' cannot be specified with Days or Date in a Lifecycle Expiration Policy.

Fixing it, the settings will be:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement