• Resolved elanbennett

    (@elanbennett)


    Getting errors when attempting to select or list AWS s3 buckets. Errors:

    Error Getting Bucket Region — There was an error attempting to get the region of the bucket tenx-wp-content: Failed to instantiate the provider client. Check your error log. Function called:- DeliciousBrainsWP_Offload_MediaProvidersStorageNull_Provider->get_bucket_location()

    Error Getting Buckets — Failed to instantiate the provider client. Check your error log. Function called:- DeliciousBrainsWP_Offload_MediaProvidersStorageNull_Provider->list_buckets()

    We are using IAM roles to auth to S3 following these guides: https://deliciousbrains.com/wp-offload-media/doc/custom-iam-policy-for-amazon-s3/#minimum-policy
    https://deliciousbrains.com/wp-offload-media/doc/iam-roles/
    Our wordpress is hosted on ECS.

    We enabled WP_DEBUG in wp-config.php:

    define( 'WP_DEBUG', true );
    define ('WP_DEBUG_LOG', true );
    define ('WP_DEBUG_DISPLAY', false );

    but the log does not show additional information regarding the error:

    [24-Aug-2023 22:23:42 UTC] AS3CF_DeliciousBrains\WP_Offload_Media\Providers\Storage\Null_Provider->list_buckets(): Array
    (
    )

    I have also enabled the iam role manually through wp-config.php with the following:

    define( 'AS3CF_AWS_USE_EC2_IAM_ROLE', true );
    
    define( 'AS3CF_SETTINGS', serialize( array(
        'provider' => 'aws',
        'use-server-roles' => true,
    ) ) );

    I can see that it is being defined by wp-config in the console, however the buckets will still not connect. Any idea what is going on?

    • This topic was modified 1 year, 3 months ago by elanbennett.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Delicious Brains Support

    (@dbisupport)

    Hi @elanbennett!

    WP Offload Media Support Team here. Thanks for reaching out with your query! We would be happy to assist.

    Can you kindly remove the AS3CF_AWS_USE_EC2_IAM_ROLE define? It does the same thing as using the “use-server-roles” key in the AS3CF_SETTINGS define. But we would recommend using the AS3CF_SETTINGS define for its flexibility. Please also make sure it’s placed before this line in the wp-config.php file:

    /* That's all, stop editing! Happy publishing. */

    Would you also be able to send the debugging information from the Support tab on the site you’re having trouble with?

    • Go to the Support tab of your install
    • Scroll down to the “Diagnostic Info”
    • Paste it here in your next response. Please omit anything you deem is sensitive info.

    We look forward to your response!

    Thread Starter elanbennett

    (@elanbennett)

    Diagnostic Info:
    
    site_url(): ####
    home_url(): ####
    Database Name: ####
    Table Prefix: wp_
    WordPress: 6.2.2
    Web Server: Apache
    PHP: 8.2.9
    MySQL: 5.7.41
    ext/mysqli: yes
    PHP Memory Limit: 512M
    WP Memory Limit: 40M
    Memory Usage: 8 MB
    Blocked External HTTP Requests: None
    WP Locale: en_US
    Organize offloads by month/year: Enabled
    WP_DEBUG: Yes
    WP_DEBUG_LOG: Yes
    WP_DEBUG_DISPLAY: No
    SCRIPT_DEBUG: No
    WP Max Upload Size: 80 MB
    PHP Time Limit: 30
    PHP Error Log: /opt/bitnami/wordpress/wp-content/debug.log
    WP Cron: Enabled
    fsockopen: Enabled
    allow_url_fopen: Enabled
    OpenSSL: OpenSSL 1.1.1n 15 Mar 2022
    cURL: 7.74.0
    Zlib Compression: Enabled
    PHP GD: bundled (2.1.0 compatible)
    Imagick: Enabled
    Basic Auth: Disabled
    Proxy: Disabled
    
    Total Media Items: 1,019
    Total Offloaded Media Items: 946
    Total Not Offloaded Media Items: 73
    
    Media Library Items: 1,019
    Offloaded Media Library Items: 946
    Not Offloaded Media Library Items: 73
    
    Number of Image Sizes: 42
    
    Names and Dimensions of Image Sizes:
    thumbnail (150x150)
    medium (300x300)
    large (1024x1024)
    1536x1536 (1536x1536)
    2048x2048 (2048x2048)
    header-1 (552x729)
    header-1-2x (1104x1458)
    header-bg (2066x822)
    hp-benefits (381x776)
    hp-benefits-2x (761x1550)
    hp-numbers (838x679)
    hp-numbers-2x (1677x1358)
    hp-numbers-icons (41x35)
    hp-numbers-icons-2x (82x70)
    hp-testimonials (165x165)
    hp-testimonials-2x (330x330)
    hp-tabs (652x342)
    hp-tabs-2x (1302x684)
    hp-cta (0x398)
    hp-cta-2x (0x796)
    logos (0x45)
    logos-2x (0x90)
    dashboard (1014x700)
    dashboard-2x (2029x1400)
    highlights (375x764)
    highlights-2x (750x1528)
    highlights-m (120x325)
    highlights-m-2x (240x650)
    case-study (326x217)
    case-study-2x (652x434)
    product-f-right (952x728)
    product-f-right-2x (1905x1457)
    leadership (164x166)
    leadership-2x (327x332)
    locations (117x75)
    locations-2x (234x50)
    history (46x35)
    history-2x (94x72)
    history-3x (150x150)
    post-thumbnail (none)
    post-thumbnail-2x (854x822)
    
    WP_CONTENT_DIR: /opt/bitnami/wordpress/wp-content
    WP_CONTENT_URL: ####
    UPLOADS: Not defined
    WP_PLUGIN_DIR: /opt/bitnami/wordpress/wp-content/plugins
    WP_PLUGIN_URL: ####/wp-content/plugins
    
    AS3CF_PROVIDER: Not defined
    AS3CF_BUCKET: Not defined
    AS3CF_REGION: Not defined
    AS3CF_SETTINGS: Defined
    AS3CF_SETTINGS Keys: provider
    
    Local URL:
    https://####/wp-content/uploads/2023/08/example.jpg
    Offload URL:
    https://####/wp-content/uploads/2023/08/29161758/example.jpg
    
    OME Metadata Version: 12
    
    Custom tables:
    wp_as3cf_items: Ok
    
    Storage Provider: Amazon S3
    Use Server Roles: On
    Key File Path: N/A
    Access Keys Set: No
    Access Key ID Define: Not defined
    Secret Access Key Define: Not defined
    
    Bucket: ####.####
    Region: us-west-2
    Block All Public Access: Unknown
    Object Ownership Enforced: Unknown
    
    Offload Media: On
    Remove Local Media: Off
    Enable Add Prefix to Bucket Path: On
    Custom Prefix for Bucket Path: ####/wp-content/uploads/
    Add Year & Month to Bucket Path: On
    Add Object Version to Bucket Path: On
    
    Delivery Provider: Other
    Deliver Offloaded Media: On
    Use Custom Domain Name (CNAME): On
    Custom Domain (CNAME): ####.####
    
    Force HTTPS: On
    • This reply was modified 1 year, 3 months ago by elanbennett.
    Thread Starter elanbennett

    (@elanbennett)

    Issue was resolved after updating from WP Offload Media Lite v3.2.4 -> v3.2.5. Looks like we needed the new AWS PHP SDK version.

    Plugin Support Delicious Brains Support

    (@dbisupport)

    Hi @elanbennett ,

    Glad to hear that, thanks for letting us know!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot connect to S3 buckets’ is closed to new replies.