Bug Report
| Q |
A |
| Flysystem Version |
3.12.0 |
| Adapter Name |
flysystem-aws-s3-v3 |
| Adapter version |
3.10.3 |
Summary
Calling $storage->fileExists() returns true if the underlying S3 server responds with an status code "Access Denied".
I get this status code from my minIO server even if the file does not exist. I do not know if this also happends in other S3 implementations.
The thing is that fileExists method calls S3Client::doesObjectExists which has the problematic behavior.
There is a issue aws/aws-sdk-php#2342 and also a fix for aws-sdk-php which is already merged: aws/aws-sdk-php#2424
They introduced a new method doesObjectExistsV2, which should handle the described situatuin properly.
Currently flysystem still uses the regular doesObjectExists method.
How to reproduce
Call $storage->fileExists('path/to/file/that/not/exists') and watch the returned value.
Tested with latest minIO from minio/minio docker image
minio version RELEASE.2023-01-02T09-40-09Z (commit-id=1cd8e1d8b633550e18a108a0f042941afab6e923)
Bug Report
Summary
Calling
$storage->fileExists()returnstrueif the underlying S3 server responds with an status code "Access Denied".I get this status code from my minIO server even if the file does not exist. I do not know if this also happends in other S3 implementations.
The thing is that
fileExistsmethod callsS3Client::doesObjectExistswhich has the problematic behavior.There is a issue aws/aws-sdk-php#2342 and also a fix for aws-sdk-php which is already merged: aws/aws-sdk-php#2424
They introduced a new method
doesObjectExistsV2, which should handle the described situatuin properly.Currently flysystem still uses the regular
doesObjectExistsmethod.How to reproduce
Call
$storage->fileExists('path/to/file/that/not/exists')and watch the returned value.Tested with latest minIO from minio/minio docker image
minio version RELEASE.2023-01-02T09-40-09Z (commit-id=1cd8e1d8b633550e18a108a0f042941afab6e923)