S3 backups for multisite show up in root directory of bucket

AI-generated summary

A user, pfaffman, reports an issue with S3 backups for a multisite Discourse instance where backups from multisite instances are stored in the root directory of the S3 bucket instead of in their respective site-specific directories. Despite the backups succeeding and the main site’s backups appearing correctly, the multisite backups are not organized properly. The user suspects a configuration error, possibly a missing comma or incorrect path, but cannot identify the issue. They note that manually moving the files to the correct directory makes them visible in the backups. Another user, gerhard, asks if the issue was resolved, to which pfaffman replies that they don’t recall and haven’t heard back from the client, as it’s been a year since the issue occurred.

I just set up a multisite instance with backups via S3 like this in web_only.yml. I followed Set up file and image uploads to S3 and let discourse create the bucket when it did the backup.

  DISCOURSE_S3_BACKUP_BUCKET: lc-client-name
  DISCOURSE_S3_SECRET_ACCESS_KEY: valid=key  
  DISCOURSE_S3_ACCESS_KEY_ID: secret

Backups for the main site and the multisites succeed, but only the main site can see the backups. I thought it was a permissions issue by the client who configured the bucket, but when I look at the bucket via the S3 web interface
I see a default directory that holds backup as expected, but the other sites are saving their backups in the root of the bucket, not in site-name.

multisite.conf has stanzas like

sitename:
  adapter: postgresql
  database: sitename
  pool: 25
  timeout: 5000
  host: data
  password: so-secret
  host_names:
    - community.sitename.com

I feel like I must once again be doing something silly like a missing comma, but I’m not seeing it.

And if I create a directory called “sitename” on the s3 web interface and move the file there then it does show up in backups.

It appears that somehow files are getting uploaded to the wrong place, but it’s listing existing backups from the correct place.

Could it be a :bug: ?

Did you ever solve this? Is it still an issue?

I honestly can’t remember. I think that I set it up for them and haven’t heard back. (Oh, and it’s been a year, so that explains why I can’t remember.)