# S3 backup using V4 signature

**URL:** <https://forums.foundationdb.org/t/s3-backup-using-v4-signature/2842>\
**Category:** Development\
**Created:** [August 5, 2021, 12:15pm UTC](https://forums.foundationdb.org/t/s3-backup-using-v4-signature/2842 "2021-08-05T12:15:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhasne](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/jhasne/32/1137_2.png) [@jhasne](https://forums.foundationdb.org/u/jhasne)\
**Post date:** [August 5, 2021, 12:15pm UTC](https://forums.foundationdb.org/t/s3-backup-using-v4-signature/2842/1 "2021-08-05T12:15:08Z")

</div>

Hi,

I have been trying to add V4 signature compatibility to fdb source code . It seemed like just fixing authorization header in accordance to V4 authorization will fix the error.

[https://github.com/apple/foundationdb/blob/0a46c6276efc90ef425666e381d1e118c115854c/fdbclient/BlobStore.actor.cpp#L942](https://github.com/apple/foundationdb/blob/0a46c6276efc90ef425666e381d1e118c115854c/fdbclient/BlobStore.actor.cpp#L942)

But its still showing same errors.

[c3019041375c04d03bfcbe37cde293a0] HTTP _ERROR_=http\_bad\_response early=0, time=0.009464s HEAD /test-bucket/backups/mytestbackup contentLen=0 [310 out]  
ERROR: Could not create backup container: Operation timed out  
ERROR: An error was encountered during submission  
Fatal Error: Backup error

Anyone has created authorization header as per s3 version v4 format ? Also is there something else I am missing?

---

<div class="post-metadata">

**Author:** ![Wade](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/wade/32/826_2.png) [@Wade](https://forums.foundationdb.org/u/Wade)\
**Post date:** [August 10, 2021, 6:57pm UTC](https://forums.foundationdb.org/t/s3-backup-using-v4-signature/2842/2 "2021-08-10T18:57:13Z")

</div>

Hi,

Just want to make sure you’ve seen this previous topic, it has a bunch of good info on debugging auth errors and some additional info on the signatures: [How do I use `fdbbackup` with Google Cloud Storage?](https://forums.foundationdb.org/t/how-do-i-use-fdbbackup-with-google-cloud-storage/1469)

---

<div class="post-metadata">

**Author:** ![jhasne](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/jhasne/32/1137_2.png) [@jhasne](https://forums.foundationdb.org/u/jhasne)\
**Post date:** [August 11, 2021, 5:42am UTC](https://forums.foundationdb.org/t/s3-backup-using-v4-signature/2842/3 "2021-08-11T05:42:57Z")

</div>

Hi

Yes I have gone through it . I am using S3 as a backup agent and have modified the authentication signature to include v4 version.

[5723bbcf92f090b7b90a1422995ef52a] HTTP starting HEAD /test-bucket ContentLen:0  
Request Header: Accept: application/xml  
Request Header: Authorization: AWS4-HMAC-SHA256 Credential=\<access\_key\_id\>/us-east-1/s3/aws4\_request,SignedHeaders=host;x-amz-date,Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc963176630326f1024  
Request Header: Content-Length: 0  
Request Header: Date: 20210811T053827Z  
Request Header: Host: \<host\_address\>  
[5723bbcf92f090b7b90a1422995ef52a] HTTP _ERROR_=http\_bad\_response early=0, time=0.000659s HEAD /test-bucket contentLen=0 [366 out]  
ERROR: Could not create backup container: Operation timed out  
ERROR: An error was encountered during submission  
Fatal Error: Backup error

The header files that are passed are following

and the cmd used for backup is :  
fdbbackup start -C \<cluster\_file\_path\> -d blobstore://\<access\_key\_id\>:@s3.amazonaws.com::90/mytestbackup?bucket=test-bucket --log --knob\_http\_verbose\_level=3
