Events Made Easy Forums Generic De-scheduling the sending of queued emails

Viewing 34 posts - 1 through 34 (of 34 total)
  • Author
    Posts
  • #63582
    Anonymous
    Inactive

    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

    #63583
    Franky
    Keymaster

    I 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_actions

    Edit: eme_cron_gdpr_daily_actions had a bug (was removed upon activation, I’ll fix that for the next version, but is not critical)

    #63584
    Anonymous
    Inactive

    Yes 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.

    #63586
    Franky
    Keymaster

    Do you by any chance remember from which version you upgraded? Or was is the latest previous version?

    #63587
    Anonymous
    Inactive

    Correction: 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 menus

    #63589
    Anonymous
    Inactive

    for eme_cron_send_queued my settings were 130 every minute. Perhaps this is too high?

    #63595
    Anonymous
    Inactive

    Hi 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 persistent

    #63598
    Anonymous
    Inactive

    Hi Franky
    Do you know a way to monitor this parameter specifically and be alerted when there is a change?

    #63599
    Franky
    Keymaster

    Sorry, but I do not. Is it always the same one that gets removed?

    #63600
    Anonymous
    Inactive

    yes 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 changed

    #63601
    Franky
    Keymaster

    Can it be some sync plugin is doing this? Because I have several sites and never experienced this.

    #63602
    Franky
    Keymaster

    Although 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 …

    #63603
    Anonymous
    Inactive

    What 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.

    #63604
    Anonymous
    Inactive

    In 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 day

    #63605
    Franky
    Keymaster

    One cron should not eject another, so I don’t think that’s the case here.

    #63606
    Anonymous
    Inactive

    Are 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?

    #63607
    Franky
    Keymaster

    No, 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.

    #63608
    Anonymous
    Inactive

    I 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?

    #63609
    Franky
    Keymaster

    That 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.

    #63610
    Anonymous
    Inactive

    OK, Franky. Thanks for everything. I won’t bother you any more with this without new and reproducible elements.

    #63637
    Anonymous
    Inactive

    Just 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?

    #63638
    Franky
    Keymaster

    Can 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?

    #63639
    Franky
    Keymaster

    It 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/51716

    My 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 🙂

    #63640
    Anonymous
    Inactive

    The 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…?

    #63641
    Anonymous
    Inactive

    Would it be possible to have mails that are queued and others that are not?

    #63642
    Franky
    Keymaster

    Why 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.

    #63643
    Anonymous
    Inactive

    Yes, 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?

    #63644
    Franky
    Keymaster

    It 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 …

    #63645
    Anonymous
    Inactive

    Yes 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!

    #63646
    Franky
    Keymaster

    Wpcron never tells you what was executed. But you can use plugins like wpcron manager to check you cron queue

    #63647
    Anonymous
    Inactive

    Several 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.

    #63648
    Anonymous
    Inactive

    Is 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?

    #63649
    Anonymous
    Inactive

    I 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’);

    #63650
    Franky
    Keymaster

    Calling 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).

Viewing 34 posts - 1 through 34 (of 34 total)
  • The forum ‘Generic’ is closed to new topics and replies.
Scroll to Top