Skip to content
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

Restore from s3 in not working #3649

Closed
idanl21 opened this issue May 14, 2023 · 6 comments
Closed

Restore from s3 in not working #3649

idanl21 opened this issue May 14, 2023 · 6 comments
Labels

Comments

@idanl21
Copy link

idanl21 commented May 14, 2023

Im trying to Create PostgresCluster in my EKS using the Operator.
thats my YAML -

apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
  name: rhino
spec:
  image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-14.7-0
  postgresVersion: 14
  dataSource:
    pgbackrest:
      stanza: db
      configuration:
      - secret:
          name: my-secret
      global:
        repo1-path: /backrestrepo/pgo-002-backrest-shared-repo/backup/db/20230420-104207F/
      repo:
        name: repo1
        s3:
          bucket: "pgo-prod-bck-002"
          endpoint: "s3.us-east-1.amazonaws.com"
          region: "us-east-1"
  instances:
    - dataVolumeClaimSpec:
        accessModes:
        - "ReadWriteOnce"
        resources:
          requests:
            storage: 50Gi
  backups:
    pgbackrest:
      image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.41-4
      repos:
      - name: repo1
        volume:
          volumeClaimSpec:
            accessModes:
            - "ReadWriteOnce"
            resources:
              requests:
                storage: 50Gi

Somehow im getting that error from the rhino-pgbackrest-restore-XXXX pod -

Defaulted container "pgbackrest-restore" out of: pgbackrest-restore, nss-wrapper-init (init)
+ pgbackrest restore --stanza=db --pg1-path=/pgdata/pg14 --repo=1 --delta --link-map=pg_wal=/pgdata/pg14_wal
ERROR: [037]: restore command requires option: repo1-s3-key

my-secret Secret -
Created with the command
kubectl create secret generic my-secret --from-file=my-secret.yaml
my-secret.yaml :

[global]
repo1-s3-key=XXXXXXXXXXXXXXXXXXX
repo1-s3-key-secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

how can i make sure that the restoration command is with repo1-s3-key parameter ?

@ValClarkson
Copy link
Contributor

HI @idanl21

Thanks for submitting this issue, I think you may just have a formatting error in your my-secret.yaml file. From above you have
[global] repo1-s3-key=XXXXXXXXXXXXXXXXXXX repo1-s3-key-secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

and it should be:

[global]
repo1-s3-key=XXXXXXXXXXXXXXXXXXX
repo1-s3-key-secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Please reach back out if formatting of your my-secret.yaml file is not the issue.

@idanl21
Copy link
Author

idanl21 commented May 17, 2023

Hey @ValClarkson
Thanks for the answer, i dont think that is the reason (my real file is looking like that -
[global]
repo1-s3-key=XXXXXXXXXXXXXXXXXXX
repo1-s3-key-secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

(it's just a problem of indentation in the issue)
Tried now again, still same error
Do you have maybe another idea ?

@idanl21
Copy link
Author

idanl21 commented May 21, 2023

@ValClarkson ?

@idanl21
Copy link
Author

idanl21 commented May 23, 2023

Stil same status, any help here ?

@jmckulk
Copy link
Collaborator

jmckulk commented Jun 6, 2023

Hi @idanl21,

In your repo1-path for the restore, you are providing the path to a backup (/backrestrepo/pgo-002-backrest-shared-repo/backup/db/20230420-104207F/) instead of the path to the repo directory. Please try updating the path to point at the backrest repo and let us know if that works. Based on the spec you provided, I think it would be something like this:

      global:
        repo1-path: /backrestrepo/pgo-002-backrest-shared-repo

@jmckulk
Copy link
Collaborator

jmckulk commented Jun 21, 2023

If you are still running into any issues, please let us know. For now, we are closing out this ticket.

@jmckulk jmckulk closed this as completed Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants