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

Use of field capabilities API can print warnings related to _uid field #30625

Closed
tomcallahan opened this issue May 15, 2018 · 6 comments
Closed
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@tomcallahan
Copy link
Contributor

tomcallahan commented May 15, 2018

Elasticsearch version (bin/elasticsearch --version): 6.2.0 and 6.2.1

Plugins installed: [ x-pack ]

JVM version (java -version): Any

OS version (uname -a if on a Unix-like system): Any

Description of the problem including expected versus actual behavior:

To be able to use the field capabilities without warnings.

Steps to reproduce:

In certain cases, Kibana will trigger warnings in the elasticsearch log through its use of the Field Capabilities API. This happens in particular any time an index pattern is added or refreshed in Kibana. Kibana makes this API call in particular:

[1] Run the following command

GET /*/_field_caps?fields=*&ignore_unavailable=true&allow_no_indices=false

[2] Which will yield the following warnings in the log:

[2018-05-15T16:06:05,154][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead

This is because in MappedFieldType.java we call fielddataBuilder() to determine whether or not the field can be aggregated on:

    public boolean isAggregatable() {
        try {
            fielddataBuilder("");
            return true;
        } catch (IllegalArgumentException e) {
            return false;
        }
    }

This is likely spewing warnings for a bunch of customers. Kudos to @gmoskovicz for hunting this down.

@jasontedor
Copy link
Member

What version of Elasticsearch is this? Please fill out the template when posting an issue.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@colings86 colings86 added :Search Foundations/Mapping Index mappings, including merging and defining field types >bug labels May 16, 2018
@Constantin07
Copy link

I do confirm that this issue is reproducible on ES & Kibana versions 6.2.4.

@Constantin07
Copy link

If I run a Refresh field list in Kibana under Management>Index Patterns I'm also getting a lot of below warning messages on all production nodes despite _uid is not used at all.

[2018-05-16T10:55:28,220][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead
[2018-05-16T10:55:28,220][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead
[2018-05-16T10:55:28,220][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead
[2018-05-16T10:55:28,221][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead
[2018-05-16T10:55:28,222][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead
[2018-05-16T10:55:28,222][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead
[2018-05-16T10:55:28,224][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead
[2018-05-16T11:02:02,818][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead
[2018-05-16T11:02:02,818][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead

@gmoskovicz
Copy link
Contributor

@Constantin07 Thanks for the heads up. We are aware of this and to give you some context, the Refresh Index Pattern action is going to end up calling the _field_caps endpoint, which causes this Warning message to be shown.

Keep an eye on this issue as it should be the fix for that as well.

jimczi added a commit that referenced this issue May 16, 2018
A deprecation warning is printed when creating the fieldddata builder for the `_uid` field.
This change moves the deprecation logging to the building of the fielddata since otherwise
APIs like `_field_caps` can emit deprecation warning when they just test the capabilities
of the `_uid` field.

Closes #30625
@jimczi
Copy link
Contributor

jimczi commented May 16, 2018

Thanks for reporting @gmoskovicz @tomcallahan
This is fixed by #30651

@jimczi jimczi closed this as completed May 16, 2018
jimczi added a commit that referenced this issue May 16, 2018
A deprecation warning is printed when creating the fieldddata builder for the `_uid` field.
This change moves the deprecation logging to the building of the fielddata since otherwise
APIs like `_field_caps` can emit deprecation warning when they just test the capabilities
of the `_uid` field.

Closes #30625
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

8 participants