Project

General

Custom queries

Profile

Actions

Bug #36216

closed

Complex Cronline do not work

Added by Armindo Silva about 2 years ago. Updated about 2 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:

Description

We’re trying to create some Recurring Logic that require complex Cronlines.
For example, we want to install updates on a subset of the machines on the second Tuesday of every month.
The Cronline for this situation looks like this:

0 8 7-14 * */2 
https://crontab.guru/#0_8_8-14_*_*/2
irb(main):002:0> ForemanTasks::RecurringLogic.find(30)
=> #<ForemanTasks::RecurringLogic id: 30, cron_line: “0 8 7-14 * */2”, end_time: nil, max_iteration: nil, iteration: 1, task_group_id: 146, state: “active”, triggering_id: 80, purpose: nil>

At 08AM, on the days between the 7th and 14th (all possible days where the second Tuesday of the month can fall), on every month, on every second day of the week.

We also tested:

0 8 7-14 * 2 
https://crontab.guru/#0_8_8-14_*_2
irb(main):004:0> ForemanTasks::RecurringLogic.find(35)
=> #<ForemanTasks::RecurringLogic id: 35, cron_line: “0 8 8-14 * 2”, end_time: nil, max_iteration: nil, iteration: 1, task_group_id: 159, state: “active”, triggering_id: 86, purpose: nil>

Which is similar as the one above but instead of on every second day of the week it’s on Tuesday, but not even the crontab.guru shows the expected date of the next occurrence.

On the community forum ( https://community.theforeman.org/t/complex-cronline-do-not-work/32445 ) someone pointed out that the problem is with the cron parser library that has some known issues and it is not updated since 2016.


Related issues 1 (0 open1 closed)

Is duplicate of foreman-tasks - Bug #36154: Replace parse-cron with something elseClosedAdam RuzickaActions
Actions #1

Updated by Adam Ruzicka about 2 years ago

  • Status changed from New to Duplicate

We're already kind of tracking this under #36154 , where I intend to swap the cron parser library for a different one, which should support this out of the box. I'll go ahead and close this one

Actions #2

Updated by Adam Ruzicka about 2 years ago

  • Is duplicate of Bug #36154: Replace parse-cron with something else added
Actions

Also available in: Atom PDF