Permissions trouble upgrading data container

AI-generated summary

Users are experiencing permissions trouble when upgrading their data container in a multi-container setup. pfaffman fixed the issue by running chown -R postgres:postgres /shared/postgres_* inside the container and ALTER USER discourse WITH SUPERUSER; in postgres. This was due to changes in the postgres user and group IDs in the base OS. tgxworld noted that the user and group IDs are now fixed and will not change going forward. To prevent this issue in the future, pfaffman suggested updating the postgres.template.yml to include chown postgres:postgres /shared/postgres_*, as the actual IDs used do not matter.

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.