Skip to content

DB restore fails due to file permissions of postgres.auto.conf #54

@bmironov

Description

@bmironov

Hello,

Whole process of restoring DB from backup can fail on last step of recovering postgres.auto.conf due to restrictive file permissions:

{"level":"info","ts":"2025-12-25T09:03:10.30929347+07:00","logger":"pgbackrest restore","msg":"WARN: unknown user in backup manifest mapped to current user","pipe":"stderr","logging_pod":"db-is-adv-dev-16-1-full-recovery"}
{"level":"info","ts":"2025-12-25T09:03:10.309331306+07:00","logger":"pgbackrest restore","msg":"WARN: unknown group in backup manifest mapped to current group","pipe":"stderr","logging_pod":"db-is-adv-dev-16-1-full-recovery"}
{"level":"info","ts":"2025-12-25T09:03:12.798950572+07:00","logger":"pgbackrest restore","msg":"ERROR: [041]: unable to open file '/var/lib/postgresql/data/pgdata/postgresql.auto.conf' for write: [13] Permission denied","pipe":"stderr","logging_pod":"db-is-adv-dev-16-1-full-recovery"}

Above error happens on PostgreSQL 16 vanilla image supplied with cnpg. The file has read only (400) permissions.
This is not happening with PostgreSQL 17, which comes with read/write permissions (600). PostgreSQL 18 has even more relaxed permissions of 660.

I'm not sure in root cause of the issue, but looks like sidecar is running under different from postgres:tape system ID. Hence above WARN messages,

Corresponding issue is opened for cnpg itself in case of issue on CNPG-I API level.

Best regards

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