#Unable to check existence S3 Storage R2 Cloudflare

29 messages · Page 1 of 1 (latest)

languid sail
#

Hi,

I'm using R2 Cloudflare, the file successfully uploaded to bucket, but it's getting error
Unable to check existence for: release/cover-art/file-name.jpg

My resource

                        ->disk('s3')
                        ->directory('release/cover-art')
                        ->storeFileNamesIn('original_image_name')```
Filesystem
```'s3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'url' => env('AWS_URL'),
            'endpoint' => env('AWS_ENDPOINT'),
            'directory_env' => env('AWS_DIRECTORY'),
            'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
            'throw' => false,
            'bucket_endpoint' => true,
            'visibility' => 'public',
        ],```

Any thoughts about this?
glad domeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

empty phoenix
languid sail
empty phoenix
#

I don't know. I never worked with R2. Check the permissions

#

Isn't there more information why it is unable to check existence?

#

Does R2 support the nested folder structure?

languid sail
#

I got error like this, is visibility => 'public' not enough?

#

I have no clue about this😢

languid sail
#
[
  {
    "AllowedOrigins": [
      "https://admin.soundmera.com"
    ],
    "AllowedMethods": [
      "GET",
      "POST",
      "DELETE",
      "PUT",
      "HEAD"
    ],
    "AllowedHeaders": [
      "*"
    ],
    "ExposeHeaders": [
      "Access-Control-Allow-Origin",
      "x-amz-server-side-encryption",
      "x-amz-request-id",
      "x-amz-id-2",
      "Content-Type"
    ],
    "MaxAgeSeconds": 3000
  }
]

Here is my CORS policy for R2 Bucket

empty phoenix
#

CORS is client side, not server side, and therefore unrelated.

remote lotus
#

The visibility probably needs to be set to private like s3. Then you also need to check the bucket permissions themselves for the r2 user.

languid sail
remote lotus
#

I’m think that r2 is trying to read from your local disk. I could be wrong though.

languid sail
#

Do you mean like this? If so, I've set the disk to s3 as well.

        'disk' => 's3',        // Example: 'local', 's3'              | Default: 'default'
        'rules' => null,       // Example: ['file', 'mimes:png,jpg']  | Default: ['required', 'file', 'max:12288'] (12MB)
        'directory' => 'release/cover-art',   // Example: 'tmp'                      | Default: 'livewire-tmp'
        'middleware' => null,  // Example: 'throttle:5,1'             | Default: 'throttle:60,1'
        'preview_mimes' => [   // Supported file types for temporary pre-signed file URLs...
            'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
            'mov', 'avi', 'wmv', 'mp3', 'm4a',
            'jpg', 'jpeg', 'mpga', 'webp', 'wma',
        ],
        'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated...
        'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs...
    ],```
languid sail
remote lotus
languid sail
remote lotus
#

Hmm. Not totally sure at this point. Sorry.

languid sail
#

😭

remote lotus
#

I would expect this to work:

FileUpload::make()
  ->disk(‘s3’)
  ->directory(…)
  ->visibility(‘private’)
#

Definitely sounds like something between cloudflare and s3 and not anything in Filament though.

languid sail
#

Already set it though, but the error persist

   ->disk('s3')
   ->directory('release/cover-art')
   ->storeFileNamesIn('original_image_name')
   ->visibility('private')```
remote lotus
#

Yea. It’s something upstream with the remote as best I can tell.

#

Can you try it without the filename adjustment?

languid sail
#

It seems like the same thing, the same error appears again

remote lotus
#

Ok. Sorry, I can’t help more then. But seems like the issue is outside filament or laravel at this point.

languid sail
#

SOLVED! This requires SSL and I forgot to enable it on local