#1759·flysystem

AwsS3V3Adapter 中的 $config copy 函数为空或为空字符串

作者: srabouin创建于 2024年2月29日更新于 2026年7月15日

R2 config:

'disks' => [
        'r2' => [
            'driver' => 's3',
            'key' => env('CLOUDFLARE_R2_ACCESS_KEY_ID'),
            'secret' => env('CLOUDFLARE_R2_SECRET_ACCESS_KEY'),
            'region' => env('CLOUDFLARE_R2_REGION'),
            'bucket' => env('CLOUDFLARE_R2_BUCKET'),
            'disable_asserts' => true,
            'visibility' => 'private',
            'endpoint' => env('CLOUDFLARE_R2_ENDPOINT'),
            'url' => env('CLOUDFLARE_R2_URL'),
            'domain' => env('CLOUDFLARE_R2_FILE_DOMAIN', ''),
            'domain_original' => env('CLOUDFLARE_R2_ORIGINAL_DOMAIN', ''),
            'throw' => true,
        ],
]

Single line of code:

Storage::disk('r2')->move($from, $to);

Actual error, irrelevant lines removed:

[previous exception] [object] (GuzzleHttp\\Exception\\ServerException(code: 501): Server error: `GET https://bucket.x.r2.cloudflarestorage.com/submissions/tmp/file.zip?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...)
 at /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113)
[...]
#14 /var/www/html/vendor/league/flysystem-AWS-s3-v3/AwsS3V3Adapter.php(440): AWS\\AwsClient->execute(Object(AWS\\Command))
#15 /var/www/html/vendor/league/flysystem-AWS-s3-v3/AwsS3V3Adapter.php(410): League\\Flysystem\\AwsS3V3\\AwsS3V3Adapter->visibility('submissions/tmp...')
#16 /var/www/html/vendor/league/flysystem-AWS-s3-v3/AwsS3V3Adapter.php(399): League\\Flysystem\\AwsS3V3\\AwsS3V3Adapter->copy('submissions/tmp...', 'submissions/102...', Object(League\\Flysystem\\Config))
#17 /var/www/html/vendor/league/flysystem/src/Filesystem.php(137): League\\Flysystem\\AwsS3V3\\AwsS3V3Adapter->move('submissions/tmp...', 'submissions/102...',
…

内容来源: thephpleague/flysystem