Skip to content

S3 device using Backblaze with ObjectLock: Error "Content-MD5 OR x-amz-checksum- HTTP header is required for Put Object requests with Object Lock parameters" #275

@moritzboth

Description

@moritzboth

We are testing the s3 device with Backblaze B2 service. Backblaze uses the "AWS4" authentication mechanism.

Backblaze supports a "ObjectLock" function which locks objects for a preset amount of days. When we switch on ObjectLock, the creation of any object with amanda results in this error message in the taper log file:

Content-MD5 OR x-amz-checksum- HTTP header is required for Put Object requests with Object Lock parameters

Content-MD5 is, as far as I found out, optional with AWS4, but can be applied to any request. Maybe amanda should always send it. As it turns out, the code for that is already in the amanda s3 driver, but the creation of the Content-MD5 HTTP header is explicitly turned of for AWS4:

md5_hash = NULL;

We removed the line setting md5_hash to NULL. Also, we enabled the calculation of md5 sum for AWS4. Now we can upload data to Backblaze B2 with ObjectLock in place.

I don't know how / if this affects other services such as Amazon S3, but it is officially documented.

https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html

By the way, to get the s3 driver to work at all, we needed to apply the patch from pull request #244 .

Edit: Corrections, the description of our patch was incomplete before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions