Getting AccessControlListNotSupported: The bucket does not allow ACLs error from S3

129 Views Asked by At

Trying to execute a GitHub Actions workflow that creates a xlsx file and upload the file to S3 bucket and getting the error:

AccessControlListNotSupported: The bucket does not allow ACLs

The error pops up when the GitHub Actions workflow is executed, however when I execute it from the localhost environment it works normally.

I've already defined permissions for "Object Ownership, Access control list (ACL), Bucket policy.

Bucket Policy

Bucket policy

Access Control List (ACL)

Access Control List(ACL)

Object Ownership

Object Ownership

Block public access (bucket settings)

Block public access (bucket settings)

const aclHeader = 'public-read';

return client.send(
  new PutObjectCommand({
    Bucket: bucket,
    Key: filename,
    Body: xlsxContent,
    ContentType:
      'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
    ACL: aclHeader,
  })
);
1

There are 1 best solutions below

0
Christian Loris On

Verify you have not put an enforcement mechanism in place that could be blocking the use of ACLs despite your settings. https://docs.aws.amazon.com/AmazonS3/latest/userguide/ensure-object-ownership.html