Events Made Easy › Forums › Generic › De-scheduling the sending of queued emails
- This topic has 33 replies, 2 voices, and was last updated 3 years ago by Franky.
-
AuthorPosts
-
Sun 12 Dec 2021 at 18:21 #63582AnonymousInactive
Hi Franky
Following the last update eme_cron_send_queued disappeared and I had to reschedule the sending of queued mails. This is not the first time I’ve had this surprise and this time it was concurrent with the EME update. It was the only update of the day and it happened at 4am at my place. I can also say that not all EME updates cause this disappearance. So I am doubtful.Frédéric
Sun 12 Dec 2021 at 19:24 #63583FrankyKeymasterI checked and rechecked the code, but can’t find a reason to this.
Are these actions still planned? Namely: eme_cron_member_daily_actions, eme_cron_events_daily_actions, eme_cron_gdpr_daily_actionsEdit: eme_cron_gdpr_daily_actions had a bug (was removed upon activation, I’ll fix that for the next version, but is not critical)
Sun 12 Dec 2021 at 22:39 #63584AnonymousInactiveYes the other eme_cron are still planned. I will continue to monitor this to remove any doubt. I can only testify if it happens again.
Sun 12 Dec 2021 at 23:18 #63586FrankyKeymasterDo you by any chance remember from which version you upgraded? Or was is the latest previous version?
Mon 13 Dec 2021 at 00:54 #63587AnonymousInactiveCorrection: CRON that remained programmed are eme_cron_cleanup_captcha eme_cron_events_daily_actions eme_cron_member_daily_actions
The Pb was after the update from 2.2.39 to 2.2.40
I also have some members who have restricted access to the administration but they can only access the events they have scheduled and not the other EME menusMon 13 Dec 2021 at 15:48 #63589AnonymousInactivefor eme_cron_send_queued my settings were 130 every minute. Perhaps this is too high?
Mon 13 Dec 2021 at 21:41 #63595AnonymousInactiveHi Franky
I don’t think the EME update is to blame. I have indeed had another deprogramming for no reason. I’m looking into why the action planning is not persistentTue 14 Dec 2021 at 08:53 #63598AnonymousInactiveHi Franky
Do you know a way to monitor this parameter specifically and be alerted when there is a change?Tue 14 Dec 2021 at 11:19 #63599FrankyKeymasterSorry, but I do not. Is it always the same one that gets removed?
Tue 14 Dec 2021 at 18:44 #63600AnonymousInactiveyes it’s always eme_cron_send_queued
I changed the schedule to 50 every 5 minutes.
I am still looking for a way to monitor this setting. Ideally I would like to receive an email when this setting changes or is changedTue 14 Dec 2021 at 18:54 #63601FrankyKeymasterCan it be some sync plugin is doing this? Because I have several sites and never experienced this.
Tue 14 Dec 2021 at 19:53 #63602FrankyKeymasterAlthough it should not change anything, here’s a small change:
https://plugins.trac.wordpress.org/changeset/2644104/But if only eme_cron_send_queued gets removed, that change shouldn’t really make a difference …
Tue 14 Dec 2021 at 22:40 #63603AnonymousInactiveWhat characterises eme_cron_send_queued is the “every minute” frequency that I had selected. I have since changed the setting to “every five minutes”.
Indeed, the reservations for each event are limited to 6 maximum, but the bookers like a quick confirmation.Tue 14 Dec 2021 at 22:43 #63604AnonymousInactiveIn the cron tab another hook has the frequency “every minute” and may have “ejected” eme_cron_send_queued? It is action_scheduler_run_queue
I’m still following up but fortunately the problem doesn’t happen every dayTue 14 Dec 2021 at 23:07 #63605FrankyKeymasterOne cron should not eject another, so I don’t think that’s the case here.
Wed 15 Dec 2021 at 09:54 #63606AnonymousInactiveAre the parameters collected in the ” scheduled actions ” tab not reset to 0 at some point.For example, at the end of a mailing or when the queue empties after several mailings?
Couldn’t the problem come from the fact that this parameter is reset in some cases?Wed 15 Dec 2021 at 10:45 #63607FrankyKeymasterNo, they’re wordpress recurring schedules. WordPress reschedules them to run at the following interval, even if the run failed. The schedule never gets cleared, unless you decide you don’t want queueing, but that’s a manual action in the CRON submenu.
Wed 15 Dec 2021 at 12:22 #63608AnonymousInactiveI assume that the parameters (number and frequency) of the sending schedule are stored in the database. Where? And is it possible to find out when this data was last changed?
Wed 15 Dec 2021 at 13:46 #63609FrankyKeymasterThat is a question that no longer falls under EME support.
Check the options table, option name “cron”. That’s just something I found yesterday too, but for the rest this is all WP, not EME.Wed 15 Dec 2021 at 14:17 #63610AnonymousInactiveOK, Franky. Thanks for everything. I won’t bother you any more with this without new and reproducible elements.
Sat 18 Dec 2021 at 11:00 #63637AnonymousInactiveJust for information.
At 10.30pm last night I checked the schedule which was set at 50 every 5 minutes. The queue was empty. At 00:1 EME placed 6 messages as agreed in the queue.
This morning at 10:00 I checked. The mails were still in the queue and my setting had been deprogrammed (so no sending).
No extension updates were made. The Wordfence plugin blocked two fraudulent login attempts and alerted me to a necessary plugin update.
Once the queue was reprogrammed all emails were sent normally.
I tried to check the logs of my host but did not see anything significant.
I am hesitant to disable wordfence for security reasons. If anyone has any ideas?Sat 18 Dec 2021 at 14:02 #63638FrankyKeymasterCan something be changing things in the database? Or a sync from a dev-server to prod or so?
And nothing in the apache/php logs?Sat 18 Dec 2021 at 14:40 #63639FrankyKeymasterIt seems wordpress has a cron-bug if you have many crons and more than 1 process executes the cron at the same time:
https://core.trac.wordpress.org/ticket/51716My question here to you: which cron method do you use? The one from wordpress or system cron? See the tip at the top of the “Scheduled actions” EME settings page, where I explain how to use your system cron. If you’re not using that, this might be the time 🙂
Sat 18 Dec 2021 at 16:03 #63640AnonymousInactiveThe logs tell me nothing because I don’t know what to look for. My host OVH offers a “web”, “ftp”, “error”, “cgi”, out, ssh and cron log. cron and cgi are empty. ftp and ssh normal or empty. The “web” only reports GET or POST requests from users or robots. The “error” has nothing in the time frame considered.
A collision in the wp-cron system seems more likely. I use the WPForms plugin which schedules a lot of tasks, but is very useful for making contact forms without publicly broadcasting email addresses.
My method today is the WP method. I read your proposal to program directly at the host. But this one limits the frequency to 1 per hour.
So I hesitate to take the step. Perhaps I should do it to remove any doubts…?Sat 18 Dec 2021 at 16:28 #63641AnonymousInactiveWould it be possible to have mails that are queued and others that are not?
Sat 18 Dec 2021 at 17:15 #63642FrankyKeymasterWhy would you think it limits the frequency to 1 per hour? Is that a limit of your hosting provider? The example I give in EME will check once every 5 minutes.
Sat 18 Dec 2021 at 17:38 #63643AnonymousInactiveYes, it’s my provider OVH who limits it to 1 hour minimum. Also, which file is designated in the CRON? If I put wp-cron.php and eme_cron_send_queued has been deprogrammed at my insue it will not solve my problem. I can specify other CRON at my host: which eme_.php file to specify in the CRON to be sure?
Sat 18 Dec 2021 at 17:46 #63644FrankyKeymasterIt is wp-cron.php. But since it only launches once every 5 minutes, it solves the problem where multiple connection launch it at the same time (it is 1 process only). From your wordpress point of view nothing changes except it then no longer checks for schedules on every page view. And since it is only 1 process it might solve the problem/bug wordpress has with its cron.
If your hosting provider limits you to once per hour, then I can’t help there. Either search another provider (I never encountered a provider with such a limit, seems a little low-budget) or live with the wordpress cron …Sat 18 Dec 2021 at 18:46 #63645AnonymousInactiveYes it is a cheap host.
I programmed the cron on my host’s interface. Then when I go to the log it tells me that it called wp-cron.php and that everything ended well. But it does not tell me if eme_cron_send_queued was in the crontab.
I think I’ll go back to WP cron programming.
On the “scheduled actions” page I only change the “send mail queued” parameter and no “unpaid pending booking”. And then I check that eme_cron_send_queued is in the crontab. Sometime something changed this parameter to 0 and I didn’t identify what!Sat 18 Dec 2021 at 19:12 #63646FrankyKeymasterWpcron never tells you what was executed. But you can use plugins like wpcron manager to check you cron queue
Sun 19 Dec 2021 at 09:32 #63647AnonymousInactiveSeveral plugins allow to display and modify cron events. But I haven’t found one that can send me an email if eme_cron_send_queued (or another hook) is in the cron tab or not.
Sun 19 Dec 2021 at 09:43 #63648AnonymousInactiveIs it possible to create a hook that checks, and schedules with defined parameters (if necessary), that eme_cron_send_queued is in the cron tab?
Sun 19 Dec 2021 at 10:34 #63649AnonymousInactiveI was thinking of putting the following line in my hook that would force the programming of the eme_cron_send_queued hook
wp_schedule_event(time(), “5min”, ’eme_cron_send_queued’);
Sun 19 Dec 2021 at 15:57 #63650FrankyKeymasterCalling wp_schedule_event will cause a recurring schedule to be inserted, in this case every 5minutes (it is not a “one time only” call). So doing that multiple times will totally mess up your schedules for sure. Either check if not already scheduled, or unschedule and reschedule, or call a one-time-only schedule using the correct wordpress functions.
While I would love to help with that, it is not in the EME support scope so I will refer you to the appropriate wordpress forums/doc for that: https://developer.wordpress.org/reference/functions/wp_schedule_event/ and https://developer.wordpress.org/plugins/cron/
Also, I checked the wordpress cron code to add/remove a schedule: it does “get cron array, do your stuff, save cron array”. So if you have a system that abuses the schedules to create tasks all the time, it will cause problems and things can get deleted since no “lock” is taken on the cron array (this is a wordpress issue, not mine). So I recommend to use tools that don’t touch the cron system too much (in your case, WPForms might be the plugin that triggers the wordpress cron issues). -
AuthorPosts
- The forum ‘Generic’ is closed to new topics and replies.