shrinerb / shrine

File Attachment toolkit for Ruby applications

Home Page:https://shrinerb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using Shrine with Cloudflare R2 causes error Aws::S3::Errors::NotImplemented - x-amz-tagging

dylandamsma opened this issue · comments

Issue:
I've implemented Shrine with Cloudflare R2 S3-compatible object storage. However, when uploading an image, I get this error back from Cloudflare: Aws::S3::Errors::NotImplemented (Header 'x-amz-tagging-directive' with value 'REPLACE' not implemented).

As per their documentation, this is indeed not yet implemented:
https://developers.cloudflare.com/r2/api/s3/api/

This issue only occurs when generating / using derivatives

Question:
Is it possible to use Shrine with R2 at the moment? Is it possible to disable or bypass this x-amz-tagging?

Note:
It's to note I saw a recent posted where another user was also using Cloudflare R2, which suggested to me it is in fact usable.

I've identified/narrowed down that this only occurs when using cache store in Cloudflare. This doesn't occur when when using cache store via Filesystem and uploading to Cloudflare store.

It'd be great if we can get similar behavior when using cache in Cloudflare.

@dylandamsma - I've opened a PR to fix this: #663. In the meantime, I'm using this forked version (https://github.com/nebham/shrine) in my code.

I also faced this issue. No derivatives, just using R2 for cache and store.

If I cache on the filesystem and store on R2 it does work however.

BTW I also realized R2 doesn't support direct uploads via POST requests unfortunately. For folks looking to use that feature that Shrine supports for S3.

+1

Should be fixed by #663.