Comments (4)
The issue also exists with the copy
function when used with R2, with $visibility
being null, and throwing League\Flysystem\UnableToRetrieveMetadata
, where GetObjectAcl not implemented
appears too.
Storage::disk('r2')->copy($sourcePath, $targetPath);
Will run this code:
public function copy(string $source, string $destination, Config $config): void
{
try {
$visibility = $config->get(Config::OPTION_VISIBILITY);
if ($visibility === null && $config->get(Config::OPTION_RETAIN_VISIBILITY, true)) {
$visibility = $this->visibility($source)->visibility();
}
} catch (Throwable $exception) {
throw UnableToCopyFile::fromLocationTo(
$source,
$destination,
$exception
);
}
// ...
This is where the exception is caught. $visibility
will be null, then the exception thrown.
My disk setup is like yours: visibility
set to private
.
Downgrading to 3.15 does not resolve it for me though.
from flysystem.
Did any of you guys find a solution for the problem? Move (and copy) seems not to be working on r2
from flysystem.
this seems related: #1791
from flysystem.
it seems the config is not passed down to the copy() function
$config = new Config([
Config::OPTION_VISIBILITY => 'private',
]);
Storage::disk('r2')->move($orgFile, $archiveFile, $config);
when i debug this with ray(), i see the config object is not the same
So it seems the Laravel Disk/storage config is not passed correctly, so it tries to fetch the visibility from the file (GetObjectACL is not supported by Cloudflare R2), so it will throw an Exception.
It seems the the laravel disk config is not passed correctly to AwsS3V3Adapter.
--
UPDATE
when i manually comment out this part of the code:
try {
$visibility = $config->get(Config::OPTION_VISIBILITY);
if ($visibility === null && $config->get(Config::OPTION_RETAIN_VISIBILITY, true)) {
$visibility = $this->visibility($source)->visibility();
}
} catch (Throwable $exception) {
throw UnableToCopyFile::fromLocationTo(
$source,
$destination,
$exception
);
}
and then add
$visibility = 'private';
the "moving/copying" of the file works...
from flysystem.
Related Issues (20)
- Strpos result comparison HOT 1
- MountManager does not transfer configs other than visibility when copying across filesystems
- documentation - aws - ListObjects privileges seems no longer exists HOT 1
- "invalid size" error in SftpAdapter after upgrading to 3.25 HOT 6
- Error Message: Unable to list contents for '', shallow listing HOT 3
- SimpleConnectivityChecker causes unexpected behavior when use the ping method to check connectivity HOT 1
- How can i get one element on listContent?
- Batch interface HOT 2
- AWS S3 Adapter: retrieve mime type from file content HOT 1
- Rework FileAttributes HOT 1
- StreamWrapper and assertIsResource compatibility HOT 2
- S3 v3 createDirectory() is triggering a 403 Forbidden Client Error HOT 2
- ftp_chdir(): Invalid number of parameters in when trying to access or create or delete file or directory in laravel 11 HOT 3
- Class "League\Flysystem\PhpseclibV3\SftpConnectionProvider" not found HOT 2
- Issue creating a directory in AWS S3 with ACLs disabled HOT 1
- AwsS3V3Adapter::writeStream(): external MIME type detection might change the stream cursor position HOT 7
- AwsS3V3Adapter::visibility throws Unable to retrieve the visibility for file at location UnableToRetrieveMetadata exception HOT 7
- Limit S3 bandwidth HOT 1
- Turn off chmod/chown permission change on the existing files/folders
- Oracle Cloud Infra File Storage Compatibility
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flysystem.