mimir icon indicating copy to clipboard operation
mimir copied to clipboard

"The endpoint must not prefixed with the bucket name" error when bucket name matches beginning of S3 endpoint

Open JustinLex opened this issue 1 year ago • 3 comments

Describe the bug

An undocumented consequence of PR #3414 is that users are not allowed to use a bucket name that matches the first subdomain on an s3 endpoint.

To Reproduce

I am using Ceph RGW to create an S3-compatible object gateway at mimir.rgw.jlh.name and a bucket named mimir. This bucket can be accessed at mimir.mimir.rgw.jlh.name or mimir.rgw.jlh.name/mimir. I use multiple RGW gateway, as different buckets may have different Ceph storage pool requirements. (e.g. ssd vs hdd)

I have configured mimir to use this bucket, but Mimir crashes with the error "error validating config: invalid rulestore config: the endpoint must not prefixed with the bucket name".

common:
    storage:
      backend: s3
      s3:
        bucket_name: "mimir"
        endpoint: "mimir.rgw.jlh.name"
        access_key_id: "${AWS_ACCESS_KEY_ID}"
        secret_access_key: "${AWS_SECRET_ACCESS_KEY}"
  blocks_storage:
      storage_prefix: blocks
  alertmanager_storage:
      storage_prefix: alertmanager
  ruler_storage:
      storage_prefix: ruler

Expected behavior

This check breaks an otherwise valid configuration, which can be a minor annoyance for users. Perhaps it should should be removed or documentation should be added.

Environment

  • Infrastructure: Kubernetes
  • Deployment tool: mimir-distributed helm

JustinLex avatar Sep 02 '24 13:09 JustinLex

Hi, I am interested to work on this issue

samyakjain10 avatar Sep 05 '24 19:09 samyakjain10

The check for the prefix was added on purpose so let's fix this via documenting the restriction 🙏

56quarters avatar Sep 26 '24 21:09 56quarters

If you'd like to add documentation about this @samyakjain10 , I can assign the issue to you.

56quarters avatar Sep 26 '24 21:09 56quarters

@56quarters I've updated the doc, could you please have a look

joobisb avatar Mar 28 '25 07:03 joobisb

@56quarters, is there an existing docs PR that corresponds to this issue? If so, I'm happy to take a look. If not, I'm happy to draft one up 😄

tacole02 avatar Apr 07 '25 17:04 tacole02

@56quarters, is there an existing docs PR that corresponds to this issue? If so, I'm happy to take a look. If not, I'm happy to draft one up 😄

There is an existing PR and it looks like you're reviewing it right now!

56quarters avatar Apr 07 '25 19:04 56quarters

haha, yes! I saw this after my comment yesterday! Thanks, @56quarters !

tacole02 avatar Apr 08 '25 16:04 tacole02