The following error is appearing in the karaf.log file.
What does it mean? What is it breaking? How can we resolve it?
ERROR | emstats-thread-2 | 2021-06-07 06:06:05,681 | NamedThreadFactory | .concurrent.NamedThreadFactory$1 70 | m.ca.im.common.core.util | | Unexpected exception occurs
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT /*+ label(THRESHOLD_EVAL_DEVICE_LEVEL_AGGREGATION) */ rc.profile_id, rc.eoc_time, rc.item_id, rc.esum1 AS r1, CASE WHEN (rc.esum1=0 and rc.csum1=1) THEN 1 ELSE 0 END as c1 FROM ( SELECT pa.profile_id, pa.eoc_time, pa.item_id, (CASE WHEN GREATEST(pa.esum1,0 ) = 1 THEN 1 ELSE 0 END) as raise_exists, (CASE WHEN GREATEST(pa.csum1,0 ) = 1 THEN 1 ELSE 0 END) as clear_exists, pa.esum1, pa.csum1 FROM (SELECT 8586558 AS profile_id, 1623039600 AS eoc_time, r.item_id, CASE WHEN (SUM( CASE WHEN (1623039600 - r.tstamp < 900 AND im_Utilization > 95 AND (ABS(m1.im_Utilization_mean_x) >= 0) AND im_Utilization > (m1.im_Utilization_mean_x + (m1.im_Utilization_stddev_x * 2)) ) THEN r.rinterval ELSE 0 END ) >= 900) THEN 1 ELSE 0 END esum1, CASE WHEN (SUM( CASE WHEN (1623039600 - r.tstamp < 900 AND NOT( im_Utilization > 95 AND (ABS(m1.im_Utilization_mean_x) >= 0) AND im_Utilization > (m1.im_Utilization_mean_x + (m1.im_Utilization_stddev_x * 2)) ) ) THEN r.rinterval ELSE 0 END ) >= 900) THEN 1 ELSE 0 END csum1 FROM ( SELECT d.item_id, r1.tstamp, AVG(r1.rinterval) as rinterval, AVG(r1.im_Utilization) AS im_Utilization FROM physical_memstats_rate AS r1 JOIN poll_item pi ON (r1.item_id=pi.item_id AND pi.is_filtered=0) JOIN device d ON (pi.device_item_id=d.item_id) JOIN physical_memstats_300000_temp_batch1_profile_items_p i ON (i.profile_id=8586558 AND i.item_id=r1.item_id) WHERE r1.tstamp > 1623038700 AND r1.tstamp <= 1623039600 AND ( (r1.dcm_id = 29463066 AND r1.pollgroup_id = 3242) OR (r1.dcm_id = 29463064 AND r1.pollgroup_id = 3242) OR (r1.dcm_id = 27779747 AND r1.pollgroup_id = 3225) OR (r1.dcm_id = 29463066 AND r1.pollgroup_id = 3245) OR (r1.dcm_id = 29463066 AND r1.pollgroup_id = 3214) OR (r1.dcm_id = 29463066 AND r1.pollgroup_id = 8672748) OR (r1.dcm_id = 27779747 AND r1.pollgroup_id = 3220) OR (r1.dcm_id = 29463064 AND r1.pollgroup_id = 3214) OR (r1.dcm_id = 27779747 AND r1.pollgroup_id = 3221) OR (r1.dcm_id = 29463066 AND r1.pollgroup_id = 3220) OR (r1.dcm_id = 29463066 AND r1.pollgroup_id = 3221) OR (r1.dcm_id = 29463064 AND r1.pollgroup_id = 3220) OR (r1.dcm_id = 29463066 AND r1.pollgroup_id = 3225) OR (r1.dcm_id = 29463064 AND r1.pollgroup_id = 3225) OR (r1.dcm_id = 27779747 AND r1.pollgroup_id = 3234) OR (r1.dcm_id = 29463066 AND r1.pollgroup_id = 3234) OR (r1.dcm_id = 27779747 AND r1.pollgroup_id = 3215) OR (r1.dcm_id = 29463064 AND r1.pollgroup_id = 3234) OR (r1.dcm_id = 27779747 AND r1.pollgroup_id = 3242) OR (r1.dcm_id = 27779747 AND r1.pollgroup_id = 3245) ) GROUP BY d.item_id,r1.tstamp ) as r GROUP BY r.item_id) as pa) as rc WHERE rc.raise_exists=1 OR rc.clear_exists=1]; nested exception is java.sql.SQLSyntaxErrorException: [Vertica][VJDBC](4566) ERROR: Relation "m1" does not exist
...
Caused by: java.sql.SQLSyntaxErrorException: [Vertica][VJDBC](4566) ERROR: Relation "m1" does not exist
...
Caused by: com.vertica.support.exceptions.SyntaxErrorException: [Vertica][VJDBC](4566) ERROR: Relation "m1" does not exist
... 53 more
DX NetOps Performance Management releases r21.2.4 and older
The PC Portal web UI allows creation of an unsupported Threshold Violation Event Rule configured with both "Aggregate Components by Device" and Condition Type "Standard Deviation".
This configuration triggers the appearance of these errors.
The configured Threshold Violation Rule will also fail to raise Events.
This is being addressed with engineering via defect DE505820. Code change was made in the r21.2.5 release to resolve this. Upgrade to r21.2.5 and newer releases to resolve this.
At this time the preliminary fix discussed is ensuring the UI code prevents creation of unsupported Threshold Violation Event Rules.
At this time the only solutions are:
The key is ensuring the Rules are not configured to use both Aggregation and Standard Deviations.