zonkyio / embedded-postgres

Java embedded PostgreSQL component for testing
Apache License 2.0
344 stars 43 forks source link

Postgres not started due to permissions #40

Closed alekseysotnikov closed 3 years ago

alekseysotnikov commented 4 years ago

When am starting EmbeddedPostgres is fails with a strange error. Does anybody know how to fix it?

The files belonging to this database system will be owned by user “xxxx”.
This user must also own the server process.
initdb: invalid locale settings; check LANG and LC_* environment variables

and stack-strace

java.lang.IllegalStateException: Process [target/postgres-working-dir/PG-73dc0043fe7bdb624d5e8726bc457b7e/bin/initdb, -A, trust, -U, postgres, -D, target/postgres-data-dir, -E, UTF-8] failed

       com.opentable.db.postgres.embedded.EmbeddedPostgres.system  EmbeddedPostgres.java:  602
       com.opentable.db.postgres.embedded.EmbeddedPostgres.initdb  EmbeddedPostgres.java:  221
       com.opentable.db.postgres.embedded.EmbeddedPostgres.<init>  EmbeddedPostgres.java:  142
com.opentable.db.postgres.embedded.EmbeddedPostgres$Builder.start  EmbeddedPostgres.java:  554
tomix26 commented 4 years ago

I think there is a solution to your problem: https://github.com/zonkyio/embedded-postgres/issues/11#issuecomment-533468269

tomix26 commented 3 years ago

No response, closing the issue.