Description of problem: Invoking the snapshotMeasurementTables admin test operation returns an empty HTML table if the back-end database is Oracle. The server log reveals the following error message: Version-Release number of selected component (if applicable): RHQ 3.0.1 How reproducible: Always Steps to Reproduce: 1. Using a Oracle database for the RHQ installation, navigate to http://localhost:7080/admin/test/control.jsp?mode=snapshotMeasurementTables Actual results: Near the top of the page: Executed snapshotMeasurementTables: <table></table> Expected results: Near the top of the page: Executed snapshotMeasurementTables: <table><tr><td>r00</td><td>113806</td></tr><tr><td>r01</td><td>0</td></tr><tr><td>r02</td><td>139520</td></tr><tr><td>r03</td><td>148381</td></tr><tr><td>r04</td><td>191861</td></tr><tr><td>r05</td><td>132352</td></tr><tr><td>r06</td><td>132355</td></tr><tr><td>r07</td><td>9223</td></tr><tr><td>r08</td><td>132347</td></tr><tr><td>r09</td><td>132353</td></tr><tr><td>r10</td><td>132357</td></tr><tr><td>r11</td><td>132350</td></tr><tr><td>r12</td><td>132349</td></tr><tr><td>r13</td><td>132355</td></tr><tr><td>r14</td><td>132353</td></tr><tr><td>oneHour</td><td>493763</td></tr><tr><td>sixHour</td><td>179715</td></tr><tr><td>oneDay</td><td>227058</td></tr><tr><td>trait</td><td>67390</td></tr><tr><td>bline</td><td>1680</td></tr><tr><td>oob</td><td>18</td></tr><tr><td>oob_temp</td><td>12</td></tr><tr><td>callkey</td><td>0</td></tr><tr><td>calldata</td><td>0</td></tr><tr><td>enabledMetricSchedules</td><td>3721</td></tr><tr><td>enabledTraitSchedules</td><td>1742</td></tr><tr><td>enabledCalltimeSchedules</td><td>0</td></tr></table> Additional info: This issue is due to the concatenation of the query string in org.rhq.enterprise.server.test.MeasurementTestBean.snapshotMeasurementTables(). Specifically, at line 229 we check to see if databaseType is Oracle and if it is, set querySuffix "from dual;". The problem with this is that on line 240 we put the snapshotQuery and querySuffix together without a space resulting in the end of the query becoming: "as enabledCalltimeSchedulesfrom dual;" To fix this, we will need to change line 230 to: querySuffix = " from dual;";
We will have to make one more change in the snapshotQuery in order to run this sql properly on Oracle. Currently the string contains "...where ms.enabLed = true ..." and this works fine for Postgres but in Oracle it results in "ORA-01722:invalid number". This is because the ms.enabled (RHQ_MEASUREMENT_SCHED.ENABLED) column in Oracle is not a boolean value but a number, 1=TRUE and 0=FALSE.
Marking for inclusion in JON3.0.1, this should be an easy fix and should help with troubleshooting issues.
I think I spoke to soon on this issue. I'm pushing it out of 3.0.1 and into 3.1.0 for *consideration* as part of that release. We really need to decide upon which, if any, of these admin/* pages we are going to "support" folks using. If this is one of those pages, it needs to be tested and verified by QE just like any other page in the UI
This operation is supposed to provide the total metric count from the raw tables. This information is necessary for diagnostic and this bug was found during investigation of a database performance issue a user raised. The alternative is to provide the user with a very big query that they can execute against the database using the SQL test page. As such, I can not say this is required but if we decide not to do it we should remove this page/feature as it is currently broken for all supported databases.
Fixed upstream. Waiting for release branch to open.
Release/jon3.1.x commit: d5cd27a9c067315b55b8601bc5acf3ef6b34fa69 Fixed this for Oracle. Also, change the JSP page to better display the results for this and some other options. Cherry-pick of master: b0e2a5a830ce54f0c902be9dc844fbe701182fdc
JON 3.1.1 ER1 build is available. Moving to ON_QA. https://brewweb.devel.redhat.com/buildinfo?buildID=226942
Verified on 3.1.1.ER1
Bulk closing of old issues in VERIFIED state.