Scheduled Jobs for Remote Execution are executing immediately and reoccurring jobs are executing everyday

Problem:
Remote execution jobs that are scheduled in the future or reoccurring are not working properly. Instead of running at the scheduled time they begin right after clicking Submit. The reoccurring jobs are running everyday instead of just the date range and day of the week given in crontab syntax.
Foreman and Proxy versions:
foreman-3.0.0-0.1.rc2.el8.noarch
Foreman and Proxy plugin versions:
foreman_remote_execution 4.7.0
Distribution and version:
AlmaLinux 8.4

Scheduling for the future should be already fixed in latest master (https://github.com/theforeman/foreman-tasks/pull/651), but it is not released yet.

However, reocurring jobs seem to work just fine for me. Could you provide an exapmle of a cronline you used?

foreman-3.0.0-1.el7.noarch
tfm-rubygem-foreman-tasks-5.1.0-1.fm3_0.el7.noarch
tfm-rubygem-foreman_remote_execution-4.7.0-1.fm3_0.el7.noarch

Thanks for the reply @aruzicka.

Is there an ETA on when the updates will be made available in the primary repository?

Here is an example of the recurring job that I’m trying to setup. I have a non-production and production version of several jobs around patching that run on the second (non-prod) and third (prod) Thursday of each month. The scheduler didn’t seem to respect the day range or the day of week and ran both jobs at the scheduled time on days they should not have run.

Version with the fix is out on rubygems, packaging PRs are opened. Should be a matter of days until it lands in the repos.

About the recurring jobs. The library we are using to generate times from the cronlines doesn’t really follow the specification. A combination of day of month and day of week produces somewhat unreliable results. See[1, 2] for details. We know this is broken, but the library is not really maintained and we don’t really have capacity to fork it and maintain it ourselves.

[1] - https://github.com/siebertm/parse-cron/pull/29
[2] - https://github.com/siebertm/parse-cron/issues/36

Great information.

I’ll do some playing around with the reoccurring jobs to see if I can get it to do what I’m looking for. If not, then we will just schedule the jobs the week of the tasks like we have always done.

Thanks again.

I have just updated my Katello server with the latest packages available in the repositories and it seems that the scheduling feature is not yet fixed. I scheduled a time job at around 9:56am to start at 10am; however it executed it immediately instead of waiting until 10am.

Here are the package versions I currently have installed.

foreman-3.0.0-1.el8.noarch
rubygem-foreman-tasks-5.1.0-1.fm3_0.el8.noarch
rubygem-foreman_remote_execution-4.7.0-1.fm3_0.el8.noarch

Has anyone experienced this? It isn’t a show stopper, but it sure is nice to schedule jobs a few days in advance to run automatically.

Can confirm this, scheduling a job (didn’t try reoccurring jobs) does not work, any scheduled job is starting immediately.

Installed packages:

foreman-3.0.1-1.el7.noarch
katello-4.2.1-1.el7.noarch
tfm-rubygem-foreman-tasks-5.1.0-1.fm3_0.el7.noarch
tfm-rubygem-foreman-tasks-core-0.3.6-1.fm2_5.el7.noarch
tfm-rubygem-foreman_remote_execution-4.7.0-1.fm3_0.el7.noarch
tfm-rubygem-foreman_remote_execution_core-1.4.8-1.el7.noarch

This is fixed in foreman-tasks-5.1.1. There were some intermittent failures which prevented the package from getting into 3.0 EL7 repos. This should now be resolved and the package should be available.

Thanks for the reply @aruzicka

I can confirm that it is fixed. I updated my server two weeks ago and it started to work on AlmaLinux 8.

Can also confirm that it’s fixed!

Thanks a lot!!