Bug 575981
| Summary: | Satellite 5.3: Scheduled tab only shows actions with non-null scheduler (e.g., auto-errata update actions scheduled by taskomatic are missing in the listings) | ||
|---|---|---|---|
| Product: | Red Hat Satellite 5 | Reporter: | Xixi <xdmoon> |
| Component: | Server | Assignee: | Justin Sherrill <jsherril> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Tomas Lestach <tlestach> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 530 | CC: | cperry, fdewaley, gkhachik, jhutar, roysjosh, tlestach, xdmoon |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2010-10-28 14:56:20 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 487678 | ||
|
Description
Xixi
2010-03-22 21:41:50 UTC
The difference is due to the Schedule tab only looks at actions with a non-null scheduler - the queries completed_action_list, failed_action_list, and archived_action_list all have the condition "WC.id = UAO.scheduler", which means it won't pick up actions with scheduler=NULL such as auto-errata updates scheduled by taskomatic. Not sure about pending_actions_in_set yet but we also need to make sure it includes all actions consistent with the System Details -> pending events page.
E.g. on internal reproducer,
SQL> select count(*) from rhnUserActionOverview where org_id = 1 and user_id =1 and action_status_id = 3;
COUNT(*)
----------
445
SQL> select count(*) from rhnUserActionOverview where org_id = 1 and user_id =1 and action_status_id = 3 and scheduler = 1;
COUNT(*)
----------
13
Per confirmation with jsherrill, this is indeed a bug and we should remove the scheduler condition "WC.id = UAO.scheduler", add a check if needed for user permissions, and otherwise make sure Schedule tab shows all actions that should be visible to the logged in user.
Notes/relevant code snippets:
/var/www/html/network/systems/details/history/history.pxt
...
<rhn-listview class="Sniglets::ListView::ActionList" mode="system_events_history">
...
/usr/lib/perl5/vendor_perl/5.8.8/Sniglets/ListView/ActionList.pm
...
Sniglets::ListView::List->add_mode(-mode => "system_events_history",
-datasource => RHN::DataSource::Action->new,
-provider => \&system_history_provider);
...
/usr/lib/perl5/vendor_perl/5.8.8/RHN/DataSource/Action.pm
...
sub data_file { 'Action_queries.xml' }
...
/usr/lib/perl5/vendor_perl/5.8.8/RHN/DB/DataSource/xml/Action_queries.xml
...
<mode name="system_events_history">
<query params="sid">
SELECT EVENT_ID,
TO_CHAR(CREATED, 'YYYY-MM-DD HH24:MI:SS') CREATED,
TO_CHAR(PICKED_UP, 'YYYY-MM-DD HH24:MI:SS') PICKED_UP,
TO_CHAR(COMPLETED, 'YYYY-MM-DD HH24:MI:SS') COMPLETED,
SUMMARY,
HISTORY_TYPE,
HISTORY_TYPE_NAME,
HISTORY_STATUS
FROM (SELECT SH.id EVENT_ID,
SH.summary SUMMARY,
TO_DATE(NULL) AS created,
TO_DATE(NULL) AS picked_up,
SH.created as completed, -- view this as the "completed" date for sorting reasons
NULL AS history_status,
NULL AS history_type,
NULL AS history_type_name
FROM rhnServerHistory SH
WHERE SH.server_id = :sid
UNION
SELECT SA.action_id EVENT_ID,
AType.name || ' scheduled by ' || NVL(U.login, '(none)') AS SUMMARY,
SA.created,
SA.pickup_time AS picked_up,
SA.completion_time AS completed,
AStat.name AS history_status,
AType.label AS history_type,
AType.name AS history_type_name
FROM rhnActionType AType,
rhnActionStatus AStat,
rhnUser U,
rhnAction A,
rhnServerAction SA
WHERE SA.server_id = :sid
AND SA.action_id = A.id
AND ATYPE.id = A.action_type
AND AStat.id = SA.status
AND U.id(+) = A.scheduler
AND AStat.id IN (1, 2, 3)
) X
ORDER BY COMPLETED DESC, PICKED_UP DESC, CREATED DESC, EVENT_ID DESC
</query>
</mode>
...
spacewalk-java-0.5.44/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml
...
<mode name="pending_actions_in_set"
class="com.redhat.rhn.frontend.dto.ScheduledAction">
<query params="user_id, org_id, set_label">
SELECT DISTINCT UAO.id AS ID,
UAO.earliest_action AS EARLIEST,
A.prerequisite AS PREREQUISITE,
UAO.type_name,
(DECODE(UAO.action_name, NULL, UAO.type_name, UAO.action_name)) AS ACTION_NAME,
UAO.scheduler
FROM rhnUserActionOverview UAO, rhnAction A, rhnSet ST
WHERE UAO.org_id = :org_id
AND UAO.user_id = :user_id
AND UAO.action_status_id IN (0,1)
AND UAO.archived = 0
AND UAO.id = A.id
AND ST.user_id = :user_id
AND ST.label = :set_label
AND ST.element = A.id
ORDER BY EARLIEST DESC
</query>
...
<mode name="completed_action_list"
class="com.redhat.rhn.frontend.dto.ScheduledAction">
<query params="user_id, org_id">
SELECT DISTINCT UAO.id AS ID,
UAO.earliest_action AS EARLIEST,
UAO.type_name,
(DECODE(UAO.action_name, NULL, UAO.type_name, UAO.action_name)) AS ACTION_NAME,
UAO.scheduler,
WC.login AS SCHEDULER_NAME
FROM rhnUserActionOverview UAO, web_contact WC
WHERE UAO.org_id = :org_id
AND UAO.user_id = :user_id
AND UAO.action_status_id = 2
AND UAO.archived = 0
AND WC.id = UAO.scheduler
ORDER BY EARLIEST DESC
</query>
...
<mode name="failed_action_list"
class="com.redhat.rhn.frontend.dto.ScheduledAction">
<query params="user_id, org_id">
SELECT DISTINCT UAO.id AS ID,
UAO.earliest_action AS EARLIEST,
UAO.type_name,
(DECODE(UAO.action_name, NULL, UAO.type_name, UAO.action_name)) AS ACTION_NAME,
UAO.scheduler,
WC.login AS SCHEDULER_NAME
FROM rhnUserActionOverview UAO, web_contact WC
WHERE UAO.org_id = :org_id
AND UAO.user_id = :user_id
AND UAO.action_status_id = 3
AND UAO.archived = 0
AND WC.id = UAO.scheduler
ORDER BY EARLIEST DESC
</query>
...
<mode name="archived_action_list"
class="com.redhat.rhn.frontend.dto.ScheduledAction">
<query params="user_id, org_id">
SELECT DISTINCT UAO.id AS ID,
UAO.earliest_action AS EARLIEST,
UAO.type_name,
(DECODE(UAO.action_name, NULL, UAO.type_name, UAO.action_name)) AS ACTION_NAME,
WC.login AS SCHEDULER_NAME
FROM rhnUserActionOverview UAO, web_contact WC
WHERE UAO.org_id = :org_id
AND UAO.user_id = :user_id
AND UAO.archived = 1
AND WC.id = UAO.scheduler
ORDER BY EARLIEST DESC
</query>
...
Changed the joins to be left joins: b6108e3c249f2f2031e8c0d2fa6100bcf4767201 1. I registered a client to a custom channel and enabled auto errata update for it. 2. I synced a channel update together with an erratum from a dump (errata package was applicable to the client). 3. As soon as the taskomatic ErrataQueue was scheduled, an errata update event appeared in both - system pending events and in schedule pending actions of the whole satellite as requested. VERIFIED with spacewalk-java-1.2.39-27.el5sat on Satellite-5.4.0-RHEL5-re20101001.1. # VERIFIED against stage-signed packages/iso: Satellite-5.4.0-RHEL5-re20101025.0 the scenario described in comment#4 is reproduced (btw: on different Org that the default one of admin user is) The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332 RHEA-2010:0803 - RHN Tools enhancement update https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333 RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334 RHEA-2010:0800 - RHN Satellite Server 5.4.0 https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335 Docs are available: http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html Regards, Clifford |