I am trying to follow the directions from the docs to deply my site to an existing Cloudflare R2 bucket. The site is already there from a manual copy, and I am just testing the sync functionality of hugo deploy
.
It correctly identifies a single file when I make a change, so I feel pretty confident that it is reading from the bucket, but it cannot write anything. It gets the following error:
Error: blob (key "index.html") (code=Unknown): XAmzContentSHA256Mismatch: The provided 'x-amz-content-sha256' header does not match what was computed.
status code: 400, request id: , host id:
I’ve tried digging through the hugo code, and the gocloud.dev/blob
code it references, but I can’t quite figure out what the issue is. Is this an error being returned by cloudflare? I don’t know all the nuances of different s3 compatible apis, but is it possible R2 requires a header that isn’t being sent by whatever sdk the blob
package is using to write files? Has anyone ever successfully used hugo deploy
with Cloudflare R2? Or some other non-S3 endpoint?