Strapi R2 provider config (invalid bucket reponse)

I am using the very simplest configuration according to the docs at Cloudflare R2 & CDN | Strapi Market
My configuration looks like this;

export default ({ env }) => ({
  upload: {
    config: {
      provider: 'strapi-provider-cloudflare-r2',
      providerOptions: {
        accessKeyId: env('CF_ACCESS_KEY_ID'),
        secretAccessKey: env('CF_ACCESS_SECRET'),
        endpoint: env('CF_ENDPOINT'),
        params: {
          Bucket: 'resources',
        },
        cloudflarePublicAccessUrl: env('CF_PUBLIC_ACCESS_URL'),
      },
      actionOptions: {
        upload: {},
        uploadStream: {},
        delete: {},
      },
    },
  },
});

A 1.8MB image upload fails with the response

[2024-05-08 09:07:40.476] error: The specified bucket does not exist.
NoSuchBucket: The specified bucket does not exist.

My environment variables look like this

CF_ACCESS_KEY_ID=<redacted>
CF_ACCESS_SECRET=<redacted>
CF_PUBLIC_ACCESS_URL=https://pub-<redacted>.r2.dev
CF_BUCKET=resources
CF_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com

I could say I copy and pasted my bucket name here, but I have quadruple checked the bucket ‘resources’ exists in my cloudflare R2 console.

This topic has been created from a Discord post (1239456617196687370) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord