bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.93k stars 9.18k forks source link

[bitnami/postgresql-ha] pgpool syntax error in configuration file #11817

Closed alexanderursu99 closed 7 months ago

alexanderursu99 commented 2 years ago

Name and Version

bitnami/postgresql-ha 9.3.3

What steps will reproduce the bug?

Deploying Helm chart on EKS 1.21

Are you using any custom parameters or values?

Currently have these values set for pgpool section in the Helm chart:

pgpool:
  image:
    registry: docker.io
    repository: bitnami/pgpool
    tag: 4.3.2-debian-11-r26
    debug: true
  ## @param pgpool.customUsersSecret Name of a secret containing the usernames and passwords of accounts that will be added to pgpool_passwd
  ## The secret must contain the keys "usernames" and "passwords" respectively.
  ##
  customUsersSecret: ""
  existingSecret: postgresql-ha-pgpool-creds
  ## @param pgpool.srCheckDatabase Name of the database to perform streaming replication checks
  ##
  srCheckDatabase: postgres
  replicaCount: 1
  topologySpreadConstraints: []
  podAntiAffinityPreset: soft
  nodeSelector: {}
  resources:
    limits: {}
    requests: {}
  pdb:
    create: false
    minAvailable: 1
    maxUnavailable: ""
  updateStrategy: {}
  ## @param pgpool.minReadySeconds How many seconds a pod needs to be ready before killing the next, during update
  ##
  minReadySeconds: ""
  adminUsername: admin
  usePasswordFile: true
  authenticationMethod: scram-sha-256
  logConnections: false
  logHostname: true
  logPerNodeStatement: false
  logLinePrefix: ""
  clientMinMessages: error
  ## ref: https://github.com/bitnami/containers/tree/main/bitnami/pgpool#configuration
  numInitChildren: "32"
  reservedConnections: 1
  maxPool: "15"
  childMaxConnections: "0"
  childLifeTime: "300"
  clientIdleLimit: "0"
  connectionLifeTime: "0"
  useLoadBalancing: true
  ## @param pgpool.loadBalancingOnWrite LoadBalancer on write actions behavior
  ## one of: [off, transaction, trans_transaction, always]
  ##
  loadBalancingOnWrite: transaction
  ## @param pgpool.configuration Pgpool configuration
  ## You can use this parameter to specify the content for pgpool.conf
  ## Otherwise, a repmgr.conf will be generated based on the environment variables
  ## ref: https://github.com/bitnami/containers/tree/main/bitnami/pgpool#configuration
  ## ref: https://github.com/bitnami/containers/tree/main/bitnami/pgpool#configuration-file
  ## Example:
  ## configuration: |-
  ##   listen_addresses = '*'
  ##   port = '5432'
  ##   ...
  ##
  configuration: ""

What is the expected behavior?

Expecting pgpool to start up successfully.

What do you see instead?

pgpool begins setup and exits after stating a warning of a syntax error in pgpool.conf without any indication of what is causing it.

pgpool 21:35:13.41 Welcome to the Bitnami pgpool container
pgpool 21:35:13.41 Subscribe to project updates by watching https://github.com/bitnami/containers
pgpool 21:35:13.41 Submit issues and feature requests at https://github.com/bitnami/containers/issues
pgpool 21:35:13.41
pgpool 21:35:13.41 INFO ==> ** Starting Pgpool-II setup **
pgpool 21:35:13.44 INFO ==> Validating settings in PGPOOL_* env vars...
pgpool 21:35:13.46 INFO ==> Initializing Pgpool-II...
pgpool 21:35:13.47 INFO ==> Generating pg_hba.conf file...
pgpool 21:35:13.47 INFO ==> Generating pgpool.conf file...
pgpool 21:35:13.62 DEBUG ==> Adding 'postgresql-postgresql-ha-postgresql-0.postgresql-postgresql-ha-postgresql-headless' information to the configuration...
pgpool 21:35:13.63 DEBUG ==> Adding 'postgresql-postgresql-ha-postgresql-1.postgresql-postgresql-ha-postgresql-headless' information to the configuration...
pgpool 21:35:13.64 DEBUG ==> Adding 'postgresql-postgresql-ha-postgresql-2.postgresql-postgresql-ha-postgresql-headless' information to the configuration...
pgpool 21:35:13.65 INFO ==> Generating password file for local authentication...
trying to read key from file /opt/bitnami/pgpool/conf/.pgpoolkey
WARNING: pid 122: syntax error in configuration file "/opt/bitnami/pgpool/conf/pgpool.conf"
Unable to get configuration. Exiting...
alemorcuq commented 2 years ago

Hi, @Alxander64.

I tried reproducing this using the values you provided (except for the existingSecret) and I wasn't able to reproduce it. In my case, pgpool starts properly and doesn't report any syntax error:

❯ k logs -f pg-postgresql-ha-pgpool-67975846b6-96qbt
pgpool 15:01:54.46
pgpool 15:01:54.46 Welcome to the Bitnami pgpool container
pgpool 15:01:54.46 Subscribe to project updates by watching https://github.com/bitnami/containers
pgpool 15:01:54.46 Submit issues and feature requests at https://github.com/bitnami/containers/issues
pgpool 15:01:54.46
pgpool 15:01:54.46 INFO  ==> ** Starting Pgpool-II setup **
pgpool 15:01:54.48 INFO  ==> Validating settings in PGPOOL_* env vars...
pgpool 15:01:54.50 INFO  ==> Initializing Pgpool-II...
pgpool 15:01:54.50 INFO  ==> Generating pg_hba.conf file...
pgpool 15:01:54.51 INFO  ==> Generating pgpool.conf file...
pgpool 15:01:54.64 DEBUG ==> Adding 'pg-postgresql-ha-postgresql-0.pg-postgresql-ha-postgresql-headless' information to the configuration...
pgpool 15:01:54.65 DEBUG ==> Adding 'pg-postgresql-ha-postgresql-1.pg-postgresql-ha-postgresql-headless' information to the configuration...
pgpool 15:01:54.65 DEBUG ==> Adding 'pg-postgresql-ha-postgresql-2.pg-postgresql-ha-postgresql-headless' information to the configuration...
pgpool 15:01:54.65 INFO  ==> Generating password file for local authentication...
trying to read key from file /opt/bitnami/pgpool/conf/.pgpoolkey
pgpool 15:01:54.66 INFO  ==> Generating password file for pgpool admin user...
pgpool 15:01:54.67 INFO  ==> ** Pgpool-II setup finished! **

pgpool 15:01:54.69 INFO  ==> ** Starting Pgpool-II **
bitnami-bot commented 2 years ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

bitnami-bot commented 2 years ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

Max-Sum commented 2 years ago

I have encountered the same issue. And I found that when password contains '&', the config file will corrupt. Changing the password fixes the issue.

Joao-1 commented 8 months ago

In addition to the Max-sum response, the password length can't be too long. I tried using to use a 128 character password and got the same error.

rafariossaa commented 8 months ago

Hi, Could you try the following ?

$ my_password="12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"

$ echo -n $my_password | wc -c
128

$ helm install  mypg bitnami/postgresql-ha --set pgpool.adminPassword=$my_password

I got the cluster up and running:

pgpool 11:37:17.02 INFO  ==> Generating password file for local authentication...
pgpool 11:37:17.04 INFO  ==> Generating password file for pgpool admin user...
pgpool 11:37:17.05 INFO  ==> ** Pgpool-II setup finished! **

pgpool 11:37:17.09 INFO  ==> ** Starting Pgpool-II **
2024-02-14 11:37:17.125: main pid 1: LOG:  Backend status file /opt/bitnami/pgpool/logs/pgpool_status does not exist

However, if my_password is longer then I got:

pgpool 11:30:59.07 INFO  ==> Generating password file for local authentication...
pgpool 11:30:59.09 INFO  ==> Generating password file for pgpool admin user...
Error: Input exceeds maximum password length!

Usage:

  pg_md5 [OPTIONS]
  pg_md5 <PASSWORD>

  --prompt, -p         Prompt password using standard input.
  --md5auth, -m        Produce md5 authentication password.
  --username, -u USER  When producing a md5 authentication password,
                       create the pool_passwd entry for USER.
  --config-file, -f CONFIG-FILE  Specify pgpool.conf.
  --input-file, -i INPUT-FILE  Specify file containing username and password pairs.
  --help, -h           This help menu.

Warning: At most 128 characters are allowed for input.

Could you double check the length of your password ?

github-actions[bot] commented 7 months ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 7 months ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.