WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
V 0.9.3 CDN Cloudfront Error - Empty Access Key (31 posts)

  1. sadujsaint
    Member
    Posted 11 months ago #

    I have just updated W3TC to the latest version and while everything appears to be running fine, I get an odd error when I test the Cloudfront distribution using the button in the "Configuration" section of the CDN sub-section on the dashboard.

    When I test it gives the error "Empty Access Key", despite working fine before and even when I try a different access key and secret key I still have the same problem.

    However, when I check files and images on my site I can clearly see that they are being served correctly from the CDN. Perhaps it is the error message at fault as everything else seems to be functioning perfectly.

    Anyone else with a similar issue or fix?
    (There is a tread for issues with MAXCDN as well:
    http://wordpress.org/support/topic/error-empty-hostname-for-maxcdn-test
    with some people reporting a similar issue)

    http://wordpress.org/plugins/w3-total-cache/

  2. nasca
    Member
    Posted 11 months ago #

    I was/am having the same issue ... sort of. I am getting the same error message when testing the configuration.

    I have tided to 'validate' the configuration 2 ways.
    (1) AWS>Sect Creds> CloudFront > Access and Secret
    (2) Create User / Group / Permissions via IAM with the AWS Policy Generator.

    However, even though the plugin does not validate the Access Key and Secret Key... CloudFront is serving content for my domain / site. I know this because when viewing the page source in the browser the CNAME configured in Route53 is visible. If you don't have Route 53 configured with a sub domain for CloudFront you will just see something like #######.cloudfront.com

    My guess is that the plugin validation needs to be updated and I wouldn't worry about the "Empty Access Key' error if in fact CloudFront is serving content.

  3. mattjabs
    Member
    Posted 11 months ago #

    I'm having this exact issue.

    When testing the Cloudfront distribution I receive: "Error: Empty access key."

    So in the w3tc CDN Configuration settings, under "Origin" I clicked "Create distribution" and it created a new distribution - which I verified by viewing my AWS Cloudfront Distributions dashboard.

    So now I have two distributions in my AWS Dashboard. I disabled my original one and let the new one propagate. I also created a 2nd Access Key ID (with Secret Access Key).

    In the w3tc CDN Configuration settings I input the new Access Key ID and new Secret Access Key. I also entered the new distribution prefix in the xxxxxxxxxxxxxx.cloudfront.net field.

    When I test the distribution I still get this message: "Error: Empty access key." Despite the error the CDN is still serving my page, but here's the kicker: when I purge the CDN of files (like say a style.css file) it purges/invalidates the OLD CDN distribution - the one I disabled!

  4. nasca
    Member
    Posted 11 months ago #

    This is the first time I have used CouldFront with this site so I haven't invalidated anything yet.

    I am curious though... when you view page source which distribution is serving content?

  5. sadujsaint
    Member
    Posted 11 months ago #

    Thanks for all the responses, good to know I am not alone with this. I have done my fair share of testing too and haven't come up with anything as of yet.

    @ nasca when I check the page source the CDN is still serving content, but I haven't tried testing any changes to CSS or adding new images (both served from the CDN) as this is now on a live site (I did test the update on my test site, but didn't spot this in time...).

    Regrettably I have had to disable my CDN for now within the plugin and relying only on Cloudflare to keep things up to speed. I will give it a day or two and if there is no fix I will revert to the previous version of W3TC as I am out of ideas on how we might fix this short of an update.

  6. mattjabs
    Member
    Posted 11 months ago #

    @nasca I have it disabled, but I reenabled it to check and it's serving the new distribution. It's worth noting that the display of the new distribution is broken - serving up a plain text version of each article/page - so I have to keep the CDN option disabled in w3tc until a fix comes out.

  7. PE-Pernet
    Member
    Posted 11 months ago #

    All,
    I initially setup a cloudfront instance, later because I don't get expected results, I try both Cloudfront and Cloudflare together... I finally disable my Cloudfront CDN.
    I have the same (even better) results with Cloudflare and it's free...

    I don't know if the issue comes from cloufront or using both cloudfront & cloudflare but my GTMetrix and Pingdom results are much better now.

  8. gr33nman
    Member
    Posted 11 months ago #

    I'm also having trouble getting Amazon Web Services Cloudfront CDN to work. It used to work. When I test the new suggested IAM configuration, I get this in red: Error: Empty access key.
    This page:
    https://portal.aws.amazon.com/gp/aws/securityCredentials?
    Has had this statement at the top for well over a year:
    Note: Please use the new page named Your Security Credentials in the AWS Management Console to manage security credentials. AWS will support the current page for a limited time to help during your transition.
    It's been about a year or more, I think.

    On this page:
    http://wordpress.org/plugins/w3-total-cache/faq/
    the directions seem still geared toward the old method of using root credentials. Are the directions up to date on how to use IAM policies on this W3 Total Cache FAQ page?

  9. szepe.viktor
    Member
    Posted 11 months ago #

    lib/W3/AdminActions/CdnActionsAdmin.php:371

    $config = W3_Request::get_string('config');
    $config = json_decode($config, true);

    w3tc tries to read config as a string, but config is not a JSON encoded array but a PHP array
    it gets "Array" as a value

    Solution??

    $config = W3_Request::get_array('config');
    //            $config = json_decode($config, true);

    Works for me.

    It would be good to have a github repo to have a Pull Request.

  10. mattjabs
    Member
    Posted 11 months ago #

    szepe.viktor - your solution worked for me too. Thanks for sharing!

  11. parse
    Member
    Posted 11 months ago #

    Having the same issue, the solution offered above didn't work for me.

    Deactivating W3 Total Cache until further notice.

  12. otreva
    Member
    Posted 11 months ago #

    Confirmed that does work:

    Starting at line 370 -> 373 use this:

    if (!isset($config['host'])) {
            $config = W3_Request::get_array('config');
            #$config = json_decode($config, true);
        }
  13. geophray
    Member
    Posted 11 months ago #

    Darn... I was hopeful that this would help resolve this same problem on my site, but to no avail. (I am using S3/Cloudfront.)

    It seems like it is serving from the CDN though, so I will probably leave the plugin active to keep the load off my server, but it would be nice to have a fix.

  14. scotthenning
    Member
    Posted 11 months ago #

    Having the same issue with RackSpace CloudFiles. Above solution doesn't work unfortunately.

  15. sagarrao
    Member
    Posted 11 months ago #

    The work around above didn't work for me either. I still have the Error: Empty hostname / CNAME list. Let me know if anybody have an alternative fix.

  16. Samara
    Member
    Posted 11 months ago #

    Just chiming in to add that I am having the same issue with both S3 and Cloudfront.

  17. nickc25
    Member
    Posted 11 months ago #

    I'm having the same issue. The developer does not reply to you either, he probably only replies to "customers" now...

  18. nemoprofeta
    Member
    Posted 11 months ago #

    I'm having the same issue.

  19. Omega Supreme
    Member
    Posted 11 months ago #

    Anyone that still has CDN issues, I posted a working solution until this is resolved.

    http://wordpress.org/support/topic/error-empty-hostname-cname-list?replies=11

  20. PE-Pernet
    Member
    Posted 11 months ago #

    Ok... I'm facing the same issue configuring W3 total cache with MaxCDN. I had to go back 0.9.21

  21. robscott
    Member
    Posted 10 months ago #

    Got this exact issue - says "error empty access key" when testing distribution.

    1) It is NOT empty!
    2) CDN is WORKING as it should!

    Just a glitch to iron out.

  22. aop1980
    Member
    Posted 10 months ago #

    I'm downgrading as well, the error causes a number of issues I believe with CDN syncing.

  23. aop1980
    Member
    Posted 10 months ago #

    Downgraded and problem is gone. Loading times back to the (faster) results prior to upgrade. CDN and W3TC wasn't syncing properly and minified files were taking 1-2 secs to download. Issue not present in 9.2.11.

  24. tfmwa
    Member
    Posted 10 months ago #

    I can also confirm that the issue is not present in 9.2.11 and that a rollback helped to fix it in our case.

    Hopefully the plugin owners can look into this as soon as possible.

  25. Samara
    Member
    Posted 10 months ago #

    I can confirm as well that rolling back to 9.2.11 fixes the problem.

  26. ussvisioninc
    Blocked
    Posted 10 months ago #

    Thank you for this thread and to all who have contributed. I just had two questions, as I'm a W3 newbie, and a Cloudfront newbie (double whammy).

    1. Is it possible that the latest version, with this glitch, can actually adversely affect your front-end, as well? Although when I view the source, I do see that the static files are loading via cdn.domain.com, just like I have set in my CNAMEs, my front end is slow, clumpy, and all out of whack when I enable the CDN.
    2. 2- As of September 27, is the only proven fix to roll back to the previous version? Commenting out the JSON line didn't do the trick for me.

    Basically, I just want to know if I should roll back to the last version, or revert back to WP Super Cache or some other caching plugin. I'm on a VPS with Hostgator, as well, if that helps. Thanks for any guidance anybody can offer!

  27. luckyankit
    Member
    Posted 8 months ago #

    $config = W3_Request::get_array('config');
    //            $config = json_decode($config, true);

    this worked for me in latest version....

    lib/W3/AdminActions/CdnActionsAdmin.php:371

  28. Tim Beks
    Member
    Posted 8 months ago #

    I was using 0.9.3 and bumped into this problem. I was using Amazon Cloudfront and when I tried to test the settings it was not working. I changed the following to see that the test has passed in wp-content/plugins/w3-total-cache/lib/W3/AdminActions/CdnActionsAdmin.php

    if (!isset($config['host'])) {
        $config = W3_Request::get_string('config');
        $config = json_decode($config, true);
    }
    
    $config = array_merge($config, array(
        'debug' => false
    ));
    
    if (!is_array($config['domain'])) {
       $config['domain'] = explode(',', $config['domain']);
    }

    To:

    if ( 'cf' !== $engine && !isset($config['host'])) {
       $config = W3_Request::get_string('config');
       $config = json_decode($config, true);
    }
    
    if( is_array( $config ) ) {
        $config = array_merge($config, array(
             'debug' => false
         ));
    }
    
    if ( isset( $config['domain'] ) && ! is_array( $config['domain'] ) ) {
       $config['domain'] = explode(',', $config['domain']);
    }

    Now the test is working.

  29. geophray
    Member
    Posted 8 months ago #

    I recently moved from an apache server to nginx and because I had didn't have the curl extension installed on the server, the Cloudfront option was greyed out. Because of that, I ended up selecting "Generic Mirror" and adjusting my cloudfront distribution to look at my webserver instead of an S3 bucket. Worked like a charm for me. Plus, now I don't pay for the additional storage space on S3.

  30. seanstoner
    Member
    Posted 7 months ago #

    I have tried the last several workarounds listed above, to no avail (including Tim's, luckyankit before his, etc.) using 0.9.3. C'mon maintainers - this issue is getting a little long in the tooth. Please fix!!

Reply »

You must log in to post.

About this Plugin

About this Topic