Closed
Description
#560 This is not environment issue and should be fixed asap.
We cannot run any database containers if some file flags are not replicated to mount destinations.
I hit the same issue running postgres container. When postgres tries to fsync files to mounted volume, it shows some errors:
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 "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/base/1": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/base/12406": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/base/12407": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/base": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/global": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_clog": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_commit_ts": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_dynshmem": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_logical/mappings": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_logical/snapshots": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_logical": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_multixact/members": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_multixact/offsets": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_multixact": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_notify": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_replslot": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_serial": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_snapshots": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_stat": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_stat_tmp": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_subtrans": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_tblspc": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_twophase": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_xlog/archive_status": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_xlog": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata": Invalid argument
initdb: could not fsync file "/var/lib/postgresql/data/pgdata/pg_tblspc": Invalid argument
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
syncing data to disk ... ok
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data/pgdata -l logfile start
waiting for server to start....FATAL: data directory "/var/lib/postgresql/data/pgdata" has wrong ownership
HINT: The server must be started by the user that owns the data directory.
pg_ctl: could not start server
Examine the log output.
stopped waiting