Skip to content

postgres init error on k3s #1130

@caenauba

Description

@caenauba

I'm trying to get viseron working on my k3s cluster.

I'm using docker.io/roflcoopter/amd64-viseron 3.3.0

Starting the container the postgres db always runs into following problems:

[cont-init.d] 80-postgres: executing... ***************** Preparing PostgreSQL ******************* Database has not been initialized. Initializing... The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "C". The default database encoding has accordingly been set to "SQL_ASCII". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /config/postgresql ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Europe/Berlin creating configuration files ... ok running bootstrap script ... [cont-finish.d] executing container finish scripts... [cont-finish.d] 10-postgres: executing... Wait for Viseron to stop... error: list of process IDs must follow -p Usage: ps [options] Try 'ps --help <simple|list|output|threads|misc|all>' or 'ps --help <s|l|o|t|m|a>' for additional help text. For more details see ps(1). Viseron has stopped! Stopping PostgreSQL... pg_ctl: cannot stop server; single-user server is running (PID: 432) Waiting for PostgreSQL Server to stop... /var/run/postgresql:5432 - no response PostgreSQL Server has stopped! 2025-10-16 10:35:37.556 CEST [432] PANIC: could not open file "pg_wal/000000010000000000000001": Permission denied Aborted (core dumped) child process exited with exit code 134 initdb: removing contents of data directory "/config/postgresql" initdb: warning: could not open directory "/config/postgresql/pg_wal": Permission denied initdb: warning: could not open directory "/config/postgresql/global": Permission denied initdb: warning: could not open directory "/config/postgresql/pg_commit_ts": Permission denied initdb: warning: could not open directory "/config/postgresql/pg_dynshmem": Permission denied initdb: warning: could not open directory "/config/postgresql/pg_notify": Permission denied initdb: warning: could not open directory "/config/postgresql/pg_serial": Permission denied initdb: warning: could not open directory "/config/postgresql/pg_snapshots": Permission denied initdb: warning: could not open directory "/config/postgresql/pg_subtrans": Permission denied initdb: warning: could not open directory "/config/postgresql/pg_twophase": Permission denied initdb: warning: could not open directory "/config/postgresql/pg_multixact": Permission denied initdb: warning: could not remove file or directory "/config/postgresql/base/1/3609": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3604": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3605": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3606": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3607": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3766": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3767": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3080": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3081": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/112": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/548": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/113": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/549": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/174": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/175": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3119": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3257": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3258": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/827": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/828": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3395": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3597": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3164": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3085": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3351": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3542": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/2228": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3574": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/3575": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/5002": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/6110": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/6111": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/6112": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/6113": Permission denied initdb: warning: could not stat file or directory "/config/postgresql/base/1/6117": Permission denied initdb: warning: could not remove file or directory "/config/postgresql/base/1": Permission denied initdb: warning: could not remove file or directory "/config/postgresql/base": Directory not empty initdb: warning: could not open directory "/config/postgresql/pg_replslot": Permission denied chown: cannot read directory '/config/postgresql/pg_tblspc': No such file or directory chown: cannot read directory '/config/postgresql/pg_stat': Stale file handle initdb: warning: could not open directory "/config/postgresql/pg_stat_tmp": Permission denied initdb: warning: could not open directory "/config/postgresql/pg_logical/snapshots": Permission denied chown: cannot access '/config/postgresql/pg_logical/mappings': No such file or directory initdb: warning: could not remove file or directory "/config/postgresql/pg_logical": Directory not empty initdb: error: failed to remove contents of data directory Starting PostgreSQL... pg_ctl: could not open PID file "/config/postgresql/postmaster.pid": Permission denied [cont-finish.d] 10-postgres: exited 1. [cont-finish.d] done. [s6-finish] waiting for services. psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? Database has not been created. Creating... createdb: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? createuser: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? Stopping PostgreSQL... pg_ctl: could not open PID file "/config/postgresql/postmaster.pid": Permission denied

Is there anyway to configure an external postgres instance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions