# Dashboard warning when s3\_backups are globally configured

**URL:** https://meta.discourse.org/t/dashboard-warning-when-s3-backups-are-globally-configured/88872
**Category:** Bug
**Created:** [May 31, 2018, 9:44pm UTC](https://meta.discourse.org/t/dashboard-warning-when-s3-backups-are-globally-configured/88872 "2018-05-31T21:44:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [May 31, 2018, 9:44pm UTC](https://meta.discourse.org/t/dashboard-warning-when-s3-backups-are-globally-configured/88872/1 "2018-05-31T21:44:20Z")

</div>

With global settings in the .yml file similar to:

```yaml
  DISCOURSE_S3_REGION: us-west-1
  DISCOURSE_S3_BUCKET: fetch-me-a-bucket
  DISCOURSE_S3_CDN_URL: https://fhqwhgads.cloudfront.net
  DISCOURSE_S3_USE_IAM_PROFILE: true
  DISCOURSE_S3_BACKUP_BUCKET: baby-got-bucket
  DISCOURSE_ENABLE_S3_BACKUPS: true

```

We get an admin dashboard warning about the backup configuration:

> ![image](https://global.discourse-cdn.com/meta/original/3X/c/5/c57bfd428c1f761d0b080c11f779df54d3b1e59a.png)

This is appearing because in `s3_config_check()` `enable_s3_backups` is shadowed by the global value, whereas the other values aren’t so `bad_keys` is triggered:

```ruby
  def s3_config_check
    bad_keys = (SiteSetting.Upload.s3_access_key_id.blank? || SiteSetting.Upload.s3_secret_access_key.blank?) && !SiteSetting.Upload.s3_use_iam_profile

    return I18n.t('dashboard.s3_config_warning') if SiteSetting.enable_s3_uploads && (bad_keys || SiteSetting.s3_upload_bucket.blank?)
    return I18n.t('dashboard.s3_backup_config_warning') if SiteSetting.enable_s3_backups && (bad_keys || SiteSetting.s3_backup_bucket.blank?)
    nil
  end

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 9, 2018, 5:42am UTC](https://meta.discourse.org/t/dashboard-warning-when-s3-backups-are-globally-configured/88872/7 "2018-07-09T05:42:31Z")

</div>

OK, I went with the simplest possible fix at:

[https://github.com/discourse/discourse/commit/330e848d4a0f8ff867ef8c52901f33b10a4ece63](https://github.com/discourse/discourse/commit/330e848d4a0f8ff867ef8c52901f33b10a4ece63)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 9, 2018, 5:42am UTC](https://meta.discourse.org/t/dashboard-warning-when-s3-backups-are-globally-configured/88872/8 "2018-07-09T05:42:35Z")

</div>


