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

Migration from 7.4.1 to 7.6 failed #57664

Closed
barkbay opened this issue Feb 14, 2020 · 4 comments
Closed

Migration from 7.4.1 to 7.6 failed #57664

barkbay opened this issue Feb 14, 2020 · 4 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@barkbay
Copy link

barkbay commented Feb 14, 2020

Kibana version: Migration from 7.4.1 to 7.6

Elasticsearch version: 7.6

Describe the bug:

A migration failed with the following message:

{ Error: Document contains at least one immense term in field="config.xpackReporting:customPdfLogo.keyword" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. 
Please correct the analyzer to not produce such terms. 
The prefix of the first immense term is: [100, 97, 116]..., original message: bytes can be at most 32766 in length; got 40102
    at Object.write (/kibana/src/core/server/saved_objects/migrations/core/elastic_index.js:152:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  detail:
   { index:
      { _index: '.kibana_6',
        _type: '_doc',
        _id: 'config:7.2.0',
        status: 400,
        error: [Object] } } }

It is quite hard to recover because we have an other error if we try to downgrade to the previous version:

{ Error: Document "Maps-maps_telemetry" has property "task" which belongs to a more recent version of Kibana (7.6.0).

Could an improvement would be to prevent this kind of error by not allowing the user to upload a document with a size > 32766 bytes. ?

@rudolf
Copy link
Contributor

rudolf commented Feb 14, 2020

Advanced settings stored in this document use dynamic mappings which for a string, will automatically use the text type with a keyword subtype which includes ignore_above: 256. It looks like we somehow loose the ignore_above: 256 while re-indexing this document as part of a migration.

@rudolf rudolf added Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Feb 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@rudolf rudolf added the bug Fixes for quality problems that affect the customer experience label Feb 14, 2020
@rudolf
Copy link
Contributor

rudolf commented Feb 14, 2020

I was unable to reproduce this.

I started Kibana 7.4.1 and then did the following:

  1. Set a customPdfLogo in advanced settings
  2. Create a map (since maps have a migration in 7.5 this ensures that we migrate data)

I then started Kibana 7.6, it detected that documents had to be migrated and then successfully completed the migrations.

For both versions the .kibana_n index had the following config mapping:

"config" : {
          "dynamic" : "true",
          "properties" : {
            "buildNum" : {
              "type" : "keyword"
            },
            "xpackReporting:customPdfLogo" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        }

@rudolf
Copy link
Contributor

rudolf commented Feb 18, 2020

The root cause was a dynamic (field mapping) template which was configured to apply to all new indices including the .kibana_n indices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

3 participants