prismicio / slice-machine

A series of tools for developing and deploying website sections with Prismic
https://prismic.io/docs
Apache License 2.0
287 stars 53 forks source link

Error: "An S3 ACL has not be initialized" when pushing changes #958

Closed angeloashmore closed 1 year ago

angeloashmore commented 1 year ago

Versions

Reproduction

N/A

Steps to reproduce

Push changes to Prismic containing a new screenshot.

What is expected?

Changes are pushed to Prismic.

What is actually happening?

An error occurs when uploading the screenshots. See the following screenshot of the error.


This error was originally reported by @draykefriesen and @tjkohli here: https://github.com/prismicio/slice-machine/issues/939#issuecomment-1532242808.

It's possible the error reported in #939 is related to the error reported here.

angeloashmore commented 1 year ago

I suggest changing ScreenshotsManager.prototype.uploadScreenshot() to initialize an S3 ACL rather than asserting that it was initialized. initS3ACL() is idempotent, so we can initialize it early and just in time in case it wasn't already initialized.

https://github.com/prismicio/slice-machine/blob/25991210dccfe334f0a41ef31824e552f1025840/packages/manager/src/managers/screenshots/ScreenshotsManager.ts#L256

That that line can become:

async uploadScreenshot(
    args: ScreenshotsManagerUploadScreenshotArgs,
): Promise<ScreenshotsManagerUploadScreenshotReturnType> {
    await this.initS3ACL();

    // ...
}
hypervillain commented 1 year ago

This should be fixed with version 1.0.3. Thanks for your report!