# Percona Operator MongoDB backup fail on compatible S3

**URL:** <https://forums.percona.com/t/percona-operator-mongodb-backup-fail-on-compatible-s3/20186>\
**Category:** Percona Operator for MongoDB\
**Created:** [February 20, 2023, 11:29am UTC](https://forums.percona.com/t/percona-operator-mongodb-backup-fail-on-compatible-s3/20186 "2023-02-20T11:29:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfaraj](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rfaraj](https://forums.percona.com/u/rfaraj)\
**Post date:** [February 20, 2023, 11:29am UTC](https://forums.percona.com/t/percona-operator-mongodb-backup-fail-on-compatible-s3/20186/1 "2023-02-20T11:29:02Z")

</div>

Hi, We are using Percona Operator MongoDB version 1.13 to deploy our mongodb’s but we are getting error when configure or manual schedule backup:

E [agentCheckup] check storage connection: storage check failed with: get S3 object header: RequestError: send request failed

caused by: Head “[https://XXXXXXXX](https://XXXXXXXX):/bucket/.pbm.init”: net/http: invalid header field value “AWS4-HMAC-SHA256 Credential=OYIKMPD6AZSOLXUXOH99\n/20230220/us-east-1/s3/aws4\_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=a0d4a0c68382dfe2db57930ce581f67f7574e642bf58905ecccf1b25a582d238” for key Authorization.

2 possible causes:

1. Encriptation protocol issue.
2. The timezone of the backup agente container does not match with the S3 storage. There are way to change the Pod timezone deployed by operator?

We are not able to check logs of the S3 Storage. Any idea?

Thanks and regards.

---

<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:** [February 20, 2023, 2:39pm UTC](https://forums.percona.com/t/percona-operator-mongodb-backup-fail-on-compatible-s3/20186/2 "2023-02-20T14:39:58Z")

</div>

Hey @rfaraj ,

in the most of the cases this error indicates that S3 storage credentials are wrong. The most common issue is the EOL or `\n` in the end of the key.

See here for example: [Having difficulties enabling backups with MongoDB Operator 1.10 (header errors) - #3 by Duc\_Ngo](https://forums.percona.com/t/having-difficulties-enabling-backups-with-mongodb-operator-1-10-header-errors/12996/3)

Can you please double check that you have the correct keys in the Secret?

---

<div class="post-metadata">

**Author:** ![rfaraj](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rfaraj](https://forums.percona.com/u/rfaraj)\
**Post date:** [February 20, 2023, 3:37pm UTC](https://forums.percona.com/t/percona-operator-mongodb-backup-fail-on-compatible-s3/20186/3 "2023-02-20T15:37:26Z")

</div>

Hello @Sergey_Pronin ,

I had already read this post that you mention and I have performed the validation of the credentials several times.

echo “\<AWS\_ACCESS\_KEY\_ID\>” | base64 --wrap=0  
echo "\<AWS\_SECRET\_ACCESS\_KEY\> | base64 --wrap=0

It is correct right?

I have tried with the minion that includes the Gitlab deployment and it works without problem.

The issue is only happening when we try to backup against Netapp’s StorageGrid.

I have also tried to define wrong credentials and it keeps returning the same error.

Thanks and regards.

---

<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:** [February 21, 2023, 7:33am UTC](https://forums.percona.com/t/percona-operator-mongodb-backup-fail-on-compatible-s3/20186/4 "2023-02-21T07:33:17Z")

</div>

Can you try `echo -n KEY | base64 --wrap=0` ?

---

<div class="post-metadata">

**Author:** ![rfaraj](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rfaraj](https://forums.percona.com/u/rfaraj)\
**Post date:** [February 21, 2023, 12:36pm UTC](https://forums.percona.com/t/percona-operator-mongodb-backup-fail-on-compatible-s3/20186/5 "2023-02-21T12:36:53Z")

</div>

Hi @Sergey_Pronin ,

With the -n option in the echo command it works, I don’t normally use this option to encrypt k8s secrets.

Thanks for your support.
