postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

CryptoError: unable to verify certificate presented

Open nagannv opened this issue 5 years ago • 5 comments

Getting "CryptoError: unable to verify certificate presented by 'xxenv.s3.amazonaws.com:443': [20] unable to get local issuer certificate\n HINT: is or was the repo encrypted?\n "

The backrest pods are re-spinning

$ kubectl get pods -n pgo
NAME                                            READY   STATUS      RESTARTS   AGE
backrest-backup-fxxxx-gx5w9                     0/1     Error       0          14d
backrest-backup-fxxxx-h7m98                     0/1     Error       0          14d
backrest-backup-fxxxx-jlw8l                     0/1     Error       0          14d
backrest-backup-fxxxx-pnzm9                     0/1     Error       0          14d

deployed the PGO cluster using the following approach with AWS S3 backup

pgo create cluster fxxxx --pgbouncer --replica-count=1 \
  --sync-replication --pvc-size=10Gi \
  --pgbackrest-pvc-size=10Gi \
  --pgbackrest-storage-type=posix,s3 \
  --pgbackrest-s3-key=***************** \
  --pgbackrest-s3-key-secret=***************** \
  --pgbackrest-s3-bucket=xxenv \
  --pgbackrest-s3-endpoint=s3.amazonaws.com \
  --pgbackrest-s3-region=ap-southeast-2 \
  --password-superuser=***************** \
  --password-replication=***************** \
  --password=***************** \
  --username fxxxxxxuser
$ kubectl logs -f backrest-backup-fxxxx-gx5w9 -n pgo
nss_wrapper: user exists
nss_wrapper: group exists
nss_wrapper: environment configured
Mon Nov  8 12:15:58 UTC 2021 INFO: Image mode found: pgbackrest
Mon Nov  8 12:15:58 UTC 2021 INFO: Starting in 'pgbackrest' mode
time="2021-11-08T12:15:58Z" level=info msg="crunchy-pgbackrest starts"
time="2021-11-08T12:15:58Z" level=info msg="debug flag set to false"
time="2021-11-08T12:15:58Z" level=info msg="backrest backup command requested"
time="2021-11-08T12:15:58Z" level=info msg="backrest command will be executed for both local and s3 storage"
time="2021-11-08T12:15:58Z" level=info msg="command to execute is [pgbackrest backup  --db-host=10.100.142.20 --db-path=/pgdata/fxxxx-cnwv ; pgbackrest backup  --db-host=10.100.142.20 --db-path=/pgdata/fxxx-cnwv --repo1-type=s3]"
time="2021-11-08T12:19:17Z" level=info msg="output=[]"
time="2021-11-08T12:19:17Z" level=info msg="stderr=[WARN: option 'repo1-retention-full' is not set for 'repo1-retention-full-type=count', the repository may run out of space\n      HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum.\nWARN: a timeline switch has occurred since the 20211018-021202F backup, enabling delta checksum\n      HINT: this is normal after restoring from backup or promoting a standby.\nWARN: backup '20211108-004124F' cannot be resumed: new backup type 'incr' does not match resumable backup type 'full'\nERROR: [082]: WAL segment 000000030000000100000043 was not archived before the 60000ms timeout\n       HINT: check the archive_command to ensure that all options are correct (especially --stanza).\n       HINT: check the PostgreSQL server log for errors.\n       HINT: run the 'start' command if the stanza was previously stopped.\nWARN: option 'repo1-retention-full' is not set for 'repo1-retention-full-type=count', the repository may run out of space\n      HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum.\nERROR: [095]: unable to load info file '/backrestrepo/fxxx-backrest-shared-repo/backup/db/backup.info' or '/backrestrepo/fxxx-backrest-shared-repo/backup/db/backup.info.copy':\n       CryptoError: unable to verify certificate presented by 'xxenv.s3.amazonaws.com:443': [20] unable to get local issuer certificate\n       HINT: is or was the repo encrypted?\n       CryptoError: unable to verify certificate presented by 'xxenv.s3.amazonaws.com:443': [20] unable to get local issuer certificate\n       HINT: is or was the repo encrypted?\n       HINT: backup.info cannot be opened and is required to perform a backup.\n       HINT: has a stanza-create been performed?\n]"
time="2021-11-08T12:19:17Z" level=fatal msg="command terminated with exit code 95"


.

  • Platform: (Kubernetes on OpenStack)
  • Platform Version: (e.g. 4.7.1`)
  • PGO Image Tag: (e.g. centos8-4.7.1)
  • Storage: (e.g. "b1.standard/cinder.csi"

Could you please share your inputs on the issue

nagannv avatar Nov 22 '21 14:11 nagannv

#2864 addresses this. If you need a hot fix, you can load the certificates provided in #2864.

This affects v4 only -- v5 uses the OS trust store.

jkatz avatar Nov 22 '21 14:11 jkatz

@jkatz - Why can't we use OS level CA bundles instead of using our own? I am assuming latest UBI8 already has these inbuilt?

NiharDudam avatar Nov 22 '21 16:11 NiharDudam

@jkatz Thank you for your response. Upgrade requires a maintenance window on the production setup where the issue is observed, would it be possible to share the procedure to re-load the certificates provided in #2864.

nagannv avatar Nov 22 '21 20:11 nagannv

The solution for PGO v4 is addressed in #2864 and is patched in v4.7, v4.6, and v4.5. This is not an issue in PGO v5 as v5 uses the OS CA trust stores by default.

For production support please see the support page.

jkatz avatar Nov 22 '21 21:11 jkatz

I am planning to upgrade PGO to the latest to address the "ryptoError: unable to verify certificate \n " issue. however, on test environment backrest-backup pods which were in errored state ( as shown in the below), now no longer present. but the errored-out pods are present in the production environment, no tasks were executed on the test env since we observe the issue. could you please comment

$ kubectl get pods -n pgo
NAME                                            READY   STATUS      RESTARTS   AGE
backrest-backup-fxxxx-h7m98                     0/1     Error       0          14d
backrest-backup-fxxxx-jlw8l                     0/1     Error       0          14d
backrest-backup-fxxxx-pnzm9                     0/1     Error       0          14d

nagannv avatar Dec 03 '21 16:12 nagannv