Kibana: Edit custom DSL Query (Painless) Causes E

Created on 4 Jun 2019  路  12Comments  路  Source: elastic/kibana

Kibana version:
7.1.0
Elasticsearch version:
7.1.0
Server OS version:
Ubuntu 18
Browser version:
74.0.3729.169
Browser OS version:
Ubuntu 18
Original install method (e.g. download page, yum, from source, etc.):
docker
Describe the bug:
When editing a painless script on the Discover tab filter bar, an error is displayed.

Steps to reproduce:

  1. Create a painless script in discover.
  2. save/run it.
  3. Click to edit filter.

Expected behavior:

Screenshots (if relevant):
discover-tab
displayed-error

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):
None.. I checked NGINX, Elasticsearch, Kibana, etc.. Appears to be in the javascript itself.
Any additional context:

:KibanaApfix-it-week Discover Filters KibanaApp bug feedback_needed painless

All 12 comments

Pinging @elastic/kibana-app

@neu5ron could you provide an example for the filter with painless script? thx a lot!

compares to fields to see if they equal each other

>
"script": {
"inline": "boolean compare(Supplier s, def v) {return s.get() == v;}compare(() -> { doc['user_name.keyword'].value == doc['user_target_name.keyword'].value }, params.value);",
"lang": "painless",
"params": {
"value": false
}
}

@neu5ron Thx, I tried to reproduce it, but there was no error in my case. could you share a screenshot when you enter the filter with the painless script? thx a lot!

just to confirm:
after you ran the script/filter did you then try to edit it afterwards?
That is when the error occurs, once you try to edit it after you have already ran/saved it.

Yes, no problems here.

ok, and yeah I actually just hit the same error editing even a basic filter.
think it may be a combination of network latency, store session (advanced kibana config setting), and maybe a jacked up nginx config...
lets just close this issue until I troubleshoot all the above..

thanks!

no problem, even when there are some issues with network & nginx, you shouldn't get a error message of this kind. thanks for the additional information, i will try the store session flag, might have something to do with this. If you have some more context to share, everything helps. (maybe you could take a look in the browser development tool console, when trying to edit the painless filter). if you don't mind, i'll reopen it for now.

I've tried it with the store session flag on, network should be a problem, since, when you click on the enter link, there's no network connection triggered. I'm asking you, if you could open the browser's development console. maybe there's a better error message, a bit more helpful

Here's the short cut to open the console, just in case Control+Shift+C (Windows, Linux, Chrome OS). And that's what you should see

Bildschirmfoto 2019-06-17 um 14 17 25

Error messages should be in the console tab, so maybe you could attach a sceenshot of the error messages when the error's triggered again. thanks a lot!

@neu5ron did you run into this issue again? like I said, it's unlikely, that it's a network related issue, thank you very much for you feedback

@kertal i figured it out... whatever happened.. who knows... but I nested into underneath "query".. previously the above JSON was exactly how I had it in Kibana.. query still run, but editing filter no go.. after this change I made, I can edit the filter and such no problem.. the new JSON in the DSL looks like this:
```
{
"query": {
"script": {
"script": {
"inline": "boolean compare(Supplier s, def v) {return s.get() == v;}compare(() -> { doc['user_name.keyword'].value == doc ['user_target_name.keyword'].value }, params.value);",
"lang": "painless",
"params": {
"value": false
}
}
}
}
}

Thanks for your feedback!

Was this page helpful?
0 / 5 - 0 ratings