Lucifer
Lucifer
FFilament
Created by tarifss on 3/31/2024 in #❓┊help
Azure does not support visibility
The laravel errors was
[2024-08-22 01:50:58] local.ERROR: Unable to retrieve the visibility for file at location: yCqb5rfYWnR7pl93Ln2UpAyDBRY1JM9J2X0c5Tw6.jpg. {"userId":1,"exception":"[object] (League\\Flysystem\\UnableToRetrieveMetadata(code: 0): Unable to retrieve the visibility for file at location: yCqb5rfYWnR7pl93Ln2UpAyDBRY1JM9J2X0c5Tw6.jpg. at C:\\laragon\\www\\salvaterol\\vendor\\league\\flysystem\\src\\UnableToRetrieveMetadata.php:49)
[stacktrace]
....
[previous exception] [object] (GuzzleHttp\\Exception\\ServerException(code: 501): Server error: `GET https://salvaterol.2cf00200a068ab42ae4ebd03662bf9b1.r2.cloudflarestorage.com/yCqb5rfYWnR7pl93Ln2UpAyDBRY1JM9J2X0c5Tw6.jpg?acl` resulted in a `501 Not Implemented` response:
<?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>NotImplemented</Code><Message>GetObjectAcl not implemented</Message>< (truncated...)
[stacktrace]
[2024-08-22 01:50:58] local.ERROR: Unable to retrieve the visibility for file at location: yCqb5rfYWnR7pl93Ln2UpAyDBRY1JM9J2X0c5Tw6.jpg. {"userId":1,"exception":"[object] (League\\Flysystem\\UnableToRetrieveMetadata(code: 0): Unable to retrieve the visibility for file at location: yCqb5rfYWnR7pl93Ln2UpAyDBRY1JM9J2X0c5Tw6.jpg. at C:\\laragon\\www\\salvaterol\\vendor\\league\\flysystem\\src\\UnableToRetrieveMetadata.php:49)
[stacktrace]
....
[previous exception] [object] (GuzzleHttp\\Exception\\ServerException(code: 501): Server error: `GET https://salvaterol.2cf00200a068ab42ae4ebd03662bf9b1.r2.cloudflarestorage.com/yCqb5rfYWnR7pl93Ln2UpAyDBRY1JM9J2X0c5Tw6.jpg?acl` resulted in a `501 Not Implemented` response:
<?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>NotImplemented</Code><Message>GetObjectAcl not implemented</Message>< (truncated...)
[stacktrace]
(I couldn't fit it all in one message 😅 )
5 replies
FFilament
Created by tarifss on 3/31/2024 in #❓┊help
Azure does not support visibility
I have the same problem. It is similar to the one discussed in https://discord.com/channels/883083792112300104/1210749603293429810/1210751231874703472 In my case, I use R2 from Cloudflare, so I can't use Acl (the error there is that GetObjectAcl is not being implemented from S3). I am using the Filament/Spatie Markdown editor. I have to say that the problem is the error message and that you don't get the image in Markdown, the image DOES upload correctly to R2. So reading a little bit different discussions by github. https://github.com/thephpleague/flysystem/issues/1759 https://github.com/statamic/cms/pull/9065 https://github.com/thephpleague/flysystem/issues/1791 I've tested and commenting out this piece of code from the trait (Filament\Forms\Components\Concerns\HasFileAttachments), everything would work perfectly.
if ($storage->getVisibility($file) === 'private') {
try {
return $storage->temporaryUrl(
$file,
now()->addMinutes(5),
);
} catch (Throwable $exception) {
// This driver does not support creating temporary URLs.
}
}
if ($storage->getVisibility($file) === 'private') {
try {
return $storage->temporaryUrl(
$file,
now()->addMinutes(5),
);
} catch (Throwable $exception) {
// This driver does not support creating temporary URLs.
}
}
I don't know how this could be handled without touching the original trait, since the problem is that you cannot check visibility in R2 (or in S3 without Acl). Any ideas? Thanks!
5 replies