Description of problem: When comparing history displayed in the WebUI (../rhn/systems/details/history/History.do?sid=SID&) and list of history items returned by system.listSystemEvents API call, the API call is missing all items with status (n/a). Version-Release number of selected component (if applicable): spacewalk-java-2.5.14-89.el6sat How reproducible: always Steps to Reproduce: 1. Register a new system to a Satellite server 2. Check the ../rhn/systems/details/history/History.do?sid=SID& for the the system 3. Run client.system.listSystemEvents(key, SID) API call. Actual results: While there are two system events in the WebUI ("subscribed to channel rhel-x86_64-server-X" and "added system entitlement"), result of the API call is empty. Expected results: API call returns a list containing same items as displayed in the WebUI. Additional info: API call currently returns only items with a exit status (non n/a status). If you schedule a package install on the newly registered system, run rhn_check on the client, and then run system.listSystemEvents API call, you will get list containing only one item (package install that just finished). WebUI will contain three system items, of course (reg, entitlement and package install).
I suppose the behavior is correct. In UI when you visit '/rhn/schedule/*', you can list real *scheduled* events. On page '/rhn/systems/details/history/History.do' you get system event history, including items describing "what happened to the system" ie. "Subscription via Token". And I think System History != Events. API to get System History is getEventHistory(key, system_id). However, it is quite confusing in API documentation, where we have "List all system events for given server. This includes *all* events for the server since it was registered". It'd be nice to update API docs to keep it clear. Keeping BZ opened for docs update.
Jiri, feel free to update the docs within this BZ.
upstream fix, spacewalk.git: c2e06af6f535f67660beda6eafa1fc6272a43a3c
VERIFIED on spacewalk-java-2.5.14-108 listSystemEvents List system actions of the specified type that were *scheduled* against the given server. "actionType" should be exactly the string returned in the action_type field from the listSystemEvents(sessionKey, serverId) method. For example, 'Package Install' or 'Initiate a kickstart for a virtual guest.' Note: see also system.getEventHistory method which returns a history of all events.
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/RHBA-2018:0274