velero-plugin-for-aws v1.14.3 still sends x-amz-tagging on PutObject with Backblaze B2, despite #309's guard
Environment
- velero-plugin-for-aws:
v1.14.3(docker.io image, initContainer) - velero server:
v1.18.2(Helm chartvelero12.2.0) - Object storage: Backblaze B2, S3-compatible endpoint (
s3.<region>.backblazeb2.com),s3ForcePathStyle: true BackupStorageLocation.spec.configdoes not settagging(left unset/empty)
What happened
Every scheduled backup (daily + weekly, defaultVolumesToFsBackup: true, kopia uploader) failed at the final metadata-upload step, over multiple days, while running velero-plugin-for-aws:v1.14.3:
error putting object velero/backups/<backup-name>/velero-backup.json:
operation error S3: PutObject, https response error StatusCode: 400,
api error InvalidArgument: Unsupported header 'x-amz-tagging' received for this API call.The per-volume PodVolumeBackup data itself uploaded successfully each time (confirmed via PodVolumeBackup.status.phase: Completed with correct sizes, and later via a direct kopia snapshot restore against the repository). Only the final PutObject for velero-backup.json (and the backup's own .tar.gz) failed, so the Backup object itself was always marked Failed, and — critically — Restore objects created against these "failed" backups also failed immediately, unable to even download the missing velero-backup.json/.tar.gz:
error downloading backup: error copying Backup to temp file: rpc error: code = Unknown
desc = error getting object velero/backups/<backup-name>/<backup-name>.tar.gz:
operation error S3: GetObject, https response error StatusCode: 404, NoSuchKey: Key not foundExpected behavior
Per the v1.14.3 changelog and velero-plugin-for-aws#309 ("Only set PutObject Tagging when tags are configured"), since our BSL has no config.tagging set, o.tagging should be "" and buildPutObjectInput should leave input.Tagging unset:
if o.tagging != "" {
input.Tagging = aws.String(o.tagging)
}I'd expect no x-amz-tagging header to be sent at all, and the upload to succeed against B2.
Actual behavior
The header was sent anyway (empty), and B2 rejected it, on every backup run across several days — this wasn't a one-off or an issue with a stale/cached image (verified the deployed image digest matched the v1.14.3 tag, and re-tested with a fresh pod rollout).
Workaround
Pinning the initContainer image to velero/velero-plugin-for-aws:v1.14.0 (predating the AWS SDK v2 migration that introduced this class of bug) immediately fixed it — verified with a full backup + restore cycle against B2 that completed cleanly with Errors: 0 and no failureReason.
Hypothesis
PutObject doesn't call the S3 client's PutObject directly — it goes through the SDK's manager.Uploader:
func (o *ObjectStore) PutObject(bucket, key string, body io.Reader) error {
input := o.buildPutObjectInput(bucket, key, body)
_, err := o.s3Uploader.Upload(context.Background(), input)
return errors.Wrapf(err, "error putting object %s", key)
}My guess is that manager.Uploader.Upload() constructs its own request(s) internally (for the multipart-vs-single-PUT decision, and/or the completion step) in a way that doesn't fully honor a nil PutObjectInput.Tagging the way a raw s3.Client.PutObject() call would - i.e. the #309 guard is correct at the PutObjectInput level but insufficient once the input passes through the manager.Uploader wrapper. I wasn't able to get a packet capture to confirm this precisely, but the guard condition itself (verified against our actual BSL config) rules out the "tags were actually configured" explanation from the original #309/R2 reports.
Ask
Could someone with more context on the manager.Uploader code path confirm whether it can still emit x-amz-tagging even when PutObjectInput.Tagging is nil? Happy to help test a fix - this cost about a day and a half of production backup coverage in our case before we caught it (the Backup objects' Failed phase made it non-obvious that per-volume data was actually fine, and un-restorable until we did a raw kopia-repository restore bypassing Velero's own Restore entirely).
Source: velero-io/velero