I would expect
Unable to retrieve the file_size for file at location: testimage.png.
to contain the full S3 resource name. Make sure you are referencing it correctly
Hi guys. I've been facing a strange issue while using the Flysystem package for S3. Tried searching the web but little to none info about this case.
Currently using PHP 8.3.15, Laravel 11.31 and flysystem-aws-s3-v3 3.29.0
The bucket is already double checked for the right IAM permissions, as well as the config and .env file.
I can upload, delete and list all files in the bucket. However, when trying to inspect the bucket for a single file I get the following error:
League\Flysystem\UnableToRetrieveMetadata
Unable to retrieve the file_size for file at location: testimage.png.
We have another server with the same project, credentials, everything that runs without issues. It all points out to a config problem.
I also checked the file existence in the bucket.
The code, is a real simple conditional:
if ($filename != null) {
Log::info("Searching for: {$filename}");
if (Storage::disk('s3')->exists($filename)) {
Log::info("Found file");
return Storage::disk('s3')->response($filename);
} else {
return $this->response->successReturn("No files were found", 200, [], true);
}
} else {
$files = Storage::disk('s3')->files();
$count = count($files);
return $this->response->successReturn("Files:", 200, ["files" => $files, "quantity" => $count], true);
}
I already tried using other methods like download, get, hasFile etc but it all give me a similar result.
Anyone ever faced similar issue?
Please or to participate in this conversation.