Unable to add S3 object metadata on uploads

What is the problem you are having with rclone?

When uploading local files to S3, and using the --header-upload flag to specify S3 object metadata (e.g., "X-Amz-Meta-Test: FooBar"), I get the following error:

Failed to copy: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>There were headers present in the request which were not signed</Message><HeadersNotSigned>x-amz-meta-test</HeadersNotSigned><RequestId>removed</RequestId><HostId>removed</HostId></Error>

What is your rclone version (output from rclone version)

rclone v1.52.0

  • os/arch: linux/amd64
  • go version: go1.14.3

Which OS you are using and how many bits (eg Windows 7, 64 bit)

CentOS 7.8, 64-bit

Which cloud storage system are you using? (eg Google Drive)

Amazon S3

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone copy test s3:mybucket/test -P --header-upload "X-Amz-Meta-Test: FooBar" --retries 1

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

2020/06/04 13:14:33 DEBUG : rclone: Version "v1.52.0" starting with parameters ["rclone" "copy" "test" "s3:mybucket/test" "-P" "--header-upload" "X-Amz-Meta-Test: FooBar" "--retries" "1" "-vv"]
2020/06/04 13:14:33 DEBUG : Using config file from "/home/myuser/.config/rclone/rclone.conf"
2020/06/04 13:14:33 DEBUG : fs cache: renaming cache item "test" to be canonical "/home/myuser/work/test"
2020-06-04 13:14:33 DEBUG : S3 bucket mybucket path test: Waiting for checks to finish
2020-06-04 13:14:33 DEBUG : S3 bucket mybucket path test: Waiting for transfers to finish
2020-06-04 13:14:34 ERROR : file1.txt: Failed to copy: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>There were headers present in the request which were not signed</Message><HeadersNotSigned>x-amz-meta-test</HeadersNotSigned><RequestId>removed</RequestId><HostId>removed</HostId></Error>
2020-06-04 13:14:34 ERROR : file2.txt: Failed to copy: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>There were headers present in the request which were not signed</Message><HeadersNotSigned>x-amz-meta-test</HeadersNotSigned><RequestId>removed</RequestId><HostId>removed</HostId></Error>
2020-06-04 13:14:34 INFO  : There was nothing to transfer
2020-06-04 13:14:34 ERROR : Attempt 1/1 failed with 2 errors and: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>There were headers present in the request which were not signed</Message><HeadersNotSigned>x-amz-meta-test</HeadersNotSigned><RequestId>removed</RequestId><HostId>removed</HostId></Error>
Transferred:            12 / 12 Bytes, 100%, 21 Bytes/s, ETA 0s
Errors:                 2 (retrying may help)
Elapsed time:         0.5s
2020/06/04 13:14:34 INFO  : 
Transferred:   	        12 / 12 Bytes, 100%, 21 Bytes/s, ETA 0s
Errors:                 2 (retrying may help)
Elapsed time:         0.5s

2020/06/04 13:14:34 DEBUG : 4 go routines active
2020/06/04 13:14:34 Failed to copy with 2 errors: last error was: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>There were headers present in the request which were not signed</Message><HeadersNotSigned>x-amz-meta-test</HeadersNotSigned><RequestId>removed</RequestId><HostId>removed</HostId></Error>

Ah! I don't think I tried that. I concentrated on the Content* headers.

Can you please make a new issue on github about that and I'll take a look - thanks.

Done! Here's a link to the issue I opened.

@ncw As an bonus, it would be useful to test the "x-amz-tagging" header to support S3 object tagging in addition to S3 object metadata. Then support both tagging and metadata on PutObject and Multipart Upload.

Thanks, will reply on the issue.

Good idea! I updated the issue with that.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.