• Resolved tylerlindell

    (@tylerlindell)


    I purchased pro today and started setting up CDN with this plugin for CloudFront. I’m looking forward to getting some help on this please.

    After inputting the key id and key of my aws user then clicking the “Create Distribution” button it says fail.

    Have tried with a user which has cloudfront and s3 full access as well as have tried one with full admin access. I’ve tried removing the keys and creating new ones – none of these work.

    I can access the account successfully with the aws cli with the creds I’m using in the key id and access key form fields when trying to create a distribution.

    There is no error in the PHP logs for some reason however, I was able to retrieve an error message from the POST request the plugin makes in attempt to create the distribution.

    the request that’s made is:

    POST /wp-admin/admin.php?page=w3tc_dashboard
    w3tc_cdn_create_container: 1
    _wpnonce: 28b3ed3c2e
    engine: cf2
    config[key]: <redacted>
    config[secret]: <redacted>

    Here’s the error it’s showing:

    500 Internal Server Error

    
    Fatal error: Uncaught Error: Argument 1 passed to Aws\Common\Client\AbstractClient::__construct() must be an instance of Aws\Common\Credentials\CredentialsInterface, array given, called in wp-content/plugins/w3-total-cache/CdnEngine_Mirror_CloudFront.php on line 39
    in wp-content/plugins/amazon-web-services/vendor/aws/Aws/Common/Client/AbstractClient.php on line 73
    
    Call stack:
    
    Aws\C\C\AbstractClient::__construct()
    wp-content/plugins/w3-total-cache/CdnEngine_Mirror_CloudFront.php:39
    W3TC\CdnEngine_Mirror_CloudFront::_init()
    wp-content/plugins/w3-total-cache/CdnEngine_Mirror_CloudFront.php:199
    W3TC\CdnEngine_Mirror_CloudFront::create_container()
    wp-content/plugins/w3-total-cache/Cdn_AdminActions.php:475
    W3TC\Cdn_AdminActions::w3tc_cdn_create_container()
    wp-content/plugins/w3-total-cache/Root_AdminActions.php:25
    W3TC\Root_AdminActions::execute()
    wp-content/plugins/w3-total-cache/Generic_Plugin_Admin.php:162
    W3TC\Generic_Plugin_Admin::load()
    wp-includes/class-wp-hook.php:287
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:311
    WP_Hook::do_action()
    wp-includes/plugin.php:478
    do_action()
    wp-admin/admin.php:232
    
    • This topic was modified 3 years, 11 months ago by tylerlindell.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tylerlindell

    (@tylerlindell)

    I figured it out. I had the Amazon Web Services plugin installed so it seems like w3tc was trying to use the AWS sdk version that was installed from that plugin (I think). Once I removed that, there was a second issue. I use UpDraft for backups which uses it’s own set of keys for AWS which only have access to S3. This time the message was clear, it said the user’s name and that it didn’t have access to create a distribution. That’s how I knew to update the creds for both plugins to use the same set.

    It’s unfortunate that I can only use one set of AWS creds bc I would rather have fine-grained control over authorization.

    It is fortunate though, that it’s working, now. Thanks

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tylerlindell

    Thank you for the information!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fail when trying to create distribution with CloudFront’ is closed to new replies.