Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionStephen Wadeley
2019-02-26 09:19:49 UTC
Description of problem:
When trying to update a sync-plan created with interval set to custom cron, the command always fails with:
Could not update the sync plan:
Cron expression is not valid!
Version-Release number of selected component (if applicable):
~]# hammer --version
hammer (0.15.1)
How reproducible:
I tried many different commands against sync-plan created in web UI and using hammer.
Steps to Reproduce:
1. ~]# hammer sync-plan create --name BugTest --sync-date "2019/02/01" --enabled 1 --interval "custom cron" --cron-expression "1 2 3 4 5" --organization-id 1
2. ~]# hammer sync-plan info --name BugTest --organization-id 1
3. ~]# hammer sync-plan update --name BugTest --organization-id 1 --description Hello
Could not update the sync plan:
Cron expression is not valid!
4. ~]# hammer sync-plan update --name BugTest --organization-id 1 --description Hello --cron-expression "1 2 3 4 5"
Could not update the sync plan:
Cron expression is not valid!
Actual results:
Could not update the sync plan
Expected results:
Could update the sync plan
This is definitely an issue in Katello. The following works just fine (with --interval _and_ --cron-expression):
hammer -d sync-plan update --id 3 --cron-expression "1 2 3 4 5" --interval "custom cron"
This logic in Katello isn't quite right https://github.com/Katello/katello/blob/master/app/models/katello/sync_plan.rb#L59. It only checks the params and not the currently set value (self.interval rather than params["interval"]). It looks like this is a regression starting in Katello 3.9 https://github.com/Katello/katello/commit/8ac17807def.
This also breaks with valid cron
hammer sync-plan create --name BugTest --sync-date "2019/02/01" --enabled 1 --interval "custom cron" --cron-expression "0 0 12 1 1 ? *" --organization-id 1
Could not create the sync plan:
Cron expression is not valid!
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2019:1222