SonataMediaBundle: AWS-SDK - MISSING REQUIRED CLIENT CONFIGURATION OPTIONS region and version

There is a related issue and the reporter reverted the aws-sdk to an older version, this shouldn’t be the way to go. I believe SonataMediaBundle should update its source to fix this bug.

Environment

dev and prod

Sonata packages

SonataMediaBundle

$ composer show sonata-project/*
sonata-project/admin-bundle              2.3.10 Symfony SonataAdminBundle
sonata-project/block-bundle              2.2.15 Symfony SonataBlockBundle
sonata-project/cache                     1.0.7  Cache library
sonata-project/classification-bundle     2.2.3  Symfony SonataClassificationBundle
sonata-project/core-bundle               2.3.11 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.2    Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.0.2  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 2.3.4  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle       2.1.10 Symfony SonataEasyExtendsBundle
sonata-project/exporter                  1.7.0  Lightweight Exporter library
sonata-project/intl-bundle               2.2.4  Symfony SonataIntlBundle
sonata-project/media-bundle              2.3.4  Symfony SonataMediaBundle
sonata-project/notification-bundle       2.3.4  Symfony SonataNotificationBundle
sonata-project/translation-bundle        1.1.0  SonataTranslationBundle

Symfony packages

$ composer show symfony/*
symfony/assetic-bundle     v2.8.0  Integrates Assetic into Symfony2
symfony/monolog-bundle     2.11.1  Symfony MonologBundle
symfony/polyfill-apcu      v1.2.0  Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu  v1.2.0  Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring  v1.2.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php54     v1.2.0  Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions
symfony/polyfill-php55     v1.2.0  Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions
symfony/polyfill-php56     v1.2.0  Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70     v1.2.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util      v1.2.0  Symfony utilities for portability of PHP codes
symfony/security-acl       v2.8.0  Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v2.3.11 Symfony SwiftmailerBundle
symfony/symfony            v2.8.10 The Symfony PHP framework

PHP version

$ php -v
PHP 7.0.8 (cli) (built: Jun 21 2016 15:27:20) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans

Steps to reproduce

Just install SonataMediaBundle and update all dependencies then clear cache

Expected results

Cache cleared successfully

Actual results

Get error MISSING REQUIRED CLIENT CONFIGURATION OPTIONS exception

php.exe E:\xampp\htdocs\projects\symfony2\inspot\app\console cache:clear --env=dev


  [InvalidArgumentException]                                                          
  Missing required client configuration options ok man?:                              
  region: (string)                                                                    
    A "region" configuration value is required for the "s3" service                   
    (e.g., "us-west-2"). A list of available public regions and endpoints can be      
    found at http://docs.aws.amazon.com/general/latest/gr/rande.html.                 
  version: (string)                                                                   
    A "version" configuration value is required. Specifying a version constraint      
    ensures that your code will not be affected by a breaking change made to the      
    service. For example, when using Amazon S3, you can lock your API version to      
    "2006-03-01".                                                                     

    Your build of the SDK has the following version(s) of "s3": * "2006-03-01"        

    You may provide "latest" to the "version" configuration value to utilize the      
    most recent available API version that your client's API provider can find.       
    Note: Using 'latest' in a production application is not recommended.              

    A list of available API versions can be found on each client's API documentation  
    page: http://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html. If you are        
    unable to load a specific API version, then you may need to update your copy of   
    the SDK.                                                                          



Process finished with exit code 1 at 22:03:09.
Execution time: 9,703 ms.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 20 (13 by maintainers)

Most upvoted comments

Feel free to open a PR @nathandaly

It was this issue #860 that I meant. The author downgraded aws-sdk to a lesser version. So, if the aws/aws-sdk-php is updated to version 3 in a “composer update” command, the SonataMediaBundle’s S3 config is broken.

Anyway, I have looked into SonataMediaBundle’s latest branch and I do see that sdk_version: 3 has to be added to under sonata_media.filesystem.s3

so my config looks like

sonata_media:
    filesystem:
        local:
            directory:  %kernel.root_dir%/../web/uploads/media
            create:     false
#        Amazon s3
        s3:
            sdk_version: 3
            bucket: %s3_bucket_name%
            accessKey: %s3_access_key%
            secretKey: %s3_secret_key%
            region: %s3_region%
            directory: %s3_directory%

Where do I go to update the documentation ?