docker-library / postgres

Docker Official Image packaging for Postgres
http://www.postgresql.org
MIT License
2.19k stars 1.14k forks source link

Postgress Exited due to locale not found #1019

Closed meghavinam closed 1 year ago

meghavinam commented 1 year ago

Getting below error

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 ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... UTC creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok

Success. You can now start the database server using:

sh: locale: not found 2022-12-01 04:40:28.106 UTC [30] WARNING: no usable system locales were found initdb: 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. pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2022-12-01 04:40:31.494 UTC [36] LOG: starting PostgreSQL 13.9 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit 2022-12-01 04:40:31.501 UTC [36] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2022-12-01 04:40:31.522 UTC [37] LOG: database system was shut down at 2022-12-01 04:40:29 UTC 2022-12-01 04:40:31.532 UTC [36] LOG: database system is ready to accept connections done ': No such file or directory server started CREATE DATABASE

/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/init.sh

wglambert commented 1 year ago

For locales in Alpine see https://github.com/docker-library/docs/tree/master/postgres#locale-customization

meghavinam commented 1 year ago

For locales in Alpine see https://github.com/docker-library/docs/tree/master/postgres#locale-customization

WHen I Tried these same code in Ubuntu, then postgres is working but schema creation and database related chnages are not working. I checked my liquibase then its shows another error

/liquibase/docker-entrypoint-custom.sh: line 7: /dbtool/scripts/setup.sh: Permission denied /liquibase/docker-entrypoint-custom.sh: line 8: /dbtool/scripts/wait-for-it.sh: Permission denied

tianon commented 1 year ago

That's probably a permissions issue on your scripts inside that container.

For further help, I would suggest a dedicated support forum, such as the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow.