# backupName can't be empty / error during restore attempt

**URL:** <https://forums.percona.com/t/backupname-cant-be-empty-error-during-restore-attempt/8438>\
**Category:** Percona Operator for MySQL\
**Tags:** percona\
**Created:** [December 24, 2020, 7:10am UTC](https://forums.percona.com/t/backupname-cant-be-empty-error-during-restore-attempt/8438 "2020-12-24T07:10:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mark/32/253_2.png) [@mark](https://forums.percona.com/u/mark)\
**Post date:** [December 24, 2020, 7:10am UTC](https://forums.percona.com/t/backupname-cant-be-empty-error-during-restore-attempt/8438/1 "2020-12-24T07:10:32Z")

</div>

Hi All!

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

My restore:

```auto
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](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?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 21, 2021, 9:48pm UTC](https://forums.percona.com/t/backupname-cant-be-empty-error-during-restore-attempt/8438/2 "2021-01-21T21:48:33Z")

</div>

> <https://github.com/percona/percona-xtradb-cluster-operator/blob/0e1a035452b77d9c807df6934cb44e37811d6fb6/e2e-tests/big-data/conf/restore-backup.yml>

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

---

<div class="post-metadata">

**Author:** ![mark](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mark/32/253_2.png) [@mark](https://forums.percona.com/u/mark)\
**Post date:** [January 22, 2021, 6:44am UTC](https://forums.percona.com/t/backupname-cant-be-empty-error-during-restore-attempt/8438/3 "2021-01-22T06:44:32Z")

</div>

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:`

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 28, 2021, 1:42pm UTC](https://forums.percona.com/t/backupname-cant-be-empty-error-during-restore-attempt/8438/4 "2021-01-28T13:42:46Z")

</div>

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/](https://jira.percona.com/) for possible other reports, or report the issue yourself so our enginners can take a look.

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [January 28, 2021, 8:07pm UTC](https://forums.percona.com/t/backupname-cant-be-empty-error-during-restore-attempt/8438/5 "2021-01-28T20:07:32Z")

</div>

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:

```auto
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:

```auto
+ 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

```auto
endpointURL: https://storage.googleapis.com

```

with

```auto
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](https://github.com/percona/percona-xtradb-cluster-operator/pull/754) 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.

---

<div class="post-metadata">

**Author:** ![mark](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mark/32/253_2.png) [@mark](https://forums.percona.com/u/mark)\
**Post date:** [January 30, 2021, 11:26am UTC](https://forums.percona.com/t/backupname-cant-be-empty-error-during-restore-attempt/8438/6 "2021-01-30T11:26:26Z")

</div>

Hiya!

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

Thanks!  
Mark
