T
T
Tutucu2021-03-21 15:54:43
Amazon Web Services
Tutucu, 2021-03-21 15:54:43

Why is Laravel not connecting to Amazon s3 correctly?

Hello, I'm trying to connect to Yandex Cloud Object Storage (The connection is the same as to Amazon s3).
I connected the library for this:
composer require league/flysystem-aws-s3-v3 ~1.0
I use the following config:

'yandexcloud' => [
            'driver' => 's3',
            'key' => env('YACLOUD_ACCESS_KEY_ID', 'your_key'),
            'secret' => env('YACLOUD_SECRET_ACCESS_KEY', 'your_secret_key'),
            'endpoint' => env('YACLOUD_ENDPOINT', 'http://storage.yandexcloud.net/'),
            'region' => env('YACLOUD_DEFAULT_REGION', 'us-west-2'),
            'bucket' => env('YACLOUD_BUCKET', 'name-backet'),
            'url' => 'http://static.example.com/',
        ],

And I get an error:
Aws/S3/Exception/S3Exception with message 'Error executing "PutObject" on "'name-backet.http://storage.yandexcloud.net/"; AWS HTTP error: cURL error 1: Protocol "'name-backet.http" not supported or disabled in libcurl (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for 'name-backet.http://storage.yandexcloud.net/'

Those. for some reason, Laravel takes the name of my bucket and glues it to the beginning of the endpoint string, forming an incorrect connection address: name-backet. storage.yandexcloud.net , which generates an error. What is it connected with?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tutucu, 2021-03-25
@Tutucu

It turned out that this is a massive bug, the solution is here: https://github.com/laravel/framework/issues/36694

M
Mikhail Artemiev, 2021-03-22
@the_mix

remove `http://` from the endpoint:

'endpoint' => env('YACLOUD_ENDPOINT', 'storage.yandexcloud.net'),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question