League\Flysystem\UnableToRetrieveMetadata Unable to retrieve the visibility for file at location:

Hey all, hoping someone can help.

Filament Version: 3.2
Laravel: 10.43
league/flysystem-aws-s3-v3": "^3.0"

I am getting the following error when trying to upload files to S3 through the RichEditor. S3 uploads work fine with a simple FileUpload field, and also using Laravel Media Library file upload field, but during upload inside an editor I am getting this error:

League\Flysystem\UnableToRetrieveMetadata Unable to retrieve the visibility for file at location:

My code:

Forms\Components\RichEditor::make('content')
    ->fileAttachmentsDisk('s3')
    ->fileAttachmentsDirectory('attachments')
    ->fileAttachmentsVisibility('public')


I tracked the error to line 120 of the HasFileAttachments trait which is inside a method name handleUploadedAttachmentUrlRetrieval().

Line 120: if ($storage->getVisibility($file) === 'private') {

The getVisibility method is throwing the error. However, the file is successfully uploaded to S3 and $file is pointed at the correct location: example: attachments/QB4Gc4ioPAaBnvPkYIeGVjqBT7LQakY0qAqVL1cB.jpg

When commenting out the if statement on line 120 to test, the image does render in the editor but I have no idea why it can't read the visibility.

Any help appreciated!

Thanks

Ralph
Was this page helpful?