Permissions trouble upgrading data container

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;
6 Likes

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

1 Like

I’m not 100% sure what were the user and group IDs 2 years ago but going forward this will not change and will be fixed.

3 Likes

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

Needs to be:

        chown postgres:postgres /shared/postgres_*

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

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