Skip to content

chmod: changing permissions of '/var/run/postgresql': Operation not permitted #1144

Closed

Description

@steakhutzeee

Hi,

I'm running this in my compose:

paperless-ngx_db:
  image: docker.io/library/postgres:15
  container_name: paperless-ngx_db
  user: 1000:100
  volumes:
    - /srv/dev-disk-by-label-HC2/AppData/paperless-ngx_db/data:/var/lib/postgresql/data
    - /etc/passwd:/etc/passwd:ro
  environment:
    - POSTGRES_DB=xxx
    - POSTGRES_USER=xxx
    - POSTGRES_PASSWORD=xxx
  restart: unless-stopped

So running it as another user.

In the logs I see:


01:10:05
chmod: changing permissions of '/var/run/postgresql': Operation not permitted
01:10:05
01:10:05
PostgreSQL Database directory appears to contain a database; Skipping initialization
01:10:05
01:10:07
2023-11-23 00:10:07.997 UTC [1] LOG:  starting PostgreSQL 15.5 (Debian 15.5-1.pgdg120+1) on arm-unknown-linux-gnueabihf, compiled by gcc (Debian 12.2.0-14) 12.2.0, 32-bit
01:10:08
2023-11-23 00:10:08.072 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
01:10:08
2023-11-23 00:10:08.072 UTC [1] LOG:  listening on IPv6 address "::", port 5432
01:10:08
2023-11-23 00:10:08.275 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
01:10:08
2023-11-23 00:10:08.661 UTC [17] LOG:  database system was shut down at 2023-11-22 23:55:29 UTC
01:10:09
2023-11-23 00:10:09.021 UTC [1] LOG:  database system is ready to accept connections

Read other issues about this but I'm not sure if my compose is ok and if I can just ignore this error.

Thanks!

Activity

  1. LaurentGoderre commented on Nov 23, 2023

    @LaurentGoderre
    Member

    I am curious to know why you are overriding the user? The default user and group for postgres is 70:70

  2. steakhutzeee commented on Nov 23, 2023

    @steakhutzeee
    Author

    I am curious to know why you are overriding the user? The default user and group for postgres is 70:70

    It's an habit, i run "all" containers rootless.

  3. tianon commented on Nov 30, 2023

    @tianon
    Member

    Yeah, it's OK to ignore this error -- our entrypoint specifically ignores errors from this command because it's intended to be a best-effort change that will fail in exactly the case you're in (running as non-root). 👍

  4. locked and limited conversation to collaborators on Nov 30, 2023
  5. converted this issue into a discussion #1154 on Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions