Open halkyon opened 5 days ago
Example cases:
[cloudshell-user@ip-10-132-73-175 ~]$ aws s3api put-object-lock-configuration \
--bucket bucket \
--object-lock-configuration 'ObjectLockEnabled=string,Rule={DefaultRetention={Mode=a,Days=1,Years=1}}'
An error occurred (MalformedXML) when calling the PutObjectLockConfiguration operation: The XML you provided was not well-formed or did not validate against our published schema
MalformedXML
is returned for invalid or missing fields, like ObjectLockEnabled
, and DefaultRetention
. From what I can tell, it only ever returns a generic malformed XML error with no specific details.
More specific InvalidArgument
error cases occur for the following:
[cloudshell-user@ip-10-132-73-175 ~]$ aws s3api put-object-lock-configuration \
--bucket bucket \
--object-lock-configuration 'ObjectLockEnabled=Enabled,Rule={DefaultRetention={Mode=GOVERNANCE,Days=-1}}'
An error occurred (InvalidArgument) when calling the PutObjectLockConfiguration operation: Default retention period must be a positive integer value.
[cloudshell-user@ip-10-132-73-175 ~]$ aws s3api put-object-lock-configuration \
--bucket bucket \
--object-lock-configuration 'ObjectLockEnabled=Enabled,Rule={DefaultRetention={Mode=GOVERNANCE,Days=999999999}}'
An error occurred (InvalidArgument) when calling the PutObjectLockConfiguration operation: Default retention period too large.
Change {cmd,pkg}: fix error codes returned for PutObjectLockConfiguration mentions this issue.
PutObjectLockConfiguration for invalid lock config on AWS S3 has two different error codes, since AWS doesn't seem to be consistent here:
At the moment, we return
InvalidArgument
for either of the above cases, so we need to return a different code for the second case if we want to fix these tests:Upstream Minio also has the same problem, so we would need to patch our fork with new code to make the changes: https://github.com/storj/minio/blob/main/cmd/bucket-handlers.go#L1058