Cron job on Wordpress / AcyMailing / Cloudflare

Bonjour,
J’essaie de créer une tache cron au travers de wordpress 5.2.x car j’en ai besoin dans le cadre du plugin AcyMailing et c’est avec lui que j’essaie de créer ce Cron.

Malheureusement l’erreur que je reçois est la suivante :
Connection accepted to the host : ssl://www.scubalibre.ch : 443 at 21 June 19 5:54:12 ----------------------------------------- => Result of the trigger at 21 June 19 5:54:49 HTTP/1.1 403 Forbidden Date: Fri, 21 Jun 2019 03:54:12 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: close Set-Cookie: __cfduid=ddd371f2267eaaadcdc4716825ef6f2011561089252; expires=Sat, 20-Jun-20 03:54:12 GMT; path=/; domain=.scubalibre.ch; HttpOnly; Secure Vary: accept-language,accept-charset Accept-Ranges: bytes Content-Language: en Strict-Transport-Security: max-age=15552000; includeSubDomains; preload X-Content-Type-Options: nosniff Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" Server: cloudflare CF-RAY: 4ea30a34eee4d4b8-BRU.

J’ai essayé d’ajouter des règles mais sans succès.
Désactivé mon plugin de cache local, là aussi, sans succès.

Le support d’AcyMailing me dit que c’est un problème venant de Cloudflare.
Quelqu’un aurait-il une idée ?

Merci pour votre aide.

Hello,
I’m trying to create a cron job through wordpress 5.2.x because I need it as part of the AcyMailing plugin and it’s with him that I try to create this Cron.

Unfortunately the mistake I get is:
Connection accepted to the host : ssl://www.scubalibre.ch : 443 at 21 June 19 5:54:12 ----------------------------------------- => Result of the trigger at 21 June 19 5:54:49 HTTP/1.1 403 Forbidden Date: Fri, 21 Jun 2019 03:54:12 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: close Set-Cookie: __cfduid=ddd371f2267eaaadcdc4716825ef6f2011561089252; expires=Sat, 20-Jun-20 03:54:12 GMT; path=/; domain=.scubalibre.ch; HttpOnly; Secure Vary: accept-language,accept-charset Accept-Ranges: bytes Content-Language: en Strict-Transport-Security: max-age=15552000; includeSubDomains; preload X-Content-Type-Options: nosniff Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" Server: cloudflare CF-RAY: 4ea30a34eee4d4b8-BRU.

I tried to add rules but without success.
Deactivated my local cache plugin, again, without success.

AcyMailing support tells me it’s a problem from Cloudflare.
Does anyone have an idea?

Thanks for your help.

Hi @scubalibre,

It looks like your cronjob is triggering some kind of Cloudflare protection, but we would need to investigate what rule is causing the block. This could be the result of rules created by you such as a Firewall Rule, an IP Access Rule, a User Agent Block rule etc, or it could be rule created by Cloudflare, such as a WAF rule (applies if you are on a paid plan), rate limiting etc.

You can check your Firewall Events log to see if there is a record for the day and time that this blocking occurred. Or you could search by Ray ID. It should give you hints and perhaps list the Firewall Rule that applied, if any.

A better way, if you are familiar with API requests, is to make a request for the events that match the Ray ID, and that could provide you details the UI may not show.

For example, I copied the following curl command from Postman, I hope it works for you. Replace the {{variables}} with respective values.

curl -X GET \
  'https://api.cloudflare.com/client/v4/zones/{{zone_id}}/security/events?ray_id={{ray_id}}' \
  -H 'Accept: */*' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Host: api.cloudflare.com' \
  -H 'X-Auth-Email: {{email}}' \
  -H 'X-Auth-Key: {{api_key}}' \
  -H 'cache-control: no-cache' \

Then you’d need to somehow whitelist your cronjob from the specific rule that is blocking it.

Hello @floripare,
Thank you for wanting to help me.
Now, being a novice in this, I did not understand everything that you wrote to me and I’m sorry about it.

What should I do with this curl command?
Where should I run it?

Actually I tried to add a rule to my firewall but I already had this error before.
I have tried to whitelist the following URI: /wp-admin/admin-ajax.php?page=acymailing_front&ctrl=cron&action=acymailing_frontrouter&noheader=1&no_html=1

Once again, I am lost in what you tell me.
Thank you very much

Hi @scubalibre,

You can google “curl command” and decide for yourself if it’s something you’d want to learn. There are plenty of blogs and tutorials on the internet on how to use it.

Did you try the searching on the Firewall Events log using the Ray ID? What was the result?

Hello @floripare ,
Thank you for your reply
I have already looked in my firewall logs and there is nothing.
I am now going to waste my time looking on Google how to learn CURL you never know if it can solve my problem or not but I will know CURL.

Thanks a lot for your help

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.