# Why iDrive's S3 endpoint is being rejected by Discourse?

**URL:** https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971
**Category:** Support
**Tags:** s3
**Created:** [August 29, 2024, 1:15pm UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971 "2024-08-29T13:15:05Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [August 29, 2024, 1:15pm UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/1 "2024-08-29T13:15:05Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/9/c/2/9c2179417a7d7297717e809f323d18a9bfe29a5e.png)

What format is needed by it?  
Or the very first option in the screen shot only allows Amazon Aws S3??

---

<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: [August 29, 2024, 1:36pm UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/2 "2024-08-29T13:36:21Z")

</div>

Does it work if you just put in the hostname?

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [August 29, 2024, 2:17pm UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/3 "2024-08-29T14:17:29Z")

</div>

You mean I just fill `(https://)idrivee2-51.com` in S3 CDN url?  
No, it too gave same error.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 29, 2024, 4:38pm UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/4 "2024-08-29T16:38:38Z")

</div>

Do you have trailing spaces?

---

<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: [August 30, 2024, 1:16am UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/5 "2024-08-30T01:16:00Z")

</div>

Looking at the validator, it’s:

```plaintext
  s3_endpoint:
    default: ""
    regex: '^https?:\/\/.+[^\/]$'

```

so checking the value you put in shows it’s perfectly fine:

```plaintext
[1] pry(main)> 'https://b1v7.or.idrive2-51.com'.match /^https?:\/\/.+[^\/]$/
=> #<MatchData "https://b1v7.or.idrive2-51.com">

```

You evidently have something wrong in the field. As @pfaffman suggests, check for spaces.

If it _still_ doesn’t work, does it work from the rails console?

I would expect this to fail:

```plaintext
[1] pry(main)> SiteSetting.s3_endpoint = 'gopher://b1v7.or.idrive2-51.com'
Discourse::InvalidParameters: s3_endpoint: Value doesn't match the required format.
from /home/michael/prog/Discourse/discourse/lib/site_settings/type_supervisor.rb:288:in `validate_value'

```

but this should work:

```plaintext
[1] pry(main)> SiteSetting.s3_endpoint = 'https://b1v7.or.idrive2-51.com'
=> "https://b1v7.or.idrive2-51.com"

```

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [August 30, 2024, 6:58am UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/6 "2024-08-30T06:58:43Z")

</div>

> [@pfaffman](#):
>
> Do you have trailing spaces?

No. Not at all.

But I’m surprised that today it took the same value, which it wasn’t taking till now (at all times, I was just copying with the ‘copy’ button from idrive site, and pasting here, and today also did the same).

And, now also, I think it sometimes refuses to accept a value, which it was a moment ago.  
But all in all, I’m sorted on this point now.

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [August 30, 2024, 7:01am UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/7 "2024-08-30T07:01:02Z")

</div>

Thanks, its sorted now.

But pls tell, what do I fill in (or make it blank) the `S3 CDN url` field?  
It has this value from earlier/aws times filled already: `https://bhdisco.s3.ap-south-1.amazonaws.com/uploads`

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 30, 2024, 11:07am UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/8 "2024-08-30T11:07:59Z")

</div>

You really want to put a cdn on the cdn field. You can put the bucket url, but it’ll cost more and be slower.

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [August 30, 2024, 11:40am UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/9 "2024-08-30T11:40:37Z")

</div>

> [@pfaffman](#):
>
> bucket url

Ok. I got it.  
But it all feels so cumbersome, I better go with the recommended S3 bucket provider only, AWS !! So I again reinstated the Aws id and secret.

But in doing so, I faced a new hurdle. Even though I didn’t change even a small thing inside Aws interface, except making my login more stricter, now the media uploads done into it are visible in my website only if I turn on ‘Read’ access for all ‘Public’.  
I don’t know how it was working earlier, and why only now I have to make my bucket contents ‘Permissions’ this way:

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/c/9/7c94da18fb1a5ea9b8bd88a1e347e2bfc059b787.png)

( Both showing in red color have been changed by me now, otherwise I’m not able to even preview my own uploads)

---

<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: [August 30, 2024, 4:00pm UTC](https://meta.discourse.org/t/why-idrives-s3-endpoint-is-being-rejected-by-discourse/323971/10 "2024-08-30T16:00:12Z")

</div>

> [@Bathinda](#):
>
> But pls tell, what do I fill in (or make it blank) the `S3 CDN url` field?

If you haven’t configured a CDN in front of your bucket store, leave it blank.
