Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Scripted Fields] No inline scripting languages are shown #11959

Closed
ycombinator opened this issue May 22, 2017 · 15 comments
Closed

[Scripted Fields] No inline scripting languages are shown #11959

ycombinator opened this issue May 22, 2017 · 15 comments
Labels
Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages Feature:Scripted Fields Scripted fields features impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort

Comments

@ycombinator
Copy link
Contributor

ycombinator commented May 22, 2017

When users attempt to create a scripted field in Kibana, they are supposed to be shown a list of inline scripting languages enabled in Elasticsearch. This list used to show languages such as "painless" and "expression". Now (with the latest Elasticsearch master build) this list is empty:

screen shot 2017-05-22 at 9 08 16 am

The list is populated by Kibana by calling the http://localhost:9200/_cluster/settings?include_defaults=true&filter_path=**.script.engine.*.inline Elasticsearch API at this point in the code.

This API call used to return a response like this:

 {
  "defaults": {
    "script": {
      "engine": {
        "mustache": {
          "inline": "true"
        },
        "painless": {
          "inline": "true"
        },
        "expression": {
          "inline": "true"
        }
      }
    }
  }
}

The same API call now returns:

{
}
@ycombinator ycombinator added bug Fixes for quality problems that affect the customer experience v6.0.0 v6.0.0-alpha2 :Management labels May 22, 2017
@ycombinator
Copy link
Contributor Author

ycombinator commented May 22, 2017

I've traced the cause of this Kibana bug to this change in Elasticsearch: elastic/elasticsearch@1196dfb. Given this change, Kibana will now need to figure out the list of enabled inline scripting languages some other way.

@jdconrad do you know if there's another Elasticsearch API Kibana could call now to generate this list for the user?

@jdconrad
Copy link

jdconrad commented May 22, 2017

By default all scripting languages will be inline enabled now since we no longer have languages without a sandbox. However, users can both disable script types and script contexts. The settings for those are script.allowed_types and script.allowed_contexts. Sorry for the inconvenience here. These settings changes are important for work @rjernst and I are doing to improve scripting performance and user experience.

@ycombinator
Copy link
Contributor Author

ycombinator commented May 22, 2017

@jdconrad helped me understand script types and contexts (thanks Jack!). Based on my understanding, Kibana code that shows the list of scripting languages needs to do the following now:

  1. Check that the inline scripting type is enabled in Elasticsearch (as Kibana specifies scripts inline in its requests to Elasticsearch). This is the case by default but users may disable it via the script.allowed_types cluster-level setting.

  2. Check that the search and aggs scripting contexts are enabled in Elasticsearch (as Kibana allows scripted fields in these two contexts). This is the case by default but users may disable them via the script.allowed_contexts cluster-level setting.

  3. If the previous two checks pass, show the list of inline scripting languages. For robustness, I think it would be nice if there was some way to retrieve this list from Elasticsearch (as opposed to hardcoding it in Kibana). That way, if a custom scripting engine was registered by a plugin, users could benefit from it. What do you think @jdconrad?

@jdconrad
Copy link

On issue 3, i I was thinking the same thing as soon as I realized Kibana was depending on the settings for what languages existed. I will have to think about the best way to do this.

spalger added a commit to spalger/kibana that referenced this issue May 27, 2017
spalger added a commit that referenced this issue May 27, 2017
* Fix use of KuiButtons in Clone Modal.

* [scripts] stub scripts/languages api until #11959 is fixed
snide pushed a commit to snide/kibana that referenced this issue May 30, 2017
* Fix use of KuiButtons in Clone Modal.

* [scripts] stub scripts/languages api until elastic#11959 is fixed
@spalger
Copy link
Contributor

spalger commented Jun 7, 2017

@ycombinator @jdconrad any news here?

@jdconrad
Copy link

jdconrad commented Jun 7, 2017

Apologies, I've been heavily bogged down by script contexts lately. We should probably add something like /_scripts that will return all the script engines and what contexts they support and possibly what settings are enabled.

@rjernst
Copy link
Member

rjernst commented Jun 7, 2017

Note that in 6.0, there is no more "disabling" script languages. So whatever script engines we have are available. I think this could be hardcoded in kibana at first (painless and expression). I don't see exposing which script engines are installed as a priority.

@marius-dr
Copy link
Member

This is also a blocker in 5.5.0 now.

@epixa
Copy link
Contributor

epixa commented Jun 13, 2017

@marius-dr The Elasticsearch API changed in 5.5?

@epixa epixa removed the v5.5.0 label Jun 13, 2017
@epixa
Copy link
Contributor

epixa commented Jun 13, 2017

I've confirmed with @marius-dr that this is not a problem in 5.5 after all.

@chrisronline
Copy link
Contributor

I talked about this with @ycombinator and we agreed that this is not a blocker for 6.0.0. The solution @spalger added is sufficient for 6.0.0 and we'll readdress this once/if there is a better way.

@chrisronline chrisronline removed blocker bug Fixes for quality problems that affect the customer experience v6.0.0 v6.0.0-beta1 labels Jul 12, 2017
@timroes timroes added Feature:Scripted Fields Scripted fields features Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages and removed :Management DO NOT USE labels Nov 27, 2018
@flash1293
Copy link
Contributor

@spalger @rjernst Sorry to dig this one up again but the workaround with the hardcoded language array in the API is still in place. Is there a way to fetch supported languages by now (didn't see anything in the docs)? If not we should at least implement @ycombinator suggestion 1 and 2 from #11959 (comment) , right? This comes up because we are in the process of moving those parts to the Kibana platform. I'm more than happy to ditch the check completely, but it seems like it makes a lot of sense and the absence is a bug in the current product.

@stu-elastic
Copy link
Contributor

@flash1293 We've added the API with 426c7a5 in 7.6 and 4a07802 in 8.0. Let's chat about how to use this when you get around to it.

@flash1293 flash1293 self-assigned this Dec 5, 2019
@lukeelmers lukeelmers added Team:AppArch and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Jan 22, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@flash1293 flash1293 removed their assignment Feb 27, 2020
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Jun 21, 2021
@mattkime
Copy link
Contributor

I'm closing this as Scripted Fields are deprecated in favor of runtime fields.

@exalate-issue-sync exalate-issue-sync bot added loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels Jun 22, 2021
@exalate-issue-sync exalate-issue-sync bot added loe:small Small Level of Effort and removed loe:medium Medium Level of Effort labels Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages Feature:Scripted Fields Scripted fields features impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort
Projects
None yet
Development

No branches or pull requests