Bug 1582982 - softwarechannel_setsyncschedule InvalidParamException
Summary: softwarechannel_setsyncschedule InvalidParamException
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.8
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space29
TreeView+ depends on / blocked
 
Reported: 2018-05-28 03:15 UTC by Eric Burgueño
Modified: 2019-01-15 07:59 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-15 07:59:22 UTC
Embargoed:


Attachments (Terms of Use)

Description Eric Burgueño 2018-05-28 03:15:34 UTC
Description of problem:

After creating a Software Channel and repository, I want to set a sync schedule with spacecmd softwarechannel_setsyncschedule. This does not seem to be parsing the Quartz CronTrigger schedule correctly.

Setting the same schedule on the GUI works, but it's impossible to do from the command line:

spacecmd {SSM:0}> softwarechannel_listsyncschedule
  key  Channel Name                             Update Schedule     
-----  ---------------------                    ---------------     
  101  centos6-x86_64                           0 0 22 ? * 6


spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? * 6
ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? .* 6

spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? \* 6
ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? .* 6

spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? \\* 6
ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? \.* 6

spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? "*" 6
ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? .* 6

spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? '*' 6
ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? .* 6

Version:
# rpm -qa|grep spacecmd
spacecmd-2.8.25-1.el7.centos.noarch

How reproducible:
Always

Steps to Reproduce:
As above

Comment 1 Tomáš Kašpárek 2018-05-28 05:50:25 UTC
This should be already fixed in master by commit 3e8942219def2910ca45e0cfc4a337e69fee8efa

Could you please try to use latest nightly version of spacecmd to see whether it fails or not?
It can be easily found here: https://copr.fedorainfracloud.org/coprs/g/spacewalkproject/nightly/build/758551/

Comment 2 Eric Burgueño 2018-05-28 21:58:43 UTC
Yes, that seems to work. I do however find it odd that the exit code is still 0 when the command fails:

# spacecmd -- softwarechannel_setsyncschedule --sync-kickstart "epel7-centos7-x86_64" "0 15 0 \? \* 7"
INFO: Connected to https://spacewalk.example.com/rpc/api as admin
softwarechannel_setsyncschedule: 
Sets the repo sync schedule for a software channel

usage: softwarechannel_setsyncschedule <CHANNEL> <SCHEDULE>
Options:
    -e/--no-errata : Do not sync errata
    -f/--fail : Terminate upon any error
    -k/--sync-kickstart : Create kickstartable tree
    -l/--latest : Only download latest package versions when repo syncs

The schedule is specified in Quartz CronTrigger format without enclosing quotes.
For example, to set a schedule of every day at 1am, <SCHEDULE> would be 0 0 1 * * ?
If <SCHEDULE> is left empty, it will be disabled.

# echo $?
0


This makes it hard to implement with Config Management tools like Ansible.

Should I open a new bug about it?

Comment 3 Tomáš Kašpárek 2018-05-29 06:00:51 UTC
If you'd be so kind, please open a new bug regarding the exit code, I'd appreciate that.

Also if you could state if the exit code is always zero (even for other failing commands) that would be great information for me to begin with.

Comment 4 Michael Mráka 2018-11-26 09:43:51 UTC
Move Spacewalk 2.9 bugs ON_QA.

Comment 5 Michael Mráka 2019-01-15 07:59:22 UTC
Spacewalk 2.9 has been released.
https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes29


Note You need to log in before you can comment on or make changes to this bug.