-
Notifications
You must be signed in to change notification settings - Fork 9.5k
bitnami postgresql chart deployment crashloop #32943
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
Comments
Hi is there any way to get some help on this? |
Im pretty sure it has to do with the nature of the replication of the longhorn pv and the postgres replication being redundant and causing issues so I tried local-path-provisioner bound to a specific worker node and I still get the same crashlooping. I have validated that the deployment does create the files but then crashes and deletes them. ~]# ls -ltr /opt/local-path-provisioner/postgres-data/data/
total 76
drwx------. 4 user1 user1 4096 Apr 11 17:18 pg_wal
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_twophase
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_subtrans
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_snapshots
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_serial
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_notify
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_dynshmem
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_commit_ts
drwx------. 2 user1 user1 4096 Apr 11 17:18 global
-rw-------. 1 user1 user1 0 Apr 11 17:18 postgresql.conf
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_xact
-rw-------. 1 user1 user1 3 Apr 11 17:18 PG_VERSION
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_tblspc
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_stat_tmp
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_stat
drwx------. 2 user1 user1 4096 Apr 11 17:18 pg_replslot
drwx------. 4 user1 user1 4096 Apr 11 17:18 pg_multixact
drwx------. 4 user1 user1 4096 Apr 11 17:18 pg_logical
drwx------. 3 user1 user1 4096 Apr 11 17:18 base
-rw-------. 1 user1 user1 67 Apr 11 17:18 postmaster.pid |
I also watched resources and see nothing indicative of OOM or any resource constriction. I was wondering if it might be a data ownership issue in the pv as with the local-path the ownership is my local server user, "user1" for this anonymized data, and thought it probably is meant to be the postgres user? |
When I boot a test pod and try to run postgresql I see the following: I have no name!@pg-debugger:/bitnami/postgresql$ /opt/bitnami/scripts/postgresql/run.sh
postgresql 17:54:58.92 INFO ==> ** Starting PostgreSQL **
'2025-04-11 17:54:58.952 GMT [16] LOG: skipping missing configuration file "/bitnami/postgresql/data/postgresql.auto.conf"
2025-04-11 17:54:58.952 GMT [16] FATAL: "/bitnami/postgresql/data" is not a valid data directory
2025-04-11 17:54:58.952 GMT [16] DETAIL: File "/bitnami/postgresql/data/PG_VERSION" is missing. |
Aliased as postgresql and ran the initdb, I get the following I have no name!@pg-debugger:/$ whoami
postgres
I have no name!@pg-debugger:/$ /opt/bitnami/postgresql/bin/initdb -D /bitnami/postgresql/data
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 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 /bitnami/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 25
selecting default "shared_buffers" ... 400kB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... Bus error (core dumped)
child process exited with exit code 135
initdb: removing contents of data directory "/bitnami/postgresql/data" |
Even with "volumes": [{
"name": "pgdata",
"emptyDir": {} I still get the same bus error. I think this is linked in some way to mmap, I am not familiar enough with the build process to perform further debug on this... |
Bitnami containers are designed to operate as non-root by default. Consequently, any files or directories used by the application should be owned by the root group, as the random user (1001 by default) is a member of this root group. To ensure proper permissions, you'll need to adjust the ownership of your local directory accordingly. For more comprehensive information about non-root containers and their significance for security, you can explore the following resources:
These references provide valuable insights into the best practices and considerations when working with non-root containers in Bitnami applications. |
Name and Version
bitnami/postgresql-16.6.2
What architecture are you using?
amd64
What steps will reproduce the bug?
The error appears consistently during PostgreSQL database initialization with both 17.4.0 and 15.5.0 versions, and occurs specifically when PostgreSQL's initdb process tries to create configuration files.RetryClaude can make mistakes. Please double-check responses.
Are you using any custom parameters or values?
postgresql-values.yaml is
What is the expected behavior?
I expect the statefulSet to deploy and be useable and accessible with the
supersecretpassword
and theph_admin
What do you see instead?
Additional information
I am not sure what I am doing wrong in my deployment to cause this repeated error.
creating configuration files ... ok Bus error (core dumped) child process exited with exit code 135
I have also tried a MUCH more simplified version of my values file with no change in behavior.
The text was updated successfully, but these errors were encountered: