HTTP Header Missing During Upload to S3 Bucket with Object Lock?

Getting this error when uploading backups to Backblaze bucket with object lock:

upload failed! Failed to upload information file : Content-MD5 OR x-amz-checksum- HTTP header is required for Put Object requests with Object Lock parameters

See here for more information: S3 PutObject is missing a Content-MD5 header when writing to a bucket with a default object lock configuration · Issue #1694 · aws/aws-sdk-php · GitHub

SYSTEM INFORMATION
OS type and version Debian 12
Webmin version 2.402
Virtualmin version 7.30.8
Webserver version Nginx 1.29.0-1~bookworm amd64
Related packages SUGGESTED

Why would you use object lock?
My “guess” is Virtuamin backups aren’t configured to use with object lock.

Simple solution turn off Object Lock on the S3.
By the demo video I watched you probably have to create a new bucket with Object Lock as its done at creation.

Object lock protects backups from being arbitrarily deleted by someone who hacks into the system (Virtualmin, server, and perhaps the website as well). For example, ransomware. Without it, backups are in danger of being deleted exactly when they are needed.

This seemed to be working for a while, and now it’s not. I’m hoping it’s a simple bug fix.

This seems to be solved. When looking under Virtualmin > Backup and Restore > S3 Buckets I found a notice that said it is highly suggested to install the official Amazon S3 CLI tool. Clicking the “install” link in the notice installed the awscli:all package. After this, it seems to be working just fine again.

I’ve never noticed when I last created a bucket, maybe it was added recently?

Now I look into a current bucket and I get a error

Just checked last nights backup went through ok.

@staff was something added to this module in the last update?

Just install the aws package from the OS repos.

I’ve had it installed for a long time, and I see no updates.

I think I remember now—we made a lot of changes since the last Virtualmin release. As far as I know, we should have it fixed already! Thanks for the heads up though!

You should actually try dnf install awscli.

:slight_smile: still no luck on any update.

…trying to update what’s not installed is like trying to give a haircut to a bald guy. :slight_smile:

The guy who maintains the rpm is slow to update, I emailed him last time I had a issue with it to push through the update.

Found a later version, is it safe to remove awscli and install awscli.noarch?

I updated ok, still get same error. I presume this maybe a issue with the format of the bucket I originally made. I can’t even remember making the bucket with Virtualmin, maybe I did on the Cloudflare and AWS portal.

Yes, you should install the latest available version from the repos. You can first delete the older version 1.29.

I just checked the code, and even with Virtualmin 7.30.8, this function shouldn’t be called if Virtualmin can find the AWS-CLI command.

Try running:

which aws

…and then explicitly configure it on the “System Settings ⇾ Virtualmin Configuration: Backup and Restore” page using the “Full path to AWS command for S3 operations” option.

add /bin/aws
All seems to work, backup work and restoring aws backup. Just the editing the bucket fails.

What is the output of:

grep aws_ /etc/webmin/virtual-server/config

and also

whereis aws

and

aws --version

and

/bin/aws --version

But you never set the option in the Virtualmin config as I suggested?

Try manually editing /etc/webmin/virtual-server/config and setting aws_cmd=/usr/bin/aws. And, make sure you don’t add duplicates; search for aws_cmd= first before replacing it.

1 Like

Sorry, was on wrong server :slight_smile: fixed.

1 Like