bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.08k stars 9.25k forks source link

postgresql on CrashLoop, where is error? #8749

Closed 0ljik closed 2 years ago

0ljik commented 2 years ago

Which chart: bitnami/postgresql

Describe the bug I am trying to install PostgreSQL on microk8s (minikube also fails). Pods are on a CrashLoop just from start. Logs show nothing, describe gives no useful info. I am frustrated that there is no information to debug.

To Reproduce

helm install my-release -n postgres --create-namespace bitnami/postgresql

Expected behavior

Additional context Here is

$ kubectl logs -n postgres my-prelease-postgresql-0
postgresql 00:08:48.35
postgresql 00:08:48.36 Welcome to the Bitnami postgresql container
postgresql 00:08:48.36 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-postgresql
postgresql 00:08:48.36 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-postgresql/issues
postgresql 00:08:48.36
postgresql 00:08:48.38 INFO  ==> ** Starting PostgreSQL setup **
postgresql 00:08:48.41 INFO  ==> Validating settings in POSTGRESQL_* env vars..
postgresql 00:08:48.42 INFO  ==> Loading custom pre-init scripts...
postgresql 00:08:48.42 INFO  ==> Initializing PostgreSQL database...
postgresql 00:08:48.44 INFO  ==> pg_hba.conf file not detected. Generating it...
postgresql 00:08:48.44 INFO  ==> Generating local authentication configuration
0ljik commented 2 years ago

somehow remembered that I was playing with limits and hugepages before. Disabling hugepages made it work.

carrodher commented 2 years ago

I'm glad the issue was solved, I'm closing this ticket, feel free to reopen it if you face the same issue again.

jdevries3133 commented 1 year ago

I experienced the same issue. Can we change the title to be more descriptive? I googled for this like a madman and never found anything relevant for quite some time.

I'd suggest:

CrashLoop on microk8s: postgresql crashes during"Generating local authentication configuration"

For the actual issue, I think this is related to microk8s' openebs plugin moving to openebs Myastor in microk8s version 1.24. Indeed, I'm upgrading from 1.23 to 1.26 and seeing this issue crop up.

Microk8s docs include instructions for setting up hugepages: https://microk8s.io/docs/addon-mayastor.

I'm continuing to try to learn more about this issue, but don't know much at this point.

I tried deploying the chart with debug mode enabled, and this is what I see:

Defaulted container "postgresql" out of: postgresql, metrics, init-chmod-data (init)
postgresql 19:04:16.48 
postgresql 19:04:16.48 Welcome to the Bitnami postgresql container
postgresql 19:04:16.48 Subscribe to project updates by watching https://github.com/bitnami/containers
postgresql 19:04:16.48 Submit issues and feature requests at https://github.com/bitnami/containers/issues
postgresql 19:04:16.49 
postgresql 19:04:16.49 DEBUG ==> Configuring libnss_wrapper...
postgresql 19:04:16.50 INFO  ==> ** Starting PostgreSQL setup **
postgresql 19:04:16.52 INFO  ==> Validating settings in POSTGRESQL_* env vars..
postgresql 19:04:16.52 INFO  ==> Loading custom pre-init scripts...
postgresql 19:04:16.53 INFO  ==> Initializing PostgreSQL database...
postgresql 19:04:16.53 DEBUG ==> Ensuring expected directories/files exist...
postgresql 19:04:16.54 INFO  ==> pg_hba.conf file not detected. Generating it...
postgresql 19:04:16.54 INFO  ==> Generating local authentication configuration
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.UTF-8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /bitnami/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 20
selecting default shared_buffers ... 400kB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
Bus error (core dumped)
child process exited with exit code 135
initdb: removing contents of data directory "/bitnami/postgresql/data"
running bootstrap script ... %                                                                                    

So, maybe the crash happens in this bootstrap script?