Hi! I'm looking for some help with my r2
Hi! I'm looking for some help with my r2 bucket. I'm using it via Pages and a binding. I see my
put
request was successful but I don't see anything in the bucket in the dashboard. I also don't see anything when trying to list all objects via the AWS s3 SDK, but if i get
the key in the worker it returns what looks to be the file I uploaded.
Any ideas?4 Replies
Here you can see the name of the file and the
get
request returning the file. But why doesn't it show up in the dashboard or my s3 client?
@WillTolmie good suggestion, I am awaiting the put. See the logs above, the item IS in the bucket it seems but can I only ever see it from my worker?Ah OK so it is there. Have you checked the bucket binding is correct? Could be going into a different bucket
yeah i looked in both buckets and its missing from both in the dashboard as well as the s3 sdk
Oh yeah and it also doesn't show up when trying to use the
wrangler r2 object get <path>
which is very strange to me!
My interpretation of the docs is that I need to make the bucket public to see anything in it outside of the worker. I would expect having proper auth would allow me to see the objects tho?
yes
for the application, which seems to get the object fine. When trying to fetch the individual object I tried wrangler r2 object get
, the nodejs aws s3 client list all objects v2 (shows the bucket but nothing in it), and the cloudflare dashboard itself which all show no files at the specified path.
are the objects only visible from the binding? In other words, is there is no way to list all objects via the binding without knowing all the key names?
Oh yeah that makes sense. Is there is no way to get it to interact w/the remote resources? I saw there is --local
as a boolean but setting it to false doesn't seem to do much and --remote
doesn't seem to be supported by pages dev
And why would I still have Class A/B requests against my bucket if they're not actually being used?
I don't think there is, sorry.oof bummer, thanks for the info.
Could it be the wrangler commands you're sending?yeah probs! Seems like this part of the docs is not quite correct then?
Interact with your R2 buckets locally While developing locally, interact with an R2 bucket by adding --r2=<BINDING_NAME> to your run command. For example, if your bucket is bound to BUCKET, access this bucket in local dev by running npx wrangler pages dev <OUTPUT_DIR> --r2=BUCKET. Interact with this binding by using context.env (for example, context.env.BUCKET).I tried that and it still used the local version of the binding
GitHub
feat: implement
adapter.emulate
by Rich-Harris · Pull Request #11...Breaking this out of #11730, as the changes to adapter-cloudflare and adapter-cloudflare-workers are blocked on the next release of wrangler. Without it, we'll have to make platform.caches opti...