Bug 746090 - Listing/editing of probe suite systems is broken
Summary: Listing/editing of probe suite systems is broken
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16
TreeView+ depends on / blocked
 
Reported: 2011-10-13 20:45 UTC by Michael Zabriskie
Modified: 2011-12-22 16:49 UTC (History)
1 user (show)

Fixed In Version: spacewalk-java-1.6.62-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-22 16:49:29 UTC
Embargoed:


Attachments (Terms of Use)

Description Michael Zabriskie 2011-10-13 20:45:35 UTC
Since the following commit:

https://fedorahosted.org/spacewalk/browser/java/code/src/com/redhat/rhn/common/db/datasource/xml/Monitoring_queries.xml?rev=9103a4c0b5f7a715d37ddab1e7d7961d09edbb04

listing or editing of probe suite systems with an Oracle DB has thrown the following exception:

ORA-00904: "S"."ID": invalid identifier

I don't have a PostgreSQL instance of Spacewalk to test with.

I believe the following patch on Monitoring_queries.xml will correct the issue:

======================================================
@@ -164,8 +164,8 @@
            WHEN 5 THEN 'CRITICAL' END ) ST
            FROM  rhn_check_probe statcp
            LEFT JOIN rhn_probe_state statps
-             ON s.id = statcp.host_id
-          WHERE statcp.probe_id = statps.probe_id
+             ON statcp.probe_id = statps.probe_id
+          WHERE s.id = statcp.host_id
           GROUP BY s.id ) status
 FROM rhn_check_suites cs,
      rhn_check_suite_probe csp,
======================================================

Comment 1 Michael Mráka 2011-10-17 09:30:33 UTC
Another report of the same bug: https://www.redhat.com/archives/spacewalk-list/2011-October/msg00067.html

To reproduce :
Monitoring -> Probe Suites -> [Select one] -> Systems

We receive an Internal Server Error- Catalina provides a query:

SELECT distinct s.id, s.name,
( SELECT  (CASE
                   MAX(CASE statps.state
                       WHEN 'OK' THEN 1
                       WHEN 'PENDING' THEN 2
                       WHEN 'UNKNOWN' THEN 3
                       WHEN 'WARNING' THEN 4
                       WHEN 'CRITICAL' THEN 5 END)
           WHEN 1 THEN 'OK'
           WHEN 2 THEN 'PENDING'
           WHEN 3 THEN 'UNKNOWN'
           WHEN 4 THEN 'WARNING'
           WHEN 5 THEN 'CRITICAL' END ) ST
           FROM  rhn_check_probe statcp
           LEFT JOIN rhn_probe_state statps
             ON s.id = statcp.host_id
          WHERE statcp.probe_id = statps.probe_id
          GROUP BY s.id ) status
FROM rhn_check_suites cs,
     rhn_check_suite_probe csp,
     rhn_service_probe_origins spo,
     rhn_check_probe cp,
     rhn_probe_state ps,
     rhnServer s
WHERE cs.recid = ?
  and csp.check_suite_id = cs.recid
  and spo.origin_probe_id = csp.probe_id
  and cp.probe_id = spo.service_probe_id
  and ps.probe_id = cp.probe_id
  and s.id = cp.host_id
com.redhat.rhn.common.db.WrappedSQLException: ORA-00904: "S"."ID":
invalid identifier

I found the query in the following resource:
java/code/src/com/redhat/rhn/common/db/datasource/xml/Monitoring_queries.xml

Comment 2 Michael Mráka 2011-10-17 09:36:33 UTC
Fixed in spacewalk master by
commit 37f4aac214025b791e48c1df017113096d950570
    746090 - fixed join condition in query

Comment 3 Michael Zabriskie 2011-10-17 15:29:49 UTC
Thank you Michael. When would one expect this to hit the nightly repo? Or maybe it could be had from Koji?

Comment 4 Michael Zabriskie 2011-10-17 22:36:57 UTC
Got the latest RPM from nightly. This fixed the bug. Thanks again.

Comment 5 Milan Zázrivec 2011-12-22 16:49:29 UTC
Spacewalk 1.6 has been released.


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