[
https://issues.apache.org/jira/browse/AMBARI-16997?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ureyqiao updated AMBARI-16997:
------------------------------
Description:
The request of
"http://localhost:8080/api/v1/clusters/tdw/alerts?fields=*&Alert/state.in(WARNING,CRITICAL)&sortBy=Alert/state&format=groupedSummary"
is OK, but when change the param of sortBy, it imports error.
http://localhost:8080/api/v1/clusters/tdw/alerts?fields=*&Alert/state.in(WARNING,CRITICAL)&sortBy=Alert/id&format=groupedSummary
{
"status": 500,
"message": "Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.5.2.v20140319-9ad6abd):
org.eclipse.persistence.exceptions.DatabaseException\nInternal Exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column
't0.alert_id' in 'order clause'\nError Code: 1054\nCall: SELECT t2.alert_id,
t2.latest_text, t2.latest_timestamp, t2.maintenance_state,
t2.original_timestamp, t2.definition_id, t2.history_id FROM alert_current t2,
alert_history t1 WHERE (((t1.alert_state = ?) OR (t1.alert_state = ?)) AND
(t1.alert_id = t2.history_id)) ORDER BY t0.alert_id ASC\n\tbind => [2
parameters bound]\nQuery: ReadAllQuery(referenceClass=AlertCurrentEntity
sql=\"SELECT t2.alert_id, t2.latest_text, t2.latest_timestamp,
t2.maintenance_state, t2.original_timestamp, t2.definition_id, t2.history_id
FROM alert_current t2, alert_history t1 WHERE (((t1.alert_state = ?) OR
(t1.alert_state = ?)) AND (t1.alert_id = t2.history_id)) ORDER BY t0.alert_id
ASC\")"
}
It turns out the sql statement is error.
was:
The request of
"http://10.151.139.107:8080/api/v1/clusters/tdw/alerts?fields=*&Alert/state.in(WARNING,CRITICAL)&sortBy=Alert/state&format=groupedSummary"
is OK, but when change the param of sortBy, it imports error.
http://10.151.139.107:8080/api/v1/clusters/tdw/alerts?fields=*&Alert/state.in(WARNING,CRITICAL)&sortBy=Alert/id&format=groupedSummary
{
"status": 500,
"message": "Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.5.2.v20140319-9ad6abd):
org.eclipse.persistence.exceptions.DatabaseException\nInternal Exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column
't0.alert_id' in 'order clause'\nError Code: 1054\nCall: SELECT t2.alert_id,
t2.latest_text, t2.latest_timestamp, t2.maintenance_state,
t2.original_timestamp, t2.definition_id, t2.history_id FROM alert_current t2,
alert_history t1 WHERE (((t1.alert_state = ?) OR (t1.alert_state = ?)) AND
(t1.alert_id = t2.history_id)) ORDER BY t0.alert_id ASC\n\tbind => [2
parameters bound]\nQuery: ReadAllQuery(referenceClass=AlertCurrentEntity
sql=\"SELECT t2.alert_id, t2.latest_text, t2.latest_timestamp,
t2.maintenance_state, t2.original_timestamp, t2.definition_id, t2.history_id
FROM alert_current t2, alert_history t1 WHERE (((t1.alert_state = ?) OR
(t1.alert_state = ?)) AND (t1.alert_id = t2.history_id)) ORDER BY t0.alert_id
ASC\")"
}
It turns out the sql statement is error.
> The ambari alert api produced a wrong sql statement.
> ----------------------------------------------------
>
> Key: AMBARI-16997
> URL: https://issues.apache.org/jira/browse/AMBARI-16997
> Project: Ambari
> Issue Type: Bug
> Components: alerts, ambari-server
> Affects Versions: 2.0.0
> Reporter: ureyqiao
>
> The request of
> "http://localhost:8080/api/v1/clusters/tdw/alerts?fields=*&Alert/state.in(WARNING,CRITICAL)&sortBy=Alert/state&format=groupedSummary"
> is OK, but when change the param of sortBy, it imports error.
> http://localhost:8080/api/v1/clusters/tdw/alerts?fields=*&Alert/state.in(WARNING,CRITICAL)&sortBy=Alert/id&format=groupedSummary
> {
> "status": 500,
> "message": "Exception [EclipseLink-4002] (Eclipse Persistence Services -
> 2.5.2.v20140319-9ad6abd):
> org.eclipse.persistence.exceptions.DatabaseException\nInternal Exception:
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column
> 't0.alert_id' in 'order clause'\nError Code: 1054\nCall: SELECT t2.alert_id,
> t2.latest_text, t2.latest_timestamp, t2.maintenance_state,
> t2.original_timestamp, t2.definition_id, t2.history_id FROM alert_current t2,
> alert_history t1 WHERE (((t1.alert_state = ?) OR (t1.alert_state = ?)) AND
> (t1.alert_id = t2.history_id)) ORDER BY t0.alert_id ASC\n\tbind => [2
> parameters bound]\nQuery: ReadAllQuery(referenceClass=AlertCurrentEntity
> sql=\"SELECT t2.alert_id, t2.latest_text, t2.latest_timestamp,
> t2.maintenance_state, t2.original_timestamp, t2.definition_id, t2.history_id
> FROM alert_current t2, alert_history t1 WHERE (((t1.alert_state = ?) OR
> (t1.alert_state = ?)) AND (t1.alert_id = t2.history_id)) ORDER BY t0.alert_id
> ASC\")"
> }
> It turns out the sql statement is error.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)