Skip to content

sh: locale: not found #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bkuhl opened this issue Sep 13, 2017 · 2 comments
Closed

sh: locale: not found #337

bkuhl opened this issue Sep 13, 2017 · 2 comments

Comments

@bkuhl
Copy link

bkuhl commented Sep 13, 2017

I have the 9.6-alpine container running (I've also tried just using 9.6) and am running into a locale issue.

Kubernetes Configuration

      - name: postgres
        image: postgres:9.6-alpine
        imagePullPolicy: IfNotPresent
        env:
          - { name: "POSTGRES_DB", value: "app_db" }
          - { name: "POSTGRES_USER", value: "db_user" }
          - { name: "POSTGRES_PASSWORD", valueFrom: { secretKeyRef: { name: laravel-starter-secrets, key: db.password }} }

Container Output

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 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 ... No usable system locales were found.
Use the option "--debug" to see details.
sh: locale: not found
ok
 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 -l logfile start
 waiting for server to start....LOG:  database system was shut down at 2017-09-13 14:17:11 UTC
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
 done
server started
CREATE DATABASE
 CREATE ROLE
 /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
 waiting for server to shut down....LOG:  received fast shutdown request
LOG:  aborting any active transactions
LOG:  autovacuum launcher shutting down
LOG:  shutting down

I'm unsure how to pass --debug given the initialization script in this container. How can I debug what's happening here? My assumption is that the locale issue is preventing the container from running since I don't see any other issues in this output.

@yosifkit
Copy link
Member

Nothing is wrong, this is the natural startup of the image. The entrypoint starts PostgreSQL server as a background process that only listens on localhost, then after completing the user and database creation (and running any scripts in /docker-entrypoint-initdb.d/) it then shuts down the limited PostgreSQL server. It then replaces the running bash process (via exec) with a new start of PostgreSQL server that listens publicly which should be just a few lines later in your logs after the "PostgreSQL init process complete; ready for start up."

@AnurupMondal

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants