Custom Elasticsearch plugin error not displaying in kibana 6.8

Hello I have a custom elasticsearch plugin that returns a custom error message. Usually of type 400
In previous version of kibana 6.3> This error would get passed to the client and be displayed. :smiley:

I have recently updated to 6.8 and now the error seems to get caught by the kibana server which catches the error and then sends the unhelpful error message: {statusCode: 500, error "Internal Server Error", message: "An Internal server server error occurred"}

Hey @robrotheram, are you writing your own "route handler" for your custom plugin? There have been quite a few changes between 6.3 and 6.8, so if you could provide more details for how your plugin works and how it throws errors, it'll help the investigative effort.

Hi, I am not using any route handler inside of kibana. Currently there is a plugin in elasticsearch uses the rest filter and looks at some headers we add in our custom kibana plugin using the angular http interceptor. In previous versions of kibana when the elastic plugin throws a http 400 error with a custom error message that would get passed all the way back to the browser and would display the error message. Currently (in 6.8 ) it gets caught in the kibana server, I can see the error message in the kibana logs but that does not get back to the browser only a generic 500 error created by kibana.

It's up to the Kibana http handler/route whether or not errors that are thrown from Elasticsearch should be propagated to the client, or whether or not a generic 500 should be returned. It's not possible to rely on the previous behavior everywhere. Are you intercepting all ES rest requests in a generic manner, or are you only looking to augment the behavior of certain ES endpoints?

It not a new http endpoint. It adds the header to all _msearch and search requests the plugin inside of elasticsearch intercepts the header checks the header and if valid continues with the search otherwise it returns the 400 error. I just wanted to pass this error from elastic onto the user without having to fork kibana rewite the entire of the elastic proxy in the kibana server. This worked in 6.3 < because the elasticsearch proxy in kibana just forward all requests back the the browser

So after much digging I found the root cause of my issue. Sometime after 6.3 this line was added

By rejecting the promise cause the 500 error that I get. I now have a custom installer script that will remove these lines from kibana source

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.