backupName can't be empty / error during restore attempt

Hi All!

I’m trying to restore a backup in a new cluster from a backup stored in a minio S3 storage.

My restore:

apiVersion: pxc.percona.com/v1
kind: PerconaXtraDBClusterRestore
metadata:
  name: restore1
spec:
  backupSource:
    destination: s3://percona-blue-acc/ncas-2020-01-11-00:00:09-full
    s3:
      credentialsSecret: minio-backup
      region: us-east-1
      endpointURL: http://10.0.4.11:9000
  pxcCluster: ncas

But every time I try this restore I get the error: backupName can’t be empty

But according to https://www.percona.com/doc/kubernetes-operator-for-pxc/backups.html#restore-the-cluster-from-a-previously-saved-backup

I need to “set spec.backupSource subsection instead of spec.backupName”

If I want to restore from a S3 compatible source?

1 Like

Looks like you need to add “backupName” as a parameter.

1 Like

Hi!

But the documentation specifically states that I should NOT do that when restoring from a S3 source. And indeed, when I do: it says it’s an illegal option. :

set spec.backupSource subsection instead of spec.backupName field to point on the appropriate PVC or S3-compatible storage:

1 Like

Seems you’ve come across some bug then if it’s telling you one thing but not accepting the option. I suggest you check on https://jira.percona.com/ for possible other reports, or report the issue yourself so our enginners can take a look.

1 Like

Hello @mark ,

Thank you for submitting this. I ran the test today to check the error and here are the findings:

  1. I was able to reproduce the issue using YAML file almost similar to yours - restoration does not happen, but I have not seen the error “backupName can’t be empty”.

Here is my YAML:

apiVersion: pxc.percona.com/v1
kind: PerconaXtraDBClusterRestore
metadata:
  name: sp-restore-1
spec:
  backupSource:
    destination: s3://sp-test-1/cluster1-2021-01-28-18:37:16-full
    s3:
      credentialsSecret: sp-s3-bucket
      region: us-central1
      endpointURL: https://storage.googleapis.com
  pxcCluster: cluster1

The error I got in the logs of a backup pod was:

+ mc -C /tmp/mc config host add dest https://s3.amazonaws.com ACCESS_KEY_ID SECRET_ACCESS_KEY    
mc: <ERROR> Unable to initialize new alias from the provided credentials. The AWS Access Key Id you provided does not exist in our records.

I thought that my keys are wrong, but then I noticed that it tries to connect to https://s3.amazonaws.com instead of https://storage.googleapis.com which I specified in my restore.yaml.
The fix is simple - replace

endpointURL: https://storage.googleapis.com

with

endpointUrl: https://storage.googleapis.com

Kubernetes + YAML definitions are case sensitive, yes.
It is the typo in our documentation and I already sent the PR to fix this. Sorry for confusion here.
But as long as you have some other error - please see questions below.

  1. Could you please clarify where do you see the backupName can’t be empty error?
  2. Which version of the operator are you running? If I’m not mistaken restoration from S3 bucket without Restore object was introduced in v1.5.0.
1 Like

Hiya!

Yep that was it, all error’s went away after that adjustment.

Thanks!
Mark

1 Like