Bug 1081554 - Cannot load metrics error on a resource with no enabled metrics
Summary: Cannot load metrics error on a resource with no enabled metrics
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Core Server, Monitoring
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: RHQ 4.11
Assignee: Jirka Kremser
QA Contact: Mike Foley
URL:
Whiteboard:
: 1078785 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-27 14:47 UTC by Filip Brychta
Modified: 2014-07-21 10:13 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-07-21 10:13:47 UTC
Embargoed:


Attachments (Terms of Use)
server log (270.08 KB, text/x-log)
2014-03-27 14:47 UTC, Filip Brychta
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1003794 0 unspecified CLOSED Cannot load metrics on some resources 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1078785 0 unspecified CLOSED Enabling of metric schedules may not be reflected in monitoring tab 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1092485 0 unspecified NEW Endless waiting bar when displaying graphs for resource with no enabled metrics inside recursive resource group 2022-03-31 04:28:46 UTC

Internal Links: 1003794 1078785 1092485

Description Filip Brychta 2014-03-27 14:47:32 UTC
Created attachment 879518 [details]
server log

Description of problem:
Cannot load metrics error on fresh installation of RHQ is thrown when visiting Monitoring tab via GUI.

Version-Release number of selected component (if applicable):
Version :	
4.11.0-SNAPSHOT
Build Number :	
ce4e250

How reproducible:
Always

Steps to Reproduce:
1. have fresh installation of RHQ
2. navigate to some resource's Monitoring tab

Actual results:
Metrics are not displayed and following error is thrown
Error
	
Time :	
Thursday, March 27, 2014 3:38:03 PM UTC+1
Root Cause :	
org.hibernate.hql.internal.ast.QuerySyntaxException:unexpected end of subtree [SELECT ms FROM org.rhq.core.domain.measurement.MeasurementSchedule ms WHERE ms.definition.id IN () AND ms.resource.id IN (:resourceIds)]
	


Expected results:
No errors

Additional info:
See complete exception in attached server.log

Comment 1 Heiko W. Rupp 2014-03-28 08:57:58 UTC
Bug 1078785 is similar

Comment 2 Jirka Kremser 2014-03-28 13:07:33 UTC
The issue there is that the HQL query is executed even if no metrics are enabled/present on the resource(s). So it results in "...WHERE ms.definition.id IN () ..." nothing in the parentheses.

Not sure, but it looks like a regression of this commit 98b52a8c85836b6b5dbd8f2996a7037f52a92637

I'll add some checks on the client GWT side not to perform the fetch if enabledScheduleDefinitionIds array is empty and also for the server side: not to perform the query if an empty array if ints was passed in as arg.

Comment 3 Jirka Kremser 2014-03-28 15:59:37 UTC
^ Renaming the BZ, because it has nothing to do with fresh RHQ installation. I was able to reproduce it even with couple of hours running instance, while, at the same time, it worked on a vanilla instance if there was some enabled metrics on the resource.

Comment 4 Jirka Kremser 2014-03-28 16:02:04 UTC
branch:  master
link:    https://github.com/rhq-project/rhq/commit/191e6c7ce
time:    2014-03-28 17:01:31 +0100
commit:  191e6c7ced414bd7b5d2a138227ee4ae8d87d021
author:  Jirka Kremser - jkremser
message: [BZ 1081554] - Cannot load metrics error on a resource with no enabled
         metrics - Not performing the problematic DB query, when no
         metric on the resource is enabled. Also saving 2
         (client-server)) round trips if the enabled metrics # equals to
         zero.

Comment 5 Jirka Kremser 2014-04-15 11:12:45 UTC
*** Bug 1078785 has been marked as a duplicate of this bug. ***

Comment 6 Filip Brychta 2014-04-30 12:42:16 UTC
Verified on
Version :	
4.11.0-SNAPSHOT
Build Number :	
bc47bf3

Comment 7 Heiko W. Rupp 2014-07-21 10:13:47 UTC
Bulk closing of RHQ 4.11 issues, now that RHQ 4.12 is out.

If you find an issue with those, please open a new BZ, linking to the old one.


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