# Rebuild failed S3 rake aborted

**URL:** <https://meta.discourse.org/t/rebuild-failed-s3-rake-aborted/208680>\
**Category:** Bug\
**Created:** [November 9, 2021, 3:35pm UTC](https://meta.discourse.org/t/rebuild-failed-s3-rake-aborted/208680 "2021-11-09T15:35:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)\
**Post date:** [November 9, 2021, 3:45pm UTC](https://meta.discourse.org/t/rebuild-failed-s3-rake-aborted/208680/2 "2021-11-09T15:45:49Z")

</div>

this was recently merged

> <https://github.com/discourse/discourse/pull/14802>
>
> This commit introduces a new s3:ensure\_cors\_rules rake task
> that is run as a pr…erequisite to s3:upload\_assets. This rake
> task calls out to the S3CorsRulesets class to ensure that
> the 3 relevant sets of CORS rules are applied, depending on
> site settings:
> 
> \* assets
> \* direct S3 backups
> \* direct S3 uploads
> 
> This works for both Global S3 settings and Database S3 settings
> (the latter set directly via SiteSetting).
> 
> As it is, only one rule can be applied, which is generally
> the assets rule as it is called first. This commit changes
> the ensure\_cors! method to be able to apply new rules as
> well as the existing ones.
> 
> This commit also slightly changes the existing rules to cover
> direct S3 uploads via uppy, especially multipart, which requires
> some more headers.
> 
> \*\*NOTE: Please do not merge this, I will merge it once some internal infrastructure has shifted.\*\*

@cvx @martin

---

_[View the full topic](https://meta.discourse.org/t/rebuild-failed-s3-rake-aborted/208680)._
