silverstripe / silverstripe-s3

Silverstripe module to store assets in S3 rather than on the local filesystem (SS4/SS5 only)
BSD 3-Clause "New" or "Revised" License
20 stars 25 forks source link

Connection refused for URI #49

Closed paulblaze closed 2 years ago

paulblaze commented 2 years ago

When we try to upload image we got below error and exception. Kindly advise us regarding this

  1. Uncaught InvalidArgumentException: League\Flysystem\Filesystem::putStream expects argument #2 to be a valid resource in /vendor/league/flysystem/src/Filesystem.php:111

  2. Error executing "GetObject" on "https://XXXX.ap-south-1.linodeobjects/protected/Uploads/475a86907f/Round130.png"; AWS HTTP error: Connection refused for URI https://XXXX.ap-south-1.linodeobjects.com/protected/Uploads/475a86907f/Round130.png

paulblaze commented 2 years ago

we have fixed the issue by setting streamReads param to false in AwsS3Adapter.php file. So @http[stream] option is disabled(not set). Please let us know how to set @http[stream] option using config.yml file or any other way to achieve this without making changes in the vendor files.

photo_2021-10-08_22-36-47 photo_2021-10-08_22-32-22

obj63mc commented 2 years ago

If you are getting a connection refused error on your 'protected' assets - which are not open to the public, then you are either missing a specific config variable such as your AWS Secret and Key or something is not configured on your bucket properly.

The AWSS3 adapter is from the league/flysystem package not from us.

Please check to ensure your configuration is setup properly based off of our readme.

If you need support on setting up your environment I would recommend hitting the forums - https://forum.silverstripe.org/