# Permissions trouble upgrading data container

**URL:** https://meta.discourse.org/t/permissions-trouble-upgrading-data-container/327794
**Category:** Bug
**Tags:** dev-ops, fixed
**Created:** [September 23, 2024, 5:30pm UTC](https://meta.discourse.org/t/permissions-trouble-upgrading-data-container/327794 "2024-09-23T17:30:08Z")
**Posts on this page:** 5
**Page:** 1

<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: [September 23, 2024, 5:30pm UTC](https://meta.discourse.org/t/permissions-trouble-upgrading-data-container/327794/1 "2024-09-23T17:30:08Z")

</div>

I recently rebuilt a data container that was 2 years old. The new container expected different permissions than the old one did, presumably because the postgres user and group had new IDs in the current base OS.

I fixed it by running this inside the container:

```
 chown -R postgres:postgres /shared/postgres_*

```

Maybe in a single-container setup this isn’t necessary because a `chown` gets done in some other template?

The next rebuild failed because the discourse user was not allowed to enable the pgvector extension. I resolved this by running this query in postgres as the postgres user:

```
 ALTER USER discourse WITH SUPERUSER;

```

---

<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: [September 30, 2024, 9:42pm UTC](https://meta.discourse.org/t/permissions-trouble-upgrading-data-container/327794/3 "2024-09-30T21:42:34Z")

</div>

I think I saw a commit that likely fixed this, but I can’t find it now.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [October 1, 2024, 12:31am UTC](https://meta.discourse.org/t/permissions-trouble-upgrading-data-container/327794/4 "2024-10-01T00:31:10Z")

</div>

> [@pfaffman](#):
>
> presumably because the postgres user and group had new IDs in the current base OS.

I’m not 100% sure what were the user and group IDs 2 years ago but going forward [this will not change](https://github.com/discourse/discourse_docker/blob/20e33fbfd98d3b8d9c57f7a111beff8aa51a5b98/image/base/Dockerfile#L15-L22) and will be fixed.

---

<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: [October 1, 2024, 3:29pm UTC](https://meta.discourse.org/t/permissions-trouble-upgrading-data-container/327794/5 "2024-10-01T15:29:36Z")

</div>

I just had to do this again. I think what needs to happen is that

> <https://github.com/discourse/discourse_docker/blob/20e33fbfd98d3b8d9c57f7a111beff8aa51a5b98/templates/postgres.template.yml#L55>

Needs to be:

```plaintext
        chown postgres:postgres /shared/postgres_*

```

> [@tgxworld](#):
>
> I’m not 100% sure what were the user and group IDs 2 years ago

It doesn’t really matter if you `chown postgres:postgres` inside the container, right?

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [October 4, 2024, 3:29pm UTC](https://meta.discourse.org/t/permissions-trouble-upgrading-data-container/327794/6 "2024-10-04T15:29:55Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
