-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 exists method fails on non existent file #50062
Comments
Resolved. Turns out negelected to add 'use Storage' at the top. As soon as I added that line all was well. I am surprised leavin that out didn't cause an exception on page load. |
I was wrong. I was testng on wrong instance. The use Illuminate\Support\Facades\Storage; line was already in the file and an exception did happen when I attempted to run that controller method. I am still at a loss, as the Storage::exists($filename) construct is used successfully in other methods. I'll need to verify that I am testing on those other methods that the file is missing. |
Not at a loss now. Found that the variable containing the path was empty and I was testing for null, so I was calling Storate::exists($file) with an empty variable. So now we know that calling Storage::exists with an empty string produced the "UnableToCheckFileExistence" error. Woluld have been nice if the error message was more informative. Mayber this convoluted bug report will help somebody someday. |
Laravel Version
10.43.0
PHP Version
8.1.27
Database Driver & Version
PostgreSql 10
Description
On S3, using Storage::exists($file_path) on a file that does not exist causes a whoops with the following error:
"UnableToCheckFileExistence"
If the file does exist, it returns true, and I am able to complete the action (delete, append, get).
"league/flysystem-aws-s3-v3": "^3.24.0",
I found a similar issue in issue #45639 (closed). From that I've verified that the bucket does have the s3:ListBucket permission mentioned in that issue.
I first tried it first with "league/flysystem-aws-s3-v3": "^3.11.0", and that didn't work either.
Steps To Reproduce
InvalidArgumentException UnableToCheckFileExistence
HTTP 500 Internal Server Error
Unable to check existence for:
League\Flysystem
UnableToCheckFileExistence
FILESYSTEM_DISK=s3
The text was updated successfully, but these errors were encountered: