apecloud / kubeblocks

KubeBlocks is an open-source control plane software that runs and manages databases, message queues and other stateful applications on K8s.
https://kubeblocks.io
GNU Affero General Public License v3.0
2.11k stars 173 forks source link

[BUG] postgresql cluster create error: patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster' #5958

Closed JashBook closed 11 months ago

JashBook commented 11 months ago

Describe the bug postgresql cluster create error:patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster'.

To Reproduce Steps to reproduce the behavior:

  1. create postgresql cluster
    kubectl apply -f -<<EOF
    apiVersion: apps.kubeblocks.io/v1alpha1
    kind: Cluster
    metadata:
    name: postgres-vdxbhk
    namespace: default
    spec:
    clusterDefinitionRef: postgresql
    clusterVersionRef: postgresql-12.14.0
    terminationPolicy: Delete
    componentSpecs:
    - name: postgresql
      componentDef: postgresql-12
      replicas: 2
      resources:
        requests:
          cpu: 100m
          memory: 0.5Gi
        limits:
          cpu: 100m
          memory: 0.5Gi
      updateStrategy: BestEffortParallel
      switchPolicy:
        type: Noop
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 3Gi
    EOF
  2. See error
    ➜  ~ kubectl get cluster  
    NAME                     CLUSTER-DEFINITION   VERSION                             TERMINATION-POLICY   STATUS     AGE
    postgres-telmhi          postgresql           postgresql-14.8.0-pgvector-v0.5.0   WipeOut              Running    14m
    postgres-telmhi-backup   postgresql           postgresql-14.8.0-pgvector-v0.5.0   WipeOut              Creating   36s
    postgres-vdxbhk          postgresql           postgresql-12.14.0                  Delete               Creating   10m
    ➜  ~ 
    ➜  ~ 
    ➜  ~ kubectl get pod
    NAME                                            READY   STATUS    RESTARTS       AGE
    postgres-vdxbhk-postgresql-0                    4/5     Running   0              10m
    postgres-vdxbhk-postgresql-1                    4/5     Running   0              10m

    logs pod

    
    ➜  ~ kubectl logs postgres-vdxbhk-postgresql-0 postgresql
    2023-11-29 11:30:18,927 - bootstrapping - INFO - Figuring out my environment (Google? AWS? Openstack? Local?)
    2023-11-29 11:30:19,679 - bootstrapping - INFO - No meta-data available for this provider
    2023-11-29 11:30:19,680 - bootstrapping - INFO - Looks like you are running unsupported
    2023-11-29 11:30:19,821 - bootstrapping - INFO - kubeblocks generate local configuration: 
    bootstrap:
    dcs:
    postgresql:
      parameters:
        archive_command: /bin/true
        archive_mode: 'on'
        autovacuum_analyze_scale_factor: '0.1'
        autovacuum_max_workers: '3'
        autovacuum_vacuum_scale_factor: '0.05'
        checkpoint_completion_target: '0.9'
        log_autovacuum_min_duration: '10000'
        log_checkpoints: 'True'
        log_connections: 'False'
        log_disconnections: 'False'
        log_min_duration_statement: '1000'
        log_statement: ddl
        log_temp_files: 128kB
        max_connections: '56'
        max_locks_per_transaction: '64'
        max_prepared_transactions: '100'
        max_replication_slots: '16'
        max_wal_senders: '64'
        max_worker_processes: '8'
        tcp_keepalives_idle: 45s
        tcp_keepalives_interval: 10s
        track_commit_timestamp: 'False'
        track_functions: pl
        wal_compression: 'True'
        wal_keep_size: '0'
        wal_level: replica
        wal_log_hints: 'False'
    initdb:
    - auth-host: md5
    - auth-local: trust
    postgresql:
    config_dir: /home/postgres/pgdata/conf
    custom_conf: /home/postgres/conf/postgresql.conf
    parameters:
    pg_stat_statements.track_utility: 'False'
    shared_buffers: 128MB
    pg_hba:
    - host     all             all             0.0.0.0/0                md5
    - host     all             all             ::/0                     md5
    - local    all             all                                     trust
    - host     all             all             127.0.0.1/32            trust
    - host     all             all             ::1/128                 trust
    - local     replication     all                                    trust
    - host      replication     all             0.0.0.0/0               md5
    - host      replication     all             ::/0                    md5

2023-11-29 11:30:20,819 - bootstrapping - INFO - Configuring patroni 2023-11-29 11:30:20,922 - bootstrapping - INFO - Writing to file /run/postgres.yml 2023-11-29 11:30:20,924 - bootstrapping - INFO - Configuring standby-cluster 2023-11-29 11:30:20,924 - bootstrapping - INFO - Configuring certificate 2023-11-29 11:30:20,925 - bootstrapping - INFO - Generating ssl self-signed certificate 2023-11-29 11:30:23,825 - bootstrapping - INFO - Configuring bootstrap 2023-11-29 11:30:23,825 - bootstrapping - INFO - Configuring log 2023-11-29 11:30:23,918 - bootstrapping - INFO - Configuring pgqd 2023-11-29 11:30:23,919 - bootstrapping - INFO - Configuring pam-oauth2 2023-11-29 11:30:23,919 - bootstrapping - INFO - No PAM_OAUTH2 configuration was specified, skipping 2023-11-29 11:30:23,919 - bootstrapping - INFO - Configuring pgbouncer 2023-11-29 11:30:23,919 - bootstrapping - INFO - No PGBOUNCER_CONFIGURATION was specified, skipping 2023-11-29 11:30:23,919 - bootstrapping - INFO - Configuring wal-e 2023-11-29 11:30:23,919 - bootstrapping - INFO - Configuring crontab 2023-11-29 11:30:23,921 - bootstrapping - INFO - Skipping creation of renice cron job due to lack of SYS_NICE capability 2023-11-29 11:30:28,224 INFO: Selected new K8s API server endpoint https://192.168.49.2:8443 2023-11-29 11:30:28,722 INFO: No PostgreSQL configuration items changed, nothing to reload. 2023-11-29 11:30:28,821 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:30:29,017 INFO: waiting for leader to bootstrap 2023-11-29 11:30:39,520 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:30:39,522 INFO: waiting for leader to bootstrap 2023-11-29 11:30:49,515 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:30:49,605 INFO: waiting for leader to bootstrap 2023-11-29 11:30:59,409 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:30:59,458 INFO: trying to bootstrap a new cluster 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 /home/postgres/pgdata/pgroot/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 ... Etc/UTC creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... 2023-11-29 11:31:09,412 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:31:09,504 INFO: not healthy enough for leader race 2023-11-29 11:31:09,607 INFO: bootstrap in progress ok

Success. You can now start the database server using:

/usr/lib/postgresql/12/bin/pg_ctl -D /home/postgres/pgdata/pgroot/data -l logfile start

2023-11-29 11:31:14,109 INFO: postmaster pid=133 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_scale_factor" in file "/home/postgres/conf/postgresql.conf" line 222 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_threshold" in file "/home/postgres/conf/postgresql.conf" line 223 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "client_connection_check_interval" in file "/home/postgres/conf/postgresql.conf" line 224 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "compute_query_id" in file "/home/postgres/conf/postgresql.conf" line 225 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "default_toast_compression" in file "/home/postgres/conf/postgresql.conf" line 226 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "enable_async_append" in file "/home/postgres/conf/postgresql.conf" line 227 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "enable_incremental_sort" in file "/home/postgres/conf/postgresql.conf" line 228 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "enable_memoize" in file "/home/postgres/conf/postgresql.conf" line 229 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "hash_mem_multiplier" in file "/home/postgres/conf/postgresql.conf" line 230 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "idle_session_timeout" in file "/home/postgres/conf/postgresql.conf" line 231 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "log_min_duration_sample" in file "/home/postgres/conf/postgresql.conf" line 232 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "log_parameter_max_length" in file "/home/postgres/conf/postgresql.conf" line 233 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "log_parameter_max_length_on_error" in file "/home/postgres/conf/postgresql.conf" line 234 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "log_recovery_conflict_waits" in file "/home/postgres/conf/postgresql.conf" line 235 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "log_statement_sample_rate" in file "/home/postgres/conf/postgresql.conf" line 236 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "logical_decoding_work_mem" in file "/home/postgres/conf/postgresql.conf" line 237 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "maintenance_io_concurrency" in file "/home/postgres/conf/postgresql.conf" line 238 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "max_slot_wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 239 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "min_dynamic_shared_memory" in file "/home/postgres/conf/postgresql.conf" line 240 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "remove_temp_files_after_crash" in file "/home/postgres/conf/postgresql.conf" line 241 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "track_wal_io_timing" in file "/home/postgres/conf/postgresql.conf" line 242 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "vacuum_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 243 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "vacuum_multixact_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 244 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 245 2023-11-29 11:31:14.303 GMT [133] LOG: unrecognized configuration parameter "wal_skip_threshold" in file "/home/postgres/conf/postgresql.conf" line 246 2023-11-29 11:31:14.303 GMT [133] FATAL: configuration file "/home/postgres/conf/postgresql.conf" contains errors /var/run/postgresql:5432 - no response 2023-11-29 11:31:15,413 ERROR: postmaster is not running 2023-11-29 11:31:15,503 INFO: removing initialize key after failed attempt to bootstrap the cluster 2023-11-29 11:31:15,605 INFO: renaming data directory to /home/postgres/pgdata/pgroot/data.failed Traceback (most recent call last): File "/usr/local/bin/patroni", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 144, in main return patroni_main() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 136, in patroni_main abstract_main(Patroni, schema) File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 181, in abstract_main controller.run() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 106, in run super(Patroni, self).run() File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 126, in run self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 109, in _run_cycle logger.info(self.ha.run_cycle()) File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1770, in run_cycle info = self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1592, in _run_cycle return self.post_bootstrap() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1483, in post_bootstrap self.cancel_initialization() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1476, in cancel_initialization raise PatroniFatalException('Failed to bootstrap cluster') patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster' /etc/runit/runsvdir/default/patroni: finished with code=1 signal=0 /etc/runit/runsvdir/default/patroni: sleeping 30 seconds 2023-11-29 11:31:49,000 INFO: Selected new K8s API server endpoint https://192.168.49.2:8443 2023-11-29 11:31:49,396 INFO: No PostgreSQL configuration items changed, nothing to reload. 2023-11-29 11:31:49,492 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:31:49,593 INFO: trying to bootstrap a new cluster 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.

creating directory /home/postgres/pgdata/pgroot/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 ... Etc/UTC creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... 2023-11-29 11:32:00,488 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:32:00,489 INFO: not healthy enough for leader race 2023-11-29 11:32:00,691 INFO: bootstrap in progress ok syncing data to disk ... ok

Success. You can now start the database server using:

/usr/lib/postgresql/12/bin/pg_ctl -D /home/postgres/pgdata/pgroot/data -l logfile start

2023-11-29 11:32:07.988 GMT [196] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_scale_factor" in file "/home/postgres/conf/postgresql.conf" line 222 2023-11-29 11:32:07.988 GMT [196] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_threshold" in file "/home/postgres/conf/postgresql.conf" line 223 2023-11-29 11:32:07.988 GMT [196] LOG: unrecognized configuration parameter "client_connection_check_interval" in file "/home/postgres/conf/postgresql.conf" line 224 2023-11-29 11:32:07.988 GMT [196] LOG: unrecognized configuration parameter "compute_query_id" in file "/home/postgres/conf/postgresql.conf" line 225 2023-11-29 11:32:07.988 GMT [196] LOG: unrecognized configuration parameter "default_toast_compression" in file "/home/postgres/conf/postgresql.conf" line 226 2023-11-29 11:32:07.988 GMT [196] LOG: unrecognized configuration parameter "enable_async_append" in file "/home/postgres/conf/postgresql.conf" line 227 2023-11-29 11:32:07.988 GMT [196] LOG: unrecognized configuration parameter "enable_incremental_sort" in file "/home/postgres/conf/postgresql.conf" line 228 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "enable_memoize" in file "/home/postgres/conf/postgresql.conf" line 229 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "hash_mem_multiplier" in file "/home/postgres/conf/postgresql.conf" line 230 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "idle_session_timeout" in file "/home/postgres/conf/postgresql.conf" line 231 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "log_min_duration_sample" in file "/home/postgres/conf/postgresql.conf" line 232 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "log_parameter_max_length" in file "/home/postgres/conf/postgresql.conf" line 233 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "log_parameter_max_length_on_error" in file "/home/postgres/conf/postgresql.conf" line 234 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "log_recovery_conflict_waits" in file "/home/postgres/conf/postgresql.conf" line 235 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "log_statement_sample_rate" in file "/home/postgres/conf/postgresql.conf" line 236 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "logical_decoding_work_mem" in file "/home/postgres/conf/postgresql.conf" line 237 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "maintenance_io_concurrency" in file "/home/postgres/conf/postgresql.conf" line 238 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "max_slot_wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 239 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "min_dynamic_shared_memory" in file "/home/postgres/conf/postgresql.conf" line 240 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "remove_temp_files_after_crash" in file "/home/postgres/conf/postgresql.conf" line 241 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "track_wal_io_timing" in file "/home/postgres/conf/postgresql.conf" line 242 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "vacuum_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 243 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "vacuum_multixact_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 244 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 245 2023-11-29 11:32:07.989 GMT [196] LOG: unrecognized configuration parameter "wal_skip_threshold" in file "/home/postgres/conf/postgresql.conf" line 246 2023-11-29 11:32:07.989 GMT [196] FATAL: configuration file "/home/postgres/conf/postgresql.conf" contains errors 2023-11-29 11:32:08,089 INFO: postmaster pid=196 /var/run/postgresql:5432 - no response 2023-11-29 11:32:08,197 INFO: removing initialize key after failed attempt to bootstrap the cluster 2023-11-29 11:32:08,300 INFO: renaming data directory to /home/postgres/pgdata/pgroot/data.failed Traceback (most recent call last): File "/usr/local/bin/patroni", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 144, in main return patroni_main() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 136, in patroni_main abstract_main(Patroni, schema) File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 181, in abstract_main controller.run() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 106, in run super(Patroni, self).run() File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 126, in run self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 109, in _run_cycle logger.info(self.ha.run_cycle()) File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1770, in run_cycle info = self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1592, in _run_cycle return self.post_bootstrap() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1483, in post_bootstrap self.cancel_initialization() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1476, in cancel_initialization raise PatroniFatalException('Failed to bootstrap cluster') patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster' /etc/runit/runsvdir/default/patroni: finished with code=1 signal=0 /etc/runit/runsvdir/default/patroni: sleeping 60 seconds ... 2023-11-29 11:35:00,998 INFO: Selected new K8s API server endpoint https://192.168.49.2:8443 2023-11-29 11:35:01,287 INFO: No PostgreSQL configuration items changed, nothing to reload. 2023-11-29 11:35:01,291 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:35:01,516 INFO: trying to bootstrap a new cluster 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.

creating directory /home/postgres/pgdata/pgroot/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 ... Etc/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:

/usr/lib/postgresql/12/bin/pg_ctl -D /home/postgres/pgdata/pgroot/data -l logfile start

2023-11-29 11:35:11,987 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:35:11,987 INFO: not healthy enough for leader race 2023-11-29 11:35:12,191 INFO: bootstrap in progress 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_scale_factor" in file "/home/postgres/conf/postgresql.conf" line 222 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_threshold" in file "/home/postgres/conf/postgresql.conf" line 223 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "client_connection_check_interval" in file "/home/postgres/conf/postgresql.conf" line 224 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "compute_query_id" in file "/home/postgres/conf/postgresql.conf" line 225 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "default_toast_compression" in file "/home/postgres/conf/postgresql.conf" line 226 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "enable_async_append" in file "/home/postgres/conf/postgresql.conf" line 227 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "enable_incremental_sort" in file "/home/postgres/conf/postgresql.conf" line 228 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "enable_memoize" in file "/home/postgres/conf/postgresql.conf" line 229 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "hash_mem_multiplier" in file "/home/postgres/conf/postgresql.conf" line 230 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "idle_session_timeout" in file "/home/postgres/conf/postgresql.conf" line 231 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "log_min_duration_sample" in file "/home/postgres/conf/postgresql.conf" line 232 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "log_parameter_max_length" in file "/home/postgres/conf/postgresql.conf" line 233 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "log_parameter_max_length_on_error" in file "/home/postgres/conf/postgresql.conf" line 234 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "log_recovery_conflict_waits" in file "/home/postgres/conf/postgresql.conf" line 235 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "log_statement_sample_rate" in file "/home/postgres/conf/postgresql.conf" line 236 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "logical_decoding_work_mem" in file "/home/postgres/conf/postgresql.conf" line 237 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "maintenance_io_concurrency" in file "/home/postgres/conf/postgresql.conf" line 238 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "max_slot_wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 239 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "min_dynamic_shared_memory" in file "/home/postgres/conf/postgresql.conf" line 240 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "remove_temp_files_after_crash" in file "/home/postgres/conf/postgresql.conf" line 241 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "track_wal_io_timing" in file "/home/postgres/conf/postgresql.conf" line 242 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "vacuum_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 243 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "vacuum_multixact_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 244 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 245 2023-11-29 11:35:15.692 GMT [360] LOG: unrecognized configuration parameter "wal_skip_threshold" in file "/home/postgres/conf/postgresql.conf" line 246 2023-11-29 11:35:15.692 GMT [360] FATAL: configuration file "/home/postgres/conf/postgresql.conf" contains errors 2023-11-29 11:35:15,888 INFO: postmaster pid=360 /var/run/postgresql:5432 - no response 2023-11-29 11:35:16,289 INFO: removing initialize key after failed attempt to bootstrap the cluster 2023-11-29 11:35:16,305 INFO: renaming data directory to /home/postgres/pgdata/pgroot/data.failed Traceback (most recent call last): File "/usr/local/bin/patroni", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 144, in main return patroni_main() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 136, in patroni_main abstract_main(Patroni, schema) File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 181, in abstract_main controller.run() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 106, in run super(Patroni, self).run() File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 126, in run self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 109, in _run_cycle logger.info(self.ha.run_cycle()) File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1770, in run_cycle info = self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1592, in _run_cycle return self.post_bootstrap() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1483, in post_bootstrap self.cancel_initialization() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1476, in cancel_initialization raise PatroniFatalException('Failed to bootstrap cluster') patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster' /etc/runit/runsvdir/default/patroni: finished with code=1 signal=0 /etc/runit/runsvdir/default/patroni: sleeping 120 seconds 2023-11-29 11:37:21,690 INFO: Selected new K8s API server endpoint https://192.168.49.2:8443 2023-11-29 11:37:21,889 INFO: No PostgreSQL configuration items changed, nothing to reload. 2023-11-29 11:37:21,987 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:37:22,090 INFO: trying to bootstrap a new cluster 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.

creating directory /home/postgres/pgdata/pgroot/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 ... Etc/UTC creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... 2023-11-29 11:37:32,690 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:37:32,786 INFO: not healthy enough for leader race 2023-11-29 11:37:32,889 INFO: bootstrap in progress ok syncing data to disk ... ok

Success. You can now start the database server using:

/usr/lib/postgresql/12/bin/pg_ctl -D /home/postgres/pgdata/pgroot/data -l logfile start

2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_scale_factor" in file "/home/postgres/conf/postgresql.conf" line 222 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_threshold" in file "/home/postgres/conf/postgresql.conf" line 223 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "client_connection_check_interval" in file "/home/postgres/conf/postgresql.conf" line 224 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "compute_query_id" in file "/home/postgres/conf/postgresql.conf" line 225 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "default_toast_compression" in file "/home/postgres/conf/postgresql.conf" line 226 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "enable_async_append" in file "/home/postgres/conf/postgresql.conf" line 227 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "enable_incremental_sort" in file "/home/postgres/conf/postgresql.conf" line 228 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "enable_memoize" in file "/home/postgres/conf/postgresql.conf" line 229 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "hash_mem_multiplier" in file "/home/postgres/conf/postgresql.conf" line 230 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "idle_session_timeout" in file "/home/postgres/conf/postgresql.conf" line 231 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "log_min_duration_sample" in file "/home/postgres/conf/postgresql.conf" line 232 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "log_parameter_max_length" in file "/home/postgres/conf/postgresql.conf" line 233 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "log_parameter_max_length_on_error" in file "/home/postgres/conf/postgresql.conf" line 234 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "log_recovery_conflict_waits" in file "/home/postgres/conf/postgresql.conf" line 235 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "log_statement_sample_rate" in file "/home/postgres/conf/postgresql.conf" line 236 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "logical_decoding_work_mem" in file "/home/postgres/conf/postgresql.conf" line 237 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "maintenance_io_concurrency" in file "/home/postgres/conf/postgresql.conf" line 238 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "max_slot_wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 239 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "min_dynamic_shared_memory" in file "/home/postgres/conf/postgresql.conf" line 240 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "remove_temp_files_after_crash" in file "/home/postgres/conf/postgresql.conf" line 241 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "track_wal_io_timing" in file "/home/postgres/conf/postgresql.conf" line 242 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "vacuum_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 243 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "vacuum_multixact_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 244 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 245 2023-11-29 11:37:41.890 GMT [452] LOG: unrecognized configuration parameter "wal_skip_threshold" in file "/home/postgres/conf/postgresql.conf" line 246 2023-11-29 11:37:41.890 GMT [452] FATAL: configuration file "/home/postgres/conf/postgresql.conf" contains errors 2023-11-29 11:37:41,890 INFO: postmaster pid=452 /var/run/postgresql:5432 - no response 2023-11-29 11:37:42,630 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-0 2023-11-29 11:37:42,631 INFO: not healthy enough for leader race 2023-11-29 11:37:42,741 INFO: bootstrap in progress 2023-11-29 11:37:43,090 ERROR: postmaster is not running 2023-11-29 11:37:43,091 INFO: removing initialize key after failed attempt to bootstrap the cluster 2023-11-29 11:37:43,190 INFO: renaming data directory to /home/postgres/pgdata/pgroot/data.failed Traceback (most recent call last): File "/usr/local/bin/patroni", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 144, in main return patroni_main() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 136, in patroni_main abstract_main(Patroni, schema) File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 181, in abstract_main controller.run() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 106, in run super(Patroni, self).run() File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 126, in run self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 109, in _run_cycle logger.info(self.ha.run_cycle()) File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1770, in run_cycle info = self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1592, in _run_cycle return self.post_bootstrap() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1483, in post_bootstrap self.cancel_initialization() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1476, in cancel_initialization raise PatroniFatalException('Failed to bootstrap cluster') patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster' /etc/runit/runsvdir/default/patroni: finished with code=1 signal=0 /etc/runit/runsvdir/default/patroni: exceeded maximum number of restarts 5 stopping /etc/runit/runsvdir/default/patroni timeout: finish: .: (pid 472) 34s, want down ➜ ~

➜ ~ kubectl logs postgres-vdxbhk-postgresql-1 postgresql 2023-11-29 11:30:19,620 - bootstrapping - INFO - Figuring out my environment (Google? AWS? Openstack? Local?) 2023-11-29 11:30:20,459 - bootstrapping - INFO - No meta-data available for this provider 2023-11-29 11:30:20,460 - bootstrapping - INFO - Looks like you are running unsupported 2023-11-29 11:30:20,720 - bootstrapping - INFO - kubeblocks generate local configuration: bootstrap: dcs: postgresql: parameters: archive_command: /bin/true archive_mode: 'on' autovacuum_analyze_scale_factor: '0.1' autovacuum_max_workers: '3' autovacuum_vacuum_scale_factor: '0.05' checkpoint_completion_target: '0.9' log_autovacuum_min_duration: '10000' log_checkpoints: 'True' log_connections: 'False' log_disconnections: 'False' log_min_duration_statement: '1000' log_statement: ddl log_temp_files: 128kB max_connections: '56' max_locks_per_transaction: '64' max_prepared_transactions: '100' max_replication_slots: '16' max_wal_senders: '64' max_worker_processes: '8' tcp_keepalives_idle: 45s tcp_keepalives_interval: 10s track_commit_timestamp: 'False' track_functions: pl wal_compression: 'True' wal_keep_size: '0' wal_level: replica wal_log_hints: 'False' initdb:

2023-11-29 11:30:21,126 - bootstrapping - INFO - Configuring certificate 2023-11-29 11:30:21,127 - bootstrapping - INFO - Generating ssl self-signed certificate 2023-11-29 11:30:22,323 - bootstrapping - INFO - Configuring pam-oauth2 2023-11-29 11:30:22,324 - bootstrapping - INFO - No PAM_OAUTH2 configuration was specified, skipping 2023-11-29 11:30:22,324 - bootstrapping - INFO - Configuring standby-cluster 2023-11-29 11:30:22,324 - bootstrapping - INFO - Configuring pgbouncer 2023-11-29 11:30:22,324 - bootstrapping - INFO - No PGBOUNCER_CONFIGURATION was specified, skipping 2023-11-29 11:30:22,324 - bootstrapping - INFO - Configuring bootstrap 2023-11-29 11:30:22,324 - bootstrapping - INFO - Configuring pgqd 2023-11-29 11:30:22,417 - bootstrapping - INFO - Configuring crontab 2023-11-29 11:30:22,418 - bootstrapping - INFO - Skipping creation of renice cron job due to lack of SYS_NICE capability 2023-11-29 11:30:22,421 - bootstrapping - INFO - Configuring patroni 2023-11-29 11:30:22,518 - bootstrapping - INFO - Writing to file /run/postgres.yml 2023-11-29 11:30:22,519 - bootstrapping - INFO - Configuring log 2023-11-29 11:30:22,519 - bootstrapping - INFO - Configuring wal-e 2023-11-29 11:30:26,928 INFO: Selected new K8s API server endpoint https://192.168.49.2:8443 2023-11-29 11:30:27,320 INFO: No PostgreSQL configuration items changed, nothing to reload. 2023-11-29 11:30:27,326 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-1 2023-11-29 11:30:27,440 INFO: trying to bootstrap a new cluster 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 /home/postgres/pgdata/pgroot/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 ... Etc/UTC creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... 2023-11-29 11:30:38,418 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-1 2023-11-29 11:30:38,418 INFO: not healthy enough for leader race 2023-11-29 11:30:39,016 INFO: bootstrap in progress ok syncing data to disk ... ok

Success. You can now start the database server using:

/usr/lib/postgresql/12/bin/pg_ctl -D /home/postgres/pgdata/pgroot/data -l logfile start

2023-11-29 11:30:48,805 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-1 2023-11-29 11:30:48,903 INFO: not healthy enough for leader race 2023-11-29 11:30:49,207 INFO: bootstrap in progress 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_scale_factor" in file "/home/postgres/conf/postgresql.conf" line 222 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_threshold" in file "/home/postgres/conf/postgresql.conf" line 223 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "client_connection_check_interval" in file "/home/postgres/conf/postgresql.conf" line 224 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "compute_query_id" in file "/home/postgres/conf/postgresql.conf" line 225 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "default_toast_compression" in file "/home/postgres/conf/postgresql.conf" line 226 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "enable_async_append" in file "/home/postgres/conf/postgresql.conf" line 227 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "enable_incremental_sort" in file "/home/postgres/conf/postgresql.conf" line 228 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "enable_memoize" in file "/home/postgres/conf/postgresql.conf" line 229 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "hash_mem_multiplier" in file "/home/postgres/conf/postgresql.conf" line 230 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "idle_session_timeout" in file "/home/postgres/conf/postgresql.conf" line 231 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "log_min_duration_sample" in file "/home/postgres/conf/postgresql.conf" line 232 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "log_parameter_max_length" in file "/home/postgres/conf/postgresql.conf" line 233 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "log_parameter_max_length_on_error" in file "/home/postgres/conf/postgresql.conf" line 234 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "log_recovery_conflict_waits" in file "/home/postgres/conf/postgresql.conf" line 235 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "log_statement_sample_rate" in file "/home/postgres/conf/postgresql.conf" line 236 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "logical_decoding_work_mem" in file "/home/postgres/conf/postgresql.conf" line 237 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "maintenance_io_concurrency" in file "/home/postgres/conf/postgresql.conf" line 238 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "max_slot_wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 239 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "min_dynamic_shared_memory" in file "/home/postgres/conf/postgresql.conf" line 240 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "remove_temp_files_after_crash" in file "/home/postgres/conf/postgresql.conf" line 241 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "track_wal_io_timing" in file "/home/postgres/conf/postgresql.conf" line 242 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "vacuum_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 243 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "vacuum_multixact_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 244 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 245 2023-11-29 11:30:53.506 GMT [134] LOG: unrecognized configuration parameter "wal_skip_threshold" in file "/home/postgres/conf/postgresql.conf" line 246 2023-11-29 11:30:53.507 GMT [134] FATAL: configuration file "/home/postgres/conf/postgresql.conf" contains errors 2023-11-29 11:30:53,709 INFO: postmaster pid=134 /var/run/postgresql:5432 - no response 2023-11-29 11:30:54,113 INFO: removing initialize key after failed attempt to bootstrap the cluster 2023-11-29 11:30:54,259 INFO: renaming data directory to /home/postgres/pgdata/pgroot/data.failed Traceback (most recent call last): File "/usr/local/bin/patroni", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 144, in main return patroni_main() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 136, in patroni_main abstract_main(Patroni, schema) File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 181, in abstract_main controller.run() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 106, in run super(Patroni, self).run() File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 126, in run self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 109, in _run_cycle logger.info(self.ha.run_cycle()) File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1770, in run_cycle info = self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1592, in _run_cycle return self.post_bootstrap() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1483, in post_bootstrap self.cancel_initialization() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1476, in cancel_initialization raise PatroniFatalException('Failed to bootstrap cluster') patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster' /etc/runit/runsvdir/default/patroni: finished with code=1 signal=0 /etc/runit/runsvdir/default/patroni: sleeping 30 seconds ... 2023-11-29 11:34:36,288 INFO: Selected new K8s API server endpoint https://192.168.49.2:8443 2023-11-29 11:34:36,689 INFO: No PostgreSQL configuration items changed, nothing to reload. 2023-11-29 11:34:36,693 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-1 2023-11-29 11:34:36,890 INFO: trying to bootstrap a new cluster 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.

creating directory /home/postgres/pgdata/pgroot/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 ... Etc/UTC creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... 2023-11-29 11:34:47,287 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-1 2023-11-29 11:34:47,288 INFO: not healthy enough for leader race 2023-11-29 11:34:47,306 INFO: bootstrap in progress ok

Success. You can now start the database server using:

/usr/lib/postgresql/12/bin/pg_ctl -D /home/postgres/pgdata/pgroot/data -l logfile start

2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_scale_factor" in file "/home/postgres/conf/postgresql.conf" line 222 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_threshold" in file "/home/postgres/conf/postgresql.conf" line 223 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "client_connection_check_interval" in file "/home/postgres/conf/postgresql.conf" line 224 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "compute_query_id" in file "/home/postgres/conf/postgresql.conf" line 225 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "default_toast_compression" in file "/home/postgres/conf/postgresql.conf" line 226 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "enable_async_append" in file "/home/postgres/conf/postgresql.conf" line 227 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "enable_incremental_sort" in file "/home/postgres/conf/postgresql.conf" line 228 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "enable_memoize" in file "/home/postgres/conf/postgresql.conf" line 229 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "hash_mem_multiplier" in file "/home/postgres/conf/postgresql.conf" line 230 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "idle_session_timeout" in file "/home/postgres/conf/postgresql.conf" line 231 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "log_min_duration_sample" in file "/home/postgres/conf/postgresql.conf" line 232 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "log_parameter_max_length" in file "/home/postgres/conf/postgresql.conf" line 233 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "log_parameter_max_length_on_error" in file "/home/postgres/conf/postgresql.conf" line 234 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "log_recovery_conflict_waits" in file "/home/postgres/conf/postgresql.conf" line 235 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "log_statement_sample_rate" in file "/home/postgres/conf/postgresql.conf" line 236 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "logical_decoding_work_mem" in file "/home/postgres/conf/postgresql.conf" line 237 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "maintenance_io_concurrency" in file "/home/postgres/conf/postgresql.conf" line 238 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "max_slot_wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 239 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "min_dynamic_shared_memory" in file "/home/postgres/conf/postgresql.conf" line 240 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "remove_temp_files_after_crash" in file "/home/postgres/conf/postgresql.conf" line 241 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "track_wal_io_timing" in file "/home/postgres/conf/postgresql.conf" line 242 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "vacuum_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 243 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "vacuum_multixact_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 244 2023-11-29 11:34:49.795 GMT [362] LOG: unrecognized configuration parameter "wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 245 2023-11-29 11:34:49.887 GMT [362] LOG: unrecognized configuration parameter "wal_skip_threshold" in file "/home/postgres/conf/postgresql.conf" line 246 2023-11-29 11:34:49.887 GMT [362] FATAL: configuration file "/home/postgres/conf/postgresql.conf" contains errors 2023-11-29 11:34:49,992 INFO: postmaster pid=362 /var/run/postgresql:5432 - no response 2023-11-29 11:34:50,089 INFO: removing initialize key after failed attempt to bootstrap the cluster 2023-11-29 11:34:50,135 INFO: renaming data directory to /home/postgres/pgdata/pgroot/data.failed Traceback (most recent call last): File "/usr/local/bin/patroni", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 144, in main return patroni_main() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 136, in patroni_main abstract_main(Patroni, schema) File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 181, in abstract_main controller.run() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 106, in run super(Patroni, self).run() File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 126, in run self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 109, in _run_cycle logger.info(self.ha.run_cycle()) File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1770, in run_cycle info = self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1592, in _run_cycle return self.post_bootstrap() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1483, in post_bootstrap self.cancel_initialization() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1476, in cancel_initialization raise PatroniFatalException('Failed to bootstrap cluster') patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster' /etc/runit/runsvdir/default/patroni: finished with code=1 signal=0 /etc/runit/runsvdir/default/patroni: sleeping 120 seconds 2023-11-29 11:36:56,000 INFO: Selected new K8s API server endpoint https://192.168.49.2:8443 2023-11-29 11:36:56,292 INFO: No PostgreSQL configuration items changed, nothing to reload. 2023-11-29 11:36:56,299 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-1 2023-11-29 11:36:56,462 INFO: trying to bootstrap a new cluster 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.

creating directory /home/postgres/pgdata/pgroot/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 ... Etc/UTC creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... 2023-11-29 11:37:07,089 INFO: Lock owner: None; I am postgres-vdxbhk-postgresql-1 2023-11-29 11:37:07,090 INFO: not healthy enough for leader race 2023-11-29 11:37:07,192 INFO: bootstrap in progress ok syncing data to disk ... ok

Success. You can now start the database server using:

/usr/lib/postgresql/12/bin/pg_ctl -D /home/postgres/pgdata/pgroot/data -l logfile start

2023-11-29 11:37:14.589 GMT [459] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_scale_factor" in file "/home/postgres/conf/postgresql.conf" line 222 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "autovacuum_vacuum_insert_threshold" in file "/home/postgres/conf/postgresql.conf" line 223 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "client_connection_check_interval" in file "/home/postgres/conf/postgresql.conf" line 224 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "compute_query_id" in file "/home/postgres/conf/postgresql.conf" line 225 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "default_toast_compression" in file "/home/postgres/conf/postgresql.conf" line 226 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "enable_async_append" in file "/home/postgres/conf/postgresql.conf" line 227 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "enable_incremental_sort" in file "/home/postgres/conf/postgresql.conf" line 228 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "enable_memoize" in file "/home/postgres/conf/postgresql.conf" line 229 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "hash_mem_multiplier" in file "/home/postgres/conf/postgresql.conf" line 230 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "idle_session_timeout" in file "/home/postgres/conf/postgresql.conf" line 231 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "log_min_duration_sample" in file "/home/postgres/conf/postgresql.conf" line 232 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "log_parameter_max_length" in file "/home/postgres/conf/postgresql.conf" line 233 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "log_parameter_max_length_on_error" in file "/home/postgres/conf/postgresql.conf" line 234 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "log_recovery_conflict_waits" in file "/home/postgres/conf/postgresql.conf" line 235 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "log_statement_sample_rate" in file "/home/postgres/conf/postgresql.conf" line 236 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "logical_decoding_work_mem" in file "/home/postgres/conf/postgresql.conf" line 237 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "maintenance_io_concurrency" in file "/home/postgres/conf/postgresql.conf" line 238 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "max_slot_wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 239 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "min_dynamic_shared_memory" in file "/home/postgres/conf/postgresql.conf" line 240 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "remove_temp_files_after_crash" in file "/home/postgres/conf/postgresql.conf" line 241 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "track_wal_io_timing" in file "/home/postgres/conf/postgresql.conf" line 242 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "vacuum_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 243 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "vacuum_multixact_failsafe_age" in file "/home/postgres/conf/postgresql.conf" line 244 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "wal_keep_size" in file "/home/postgres/conf/postgresql.conf" line 245 2023-11-29 11:37:14.688 GMT [459] LOG: unrecognized configuration parameter "wal_skip_threshold" in file "/home/postgres/conf/postgresql.conf" line 246 2023-11-29 11:37:14.688 GMT [459] FATAL: configuration file "/home/postgres/conf/postgresql.conf" contains errors 2023-11-29 11:37:14,794 INFO: postmaster pid=459 /var/run/postgresql:5432 - no response 2023-11-29 11:37:14,991 INFO: removing initialize key after failed attempt to bootstrap the cluster 2023-11-29 11:37:15,136 INFO: renaming data directory to /home/postgres/pgdata/pgroot/data.failed Traceback (most recent call last): File "/usr/local/bin/patroni", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 144, in main return patroni_main() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 136, in patroni_main abstract_main(Patroni, schema) File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 181, in abstract_main controller.run() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 106, in run super(Patroni, self).run() File "/usr/local/lib/python3.10/dist-packages/patroni/daemon.py", line 126, in run self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/main.py", line 109, in _run_cycle logger.info(self.ha.run_cycle()) File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1770, in run_cycle info = self._run_cycle() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1592, in _run_cycle return self.post_bootstrap() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1483, in post_bootstrap self.cancel_initialization() File "/usr/local/lib/python3.10/dist-packages/patroni/ha.py", line 1476, in cancel_initialization raise PatroniFatalException('Failed to bootstrap cluster') patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster' /etc/runit/runsvdir/default/patroni: finished with code=1 signal=0 /etc/runit/runsvdir/default/patroni: exceeded maximum number of restarts 5 stopping /etc/runit/runsvdir/default/patroni timeout: finish: .: (pid 467) 33s, want down ➜ ~



**Expected behavior**
postgresql cluster create success.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
Y-Rookie commented 11 months ago

fix at addons repo