• Resolved Hammy Havoc

    (@hammyhavoc)


    I get Unauthorized to access requested resource (err code: 9109) whenever I try to Enable Page Caching on a specific website, however, it works fine on all my other sites. I don’t understand. Tried changing the API keys multiple times, switching between global and token, and checking perms for the API key.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @hammyhavoc,
    That is so wired. Is this happening at the setup wizard screen? Can you confirm that the Cloudflare account you are using in the plugin is actually the owner of the plugin and not an external user who is a member to that account? Also can you try using the Global API?

    Please share some screenshot or screen recording of the issue. Moreover, inside the plugin settings, under the Other tab set log verbosity to HIGH and then try again. If it fails check the plugin log to see what response are we getting from Cloudflare API.

    Hi @isaumya

    I’m Bryan, the owner of the website.

    Yes, this issue would happening at the setup wizard screen. Please see the screen shot

    Both Hammy’s and my own accounts have been used to try and enable page caching. No luck.

    As for the verbosity log, here is what that showed:

    [2023-06-09 15:49:40] [cloudflare::cloudflare_get_browser_cache_ttl] Request [https://api.cloudflare.com/client/v4/zones/90cb38803717cf8f3e6e45b63b1c17c8/settings/browser_cache_ttl](https://api.cloudflare.com/client/v4/zones/90cb38803717cf8f3e6e45b63b1c17c8/settings/browser_cache_ttl) [2023-06-09 15:49:40] [cloudflare::cloudflare_get_browser_cache_ttl] Response {"success":false,"errors":[{"code":9109,"message":"Unauthorized to access requested resource"}],"messages":[],"result":null} [2023-06-09 15:49:40] [cloudflare::cloudflare_set_browser_cache_ttl] Request URL: [https://api.cloudflare.com/client/v4/zones/90cb38803717cf8f3e6e45b63b1c17c8/settings/browser_cache_ttl](https://api.cloudflare.com/client/v4/zones/90cb38803717cf8f3e6e45b63b1c17c8/settings/browser_cache_ttl) [2023-06-09 15:49:40] [cloudflare::cloudflare_set_browser_cache_ttl] Request body: {"value":0} [2023-06-09 15:49:40] [cloudflare::cloudflare_set_browser_cache_ttl] Response: {"success":false,"errors":[{"code":9109,"message":"Unauthorized to access requested resource"}],"messages":[],"result":null}

    We also noticed the API call is mentioning a zone ID that does not match the zone ID we are seeing on my account. My account for the domain bryandesrosiers.com is 26b608383f1384c289610a2247f5eb2b.

    We are wondering if it is referencing the old zone ID still even though it shouldn’t be the case as the email address and API key has been updated, puzzling.

    We also did try the global API key but that brought us no joy.

    • This reply was modified 1 year, 1 month ago by bryandesrosiers. Reason: Fixing image block
    Plugin Contributor iSaumya

    (@isaumya)

    Hi @bryandesrosiers,
    Can you please ensure that the Cloudflare account details you are using is actually the super admin/true owner of that zone and it’s not an member account which has been invited by the admin?

    Hey @isaumya,

    I have just readded the global API key with Authentication Mode set to API Key and it still does not work. I even copy-pasted it fresh from my own CloudFlare Account and it’s definitely my website on my own CloudFlare Account.

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @bryandesrosiers,
    Can you check if the nameserver that is asked by your account to set for the domain are the following:

    cheryl.ns.cloudflare.com
    kellen.ns.cloudflare.com

    It might be possible that your domain is being used by some other Cloudflare account. That can cause this issue. Check:

    https://wordpress.org/support/topic/unauthorized-to-access-requested-resource-err-code-9109/

    A lot of the times hosting companies do this on their own which might cause this issue.

    Hey @isaumya,

    Have checked the nameserver and I can confirm they are set to this.

    Plugin Contributor iSaumya

    (@isaumya)

    Well, then you have to open a support ticket with Cloudflare asking them about why API calls are not working and after making API requests you are getting:

    {"success":false,"errors":[{"code":9109,"message":"Unauthorized to access requested resource"}],"messages":[],"result":null}

    They can look into it and see what’s going on…

    Hey @isaumya So it seems I cannot actually make a support ticket with CF, the process just ends up taking me up CloudFare Community which I searched their forum for anyone who may have had a similar issue and this thread popped up with the same error code: https://community.cloudflare.com/t/wordpress-cache-plugin-error-9109/435171

    Do you have any thoughts on this thread? It seems the issues lies with the plugin rather than CF.

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @bryandesrosiers,
    Just looked at that thread and it is just useless. I’ll suggest you to do the following:

    1. Download Postman
    2. Then make a simple API call t Cloudflare with your email and global API key: https://developers.cloudflare.com/api/operations/zone-settings-get-always-online-setting
    3. I’m sure it will fail with the same error message and then take that screenshot and share in the community.
    4. There is no point of talking about the plugin, talk about why you are unable to make API calls with your API details…

    Hey, @bryandesrosiers!

    I was going through the exact same issue, and what actually worked for me was simply deactivating, removing, re-installing and re-configuring the plugin. After that the “Enable Page Caching” went straight through 🙂

    Thank you so much @dt4ils, this worked 100% and let me enable the final step for the plugin. Is there anyway I can buy you a cup of coffee?

    @isaumya it does seem to be a plugin issue if what was required is to deactivate, uninstall, reinstall, reactivate and reconfigure. Doesn’t seem like a Cloudflare issue.

    Don’t you worry about it, @bryandesrosiers! I’m simply glad I was able to help 🙂

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @dt4ils,
    Thank you so much for sharing your experience via your response.

    @bryandesrosiers, I’ve personally never faced such issues across many sites I’ve used this plugin, so I’m not entirely sure why and what caused it. But I’m happy to heart that your issue has been resolved now.

    Fyi, I had this same problem and the solution was to set the plugin to not keep settings on deactivation, deactivate, delete, clear hosting cache, re-install, re-activate, and re-configure the Super Page Cache for Cloudflare.

    One additional detail that may be helpful if the plugin authors choose to explore this issue further: In my case, I had moved the domain from one Cloudflare (CF) account to another. This plugin was working perfectly until the domain changed from one account to the other. And yes, I am the full owner of both CF accounts with all of the necessary permissions, and I updated the credentials in the plugin settings as needed to connect to the new CF account (tried both API key and token methods and nothing would work).

    The only solution was to remove the plugin settings; I even tried de-activating and re-activating and it didn’t work because the plugin settings had not been deleted. Going to Other > Keep settings on deactivation and turning that off before removing this plugin was what did the trick.

    Great plugin! Really love it! Just thought I’d share these findings in case they are helpful.

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @kizinko,

    I had moved the domain from one Cloudflare (CF) account to another. This plugin was working perfectly until the domain changed from one account to the other. And yes, I am the full owner of both CF accounts with all of the necessary permissions, and I updated the credentials in the plugin settings as needed to connect to the new CF account (tried both API key and token methods and nothing would work).

    When you move zones from one account to the other, CF API takes some time to update that details. Nothing can be done about that.

    The plugin settings are only deleted when you Delete the plugin from the WP Admin > Plugin section. Not on deactivation.

    Thanks a lot for sharing your experience.

Viewing 15 replies - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.