V8-archive: S3 "no permission to write"

Created on 14 Nov 2019  路  7Comments  路  Source: directus/v8-archive

For security issues, please email [email protected] directly.

Bug Report

Steps to Reproduce

follow steps at https://docs.directus.io/extensions/storage-adapters.html#core-adapters

  1. composer require league/flysystem-aws-s3-v3
  2. set config/api.php
    'storage' => [ 'adapter' => 's3', 'key' => '<AWSAccessKeyId>', 'secret' => '<AWSSecretKey>', 'bucket' => 'odbdirectus', 'version' => 'latest', 'region' => 'eu-west-2', 'options' => [ 'ACL' => 'public-read', 'Cache-Control' => 'max-age=604800' ], 'endpoint' => 'https://apigateway.eu-west-2.amazonaws.com', 'root' => '/', 'thumb_root' => '/thumbnails', 'root_url' => 'https://s3-eu-west-2.amazonaws.com/odbdirectus', ],
  3. try to upload a file in file library

Expected Behavior

File uploads, can see it in File Library

Actual Behavior

  1. Initial green, turns red with a pop up message saying "No permission to write:

Technical Details

  • Device: Macbook
  • OS: MacOS 10.14.6,
  • Web Server: nginx
  • PHP Version: 7.2.0
  • Database: MySQL 5.7.27
  • Install Method: cloned master branch
bug

Most helpful comment

Hi @lintoncaldecott,

I'm wondering why you're setting endpoint directly? Since you're using official amazonaws, this shouldn't be necessary. For me, the apigateway-* prefixed there looks really strange. Where does this come from?
Also I would recommend setting your root to /originals instead of /. Since it _might_ interact with your thumbnails.

Either there is a missing permission on your bucket (which only you could check in your setting on AWS), or there is something wrong in your configuration.

Would you mind trying this configuration?

'storage' => [
  'adapter' => 's3',
  'key' => '<AWSAccessKeyId>',
  'secret' => '<AWSSecretKey>',
  'bucket' => 'odbdirectus',
  'version' => 'latest', 
  'region' => 'eu-west-2',
  'options' => [ 'ACL' => 'public-read', 'Cache-Control' => 'max-age=604800' ],
  'root' => '/originals',
  'thumb_root' => '/thumbnails',
  'root_url' => 'https://eu-west-2.amazonaws.com/odbdirectus/originals',
]

Hope this helps!

~ Michael

All 7 comments

Hi @lintoncaldecott,

I'm wondering why you're setting endpoint directly? Since you're using official amazonaws, this shouldn't be necessary. For me, the apigateway-* prefixed there looks really strange. Where does this come from?
Also I would recommend setting your root to /originals instead of /. Since it _might_ interact with your thumbnails.

Either there is a missing permission on your bucket (which only you could check in your setting on AWS), or there is something wrong in your configuration.

Would you mind trying this configuration?

'storage' => [
  'adapter' => 's3',
  'key' => '<AWSAccessKeyId>',
  'secret' => '<AWSSecretKey>',
  'bucket' => 'odbdirectus',
  'version' => 'latest', 
  'region' => 'eu-west-2',
  'options' => [ 'ACL' => 'public-read', 'Cache-Control' => 'max-age=604800' ],
  'root' => '/originals',
  'thumb_root' => '/thumbnails',
  'root_url' => 'https://eu-west-2.amazonaws.com/odbdirectus/originals',
]

Hope this helps!

~ Michael

@lintoncaldecott - Have you tried the configuration which @mvhirsch provided?

@lintoncaldecott - May I have an update on this?

Hey, @lintoncaldecott - Can you please provide your inputs here? If possible then please try to check it in our latest version.

@lintoncaldecott - 馃敂

Closing this issue due to inactivity. Feel free to reopen. 馃檪

Hi team, I am still having this issue,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HashemKhalifa picture HashemKhalifa  路  3Comments

vuhrmeister picture vuhrmeister  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments

chintohere picture chintohere  路  3Comments

metalmarco picture metalmarco  路  3Comments