Using S3Client->headObject returns ObjectLockRetainUntilDate even when Object Lock is disabled on bucket #1897
Labels
breaking-change
Issue requires a breaking change to remediate.
feature-request
A feature should be added or improved.
needs-major-version
Can only be considered for the next major release
no-autoclose
This issue should not be auto-closed by stale-issue-cleanup action.
p3
This is a minor priority issue
v4
Version of PHP (
php -v
)?7.3.9
What issue did you see?
When I use headObject() from the PHP SDK, the
ObjectLockRetainUntilDate
value is output even though the bucket hasObject Lock
Disabled:Output:
Note,
ObjectLockMode
andObjectLockLegalHoldStatus
are null butObjectLockRetainUntilDate
is set:Additional context
I ran into this issue because we use
copyObject()
, supplingMetadata
for the sink object by fetching it from the source object usingheadObject()
. This means, after upgrading our SDK we suddenly started trying to set theObjectLockRetainUntilDate
for the sink object. WhenObject Lock
is disabled for a bucket, if you provideObjectLockRetainUntilDate
in theMetadata
thecopyObject
throws a error:The workaround is to remove the
ObjectLockRetainUntilDate
from theheadObject
output, e.g.I feel it would be more logical to not have a
ObjectLockRetainUntilDate
output ifObject Lock
is disabled on the bucket. Close this issue if you dissagree, no worries.Version of AWS SDK for PHP?
This issue happens from 3.76.0 and higher (tested up to 3.115.1). The CHANGELOG for 3.76.0 says:
From 3.75.0 and lower headObject does not output ObjectLockRetainUntilDate ✔️
The text was updated successfully, but these errors were encountered: