fabric8io / openshift-elasticsearch-plugin

Apache License 2.0
27 stars 21 forks source link

Rethink empty response to users #133

Closed jcantrill closed 1 year ago

jcantrill commented 6 years ago

We currently intercept certain responses for cases where:

We message the user by generating a custom message which produces a stack. We should consider returning a 200 response with an empty result set though I don't know if we can notify the user. I think this is the only way to avoid the following stacks: @ewolinetz @richm @portante Thoughts?

[2018-05-01T21:04:06,100][WARN ][r.suppressed             ] path: /project.*/_field_stats, params: {level=indices, index=project.*}
org.elasticsearch.ElasticsearchException: The index returned an empty result. You can use the Time Picker to change the time filter or select a higher time interval
    at io.fabric8.elasticsearch.plugin.filter.FieldStatsResponseFilter$1.onResponse(FieldStatsResponseFilter.java:71) ~[?:?]
    at io.fabric8.elasticsearch.plugin.filter.FieldStatsResponseFilter$1.onResponse(FieldStatsResponseFilter.java:64) ~[?:?]
    at io.fabric8.elasticsearch.plugin.KibanaUserReindexAction$1.onResponse(KibanaUserReindexAction.java:178) ~[?:?]
    at io.fabric8.elasticsearch.plugin.KibanaUserReindexAction$1.onResponse(KibanaUserReindexAction.java:87) ~[?:?]
    at org.elasticsearch.action.support.broadcast.TransportBroadcastAction$AsyncBroadcastAction.start(TransportBroadcastAction.java:148) ~[elasticsearch-5.6.9.jar:5.6.9]
    at org.elasticsearch.action.support.broadcast.TransportBroadcastAction.doExecute(TransportBroadcastAction.java:76) ~[elasticsearch-5.6.9.jar:5.6.9]
    at org.elasticsearch.action.support.broadcast.TransportBroadcastAction.doExecute(TransportBroadcastAction.java:55) ~[elasticsearch-5.6.9.jar:5.6.9]
    at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:170) ~[elasticsearch-5.6.9.jar:5.6.9]
    at io.fabric8.elasticsearch.plugin.KibanaUserReindexAction.apply(KibanaUserReindexAction.java:87) ~[?:?]
    at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:168) ~[elasticsearch-5.6.9.jar:5.6.9]
    at io.fabric8.elasticsearch.plugin.filter.FieldStatsResponseFilter.apply(FieldStatsResponseFilter.java:64) ~[?:?]
    at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:168) ~[elasticsearch-5.6.9.jar:5.6.9]
    at com.floragunn.searchguard.filter.SearchGuardFilter.apply(SearchGuardFilter.java:138) ~[?:?]
    at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:168) ~[elasticsearch-5.6.9.jar:5.6.9]
    at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:142) ~[elasticsearch-5.6.9.jar:5.6.9]
    at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:84) ~[elasticsearch-5.6.9.jar:5.6.9]
    at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:83) ~[elasticsearch-5.6.9.jar:5.6.9]
    at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:72) ~[elasticsearch-5.6.9.jar:5.6.9]
richm commented 6 years ago

We need to notify the user that the result set is empty, and we need to suppress the stacktrace.