tinify-nodejs icon indicating copy to clipboard operation
tinify-nodejs copied to clipboard

the Store function throw an error with 'ServerError: The bucket does not allow ACLs. (HTTP 500/Storage failed).'

Open rumaniel opened this issue 2 years ago • 1 comments

Hello Team.

I finally found your awesome solution so I tried to implement the solution to upload to S3.

tinifyResult.store({
        service: "s3",
        aws_access_key_id: this.accessKeyId,
        aws_secret_access_key: this.secretAccessKey,
        region: this.region,
        path: `${this.bucket}/${s3Path}`,
      })

But I got an error with "ServerError: The Bucket does not allow ACLs. (HTTP 500/Storage failed)".

The IAM has the following permissions.

        Effect = "Allow",
        Action = [
          "s3:GetObject",
          "s3:GetObjectAcl",
          "s3:DeleteObject",
          "s3:PutObject",
          "s3:PutObjectAcl"
        ],

But the Bucket and objects have no public access. The objects are distributed via CloudFront. So the end users can access on CDN.

In this case, how can I resolve this problem?

Optionally, I checked that I can upload via the aws s3 plugin. So it's possible to tinify it locally and upload via the s3 plugin.

Thanks.

rumaniel avatar Dec 28 '23 01:12 rumaniel

Hello,

Currently the Tinify API is only able to store the image on buckets that do not block public access. We are planning to fix this in the future but sadly right now it will only work with 'block public access' disabled.

tinify-support avatar Jan 02 '24 10:01 tinify-support

Hello! We have introduced a new optional parameter called "acl" for the API. This parameter can be configured to "no-acl" in order to enable storage without public permissions or ACL settings.

You can find more details it in the API documentation.

PabloPerezDeCiriza avatar Apr 30 '24 09:04 PabloPerezDeCiriza

Cool. I tested it with "no-acl" configured and checked it works correctly.

Thank you for your support with an awesome solution.

I'll close this issue.

rumaniel avatar Jun 04 '24 01:06 rumaniel