• Resolved advwebin

    (@advwebin)


    Hi Saumya,

    I have setup cloudflare super cache as per the recommended setting but when i turn on worker, i keep getting error

    workers/scripts/swcfpc_worker_1665662891, perhaps your object identifier is invalid? (err code: 7003)

    I also checked worker section and there is no worker which has been generated.

    Can you please guide me through the process.

    I am using the global api key with the site.

Viewing 15 replies - 16 through 30 (of 30 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    OK I see the issue here. There is no account id. DIDn’t you selected the domain at the time of setting up the plugin? I mean on page 1 in the plugin settings. After you provide your API key details you need to select the domain/zone of your website. Didn’t you do that?
    Screenshot: https://i.imgur.com/6mesCYC.jpeg

    It seems the plugin doesn’t know your account id and so it cannot add the works.

    Moreover, with the latest update, I’ve released a new feature to use the page rule without the cache buster. Check the plugin settings > Other tab and scroll down. Read the implementation guidelines before enabling the option, if you would like to use it.

    But I think with that option, the requirement of using workers will be greatly reduced.

    Thread Starter advwebin

    (@advwebin)

    Hi Saumya
    I did select the domain but the issue is only with worker mode.

    I checked my cloudflare account and the worker is not created there, even checked manage workers section.

    https://wormhole.app/JjA8D#7_mSm85Aa1UBFYbFXN8Gpw

    Screenshot of my settings page

    Plugin Contributor iSaumya

    (@isaumya)

    Well, then you need to check why the plugin is unable to get your account id from Cloudflare. Try deactivating and deleting the plugin from WP Admin > Plugin section.

    Then do fresh install of the plugin. and before entering any API details:
    1. Enable the log mode
    2. Under the Others tab, set the Log Verbosity to HIGH.

    Then add the Global API Key and email ids and then if you still face the same issue, download the whole log and read from the top so that you can see what happened with the request when the plugin tried to fetch your account id.

    You are having this issue cause the plugin doesn’t have your account ID so it can’t send the request properly to Cloudflare to do the Worker stuff.

    Thread Starter advwebin

    (@advwebin)

    Plugin Contributor iSaumya

    (@isaumya)

    Huh! This is so weird. Can you do 1 thing, Inside the cloudflare.class.php file on line no 872 add the following line:

    $this->objects['logs']->add_log('cloudflare::get_current_account_id', "account ID: {$account_id}" );
    $this->objects['logs']->add_log('cloudflare::get_current_account_id', "account ID Arr: {$this->account_id_list}" );

    Then inside the plugin clear the log and then do disable/enable the cache inside the plugin settings page and then do the same things you have done land tine and now check the logs and share if you can. I have no idea what’s going on in your website and as I don’t have access to your site I can’t dig deeper also.

    • This reply was modified 3 years, 6 months ago by iSaumya. Reason: also print the array
    Thread Starter advwebin

    (@advwebin)

    Hi saumya,

    The issue is with worker only.
    https://safenote.co/r/6373ba66116a09@81608940

    Plugin Contributor iSaumya

    (@isaumya)

    OK. I think I know why this is happening. Answer this:
    the Cloudflare account you are using, is it the original super admin Cloudflare account OR it is an account where the main account has added you as a member to manage that zone?

    The reason I am asking you this is because in the API response I see 2 account ids. This is generally not the case if you are using the original cloudflare account and instead this is the case when you are using a cloudflare account which truly down’t own the Zone but rather has been added as a member to the main Cloudflare Zone.

    Thread Starter advwebin

    (@advwebin)

    I thought that as well, but the domain is on my account and thats the one I am generating the API and token from.

    The domain is on my account and no resources are being shared from that.
    I even selected the domain while generating the token while using the token and also while using the API in the settings in plugin.

    Plugin Contributor iSaumya

    (@isaumya)

    You are not understanding the problem here. The Cloudflare acc email id and API key you are using is not a singular true primary account. Rather it also has other accounts added as members. So, the plugin have no way to know which account id to use.

    If you cannot use the main Cloudflare account that doesn’t have have any other sites added as member, then you have to make sure that the account you want to use, that account’s name has the email id that you have entered in the plugin settings added to it.

    For example when you setup a Cloudflare account, the default account name generally is [email protected] account and then you go to the CF settings page to change that to what you like.

    But as the CF account details you are using has 2 account ids associated with it, you need to make sure the account id you want to use for this plugin has the email id added to the account name. Then the plugin will detect that and use that account id.

    Thread Starter advwebin

    (@advwebin)

    That was spot on.

    The other account was an old shared account.
    I left the account and saved the worker. It worked on the first try!

    thank you

    Plugin Contributor iSaumya

    (@isaumya)

    No problem. Enjoy the plugin. 🙂
    With the recent release of the plugin, I will recommend trying out the new option of using page rules without the cache buster query sting rather than using Workers unless you absolutely need it. The reason behind worker is not 100% free and the new ways are also giving a great performance.

    I’m marking this thread as resolved. If you loved the plugin, please consider sharing a review in the review section.

    • This reply was modified 3 years, 6 months ago by iSaumya.
    Thread Starter advwebin

    (@advwebin)

    I will give it a try,

    Would this be better for highly dynamic websites like sports and entertainment websites where content is regularly updated? and has users in different geographic regions ?

    Plugin Contributor iSaumya

    (@isaumya)

    Would this be better for highly dynamic websites like sports and entertainment websites where content is regularly updated? and has users in different geographic regions ?

    – Worker and page rules (with the added options) does the same thing. I personally think the other option is better and gives a little better performance and also it’s 100% free unlike worker.

    But if you are editing our default worker code to add your own custom things into it, then worker is the only way for you.

    Thread Starter advwebin

    (@advwebin)

    Hello again,

    I tried the cache Buster setting and it works really well, But I was not able to get the cache to clear on posting new content.

    I waited for over 5 mins but that didn’t reflect on cloudflare.

    Is there a way it can clear the CF cache on post publish?

    Plugin Contributor iSaumya

    (@isaumya)

    Is there a way it can clear the CF cache on post publish?

    – It should happen by default. Enable the log mode and set log verbosity to high and then check the logs to see whats going on…
    I have not faced this problem once across many sites I have implemented this feature.

Viewing 15 replies - 16 through 30 (of 30 total)

The topic ‘Cloudflare worker not setting up’ is closed to new replies.