I'm getting an error while building the Cloudflare template with the link that is provided by Payload:
https://github.com/payloadcms/payload/tree/main/templates/with-cloudflare-d1
Not sure if it's Payload or Cloudflare that need to solve this, but I'm mentioning it so the team can solve this for everybody.
Or if anybody in this chat has solution to this.
I don't see where I can control the bucket's name, not even sure if it's given by Payload in their setup or Cloudflare.
#Error while building the Cloudflare template
17 messages · Page 1 of 1 (latest)
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
- Customizing Views - Building Custom Views - View Templates
- Building Your Own Plugin - Plugin Template
- Building Your Own Plugin
- Building Your Own Plugin - Plugin Template - The root folder
Community-Help:
Hi! The error indicates the bucket name was configured to be "R2R2Bucket" which is invalid.
Did you use the 1-click deployment button? By default it uses "my-app" as the bucket name. Did you customize the bucket name?
Hey rjgtav,
Nop, I don't find where to modify the bucket's name.
I followed Payload's tutorial.
I wrote to Cloudflare support as well to know where I can modify this
Did you use the "Deploy to Cloudflare" button?
Yep, I tried 3 times
Deleting my repo and worker every time to start fresh
Okok. When you use the "Deploy to Cloudflare" button, there's a section of the "Setup your application" form that allows you to configure the R2 bucket, either use an existing one or create a new one.
When using the "Deploy to Cloudflare" flow, it will create a new repository in your Github account, which will then be used for storing your project.
If you open that repository, you'll find a file called wrangler.jsonc which will contain the configuration for the Cloudflare Worker.
Inside that file there's a section for "r2_buckets" and inside it you can see that there's a bucket with the name of "R2R2Bucket". This is the value you need to fix, by changing to one of the buckets you already have in your Cloudflare account. If needed, you can create a new bucket from the Cloudflare Dashboard
Thank you for taking the time to reply, it's really appreciated
I'll try this right now, but I tried again and recorded it so you can the error can be seen and solved by the right people.
I'm cleary selecting s bucket named 'lake-atitlan-community', so I don't understand where the name in the error log is coming from.
Here's the Loom video: https://www.loom.com/share/2c3878d75e1b4c22a62ac422092c9aa9?sid=4a448292-f2a2-4bc5-8602-4af065079da8
In this video, I walk through the process of setting up my project, ensuring that I name everything consistently, including the database and the existing bucket. I also share my pedal secret for transparency. As I progress, I notice some recurring issues that need addressing. Please pay attention to the steps I outline and let me know if you enc...
thanks for the video!
Interesting.. I wonder if it's a bug that just cropped up in the "Deploy to Cloudflare" flow.
Can you check how the wrangler.jsonc looks like in the new Github repo? In the r2_buckets section, in particular
Thanks again,
It's now building and deploying properly.
In the template their provide, it's set to 'my-app', so I really don't understand where this "R2R2Bucket" name is coming from.
Hmm.. did you change anything or did you simply retry the build?
I did what you said, I changed the name of the bucket in the 'wrangler.jsonc' that was set to "R2R2Bucket" for the name of my project, in the repo that was created and then rebuilt.
Okok. Glad you got it fixed. I'll try to reproduce it myself and figure out what's setting R2R2Bucket in the config
Managed to reproduce it! Seems to be a bug when using an existing bucket. I'll flag it internally. Thanks for reporting it!
@brittle scaffold any ETA? was hoping to showcase the 1-click starter to my company, and get them to sign up for cloudflare so we can migrate from wordpress
Not yet. I'll reply if/when I get more info. But if in the "Deploy to Cloudflare" flow you choose to create a new bucket, everything is still working fine (maybe also choose a new database, just in case the bug affects both)
@floral gale Hi! Can confirm that it has already been fixed! Just tried it myself and the bucket_name was properly configured in wrangler.jsonc this time around