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

[Ingest Manager] Updating a package immediately after a rollover fails #79370

Closed
jonathan-buttner opened this issue Oct 2, 2020 · 7 comments · Fixed by #79887
Closed

[Ingest Manager] Updating a package immediately after a rollover fails #79370

jonathan-buttner opened this issue Oct 2, 2020 · 7 comments · Fixed by #79887
Assignees
Labels
bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Defend Workflows “EDR Workflows” sub-team of Security Solution Team:Fleet Team label for Observability Data Collection Fleet team v7.10.0

Comments

@jonathan-buttner
Copy link
Contributor

jonathan-buttner commented Oct 2, 2020

Updating a package immediately after performing a rollover on a data stream fails.

Steps to reproduce:

  1. Boot up a fresh kibana and elasticsearch
  2. Force install an older endpoint package: POST http://elastic:changeme@localhost:5601/api/ingest_manager/epm/packages/endpoint-0.16.0-dev.3?force=true
  3. Ingest some data that matches a data stream of the endpoint package

https://github.com/elastic/kibana/blob/9d07a677b89a723db55a3f307bfb09c7ae189de5/x-pack/test/functional/es_archives/endpoint/pipeline/dns/data.json.gz

node scripts/es_archiver.js --es-url http://elastic:changeme@localhost:9200 --kibana-url http://elastic:changeme@localhost:5601 load x-pack/test/functional/es_archives/endpoint/pipeline/dns --use-create

The above archive will populate data in the logs-endpoint.events.network-default data stream.

  1. Perform a manual rollover POST /logs-endpoint.events.network-default/_rollover
  2. Observe that the rolled over backing index does not have the value fields associated with the data_stream object:

image

  1. Navigate to the Ingest manager app to perform an upgrade or do
POST http://elastic:changeme@localhost:5601/api/ingest_manager/epm/packages/_bulk
{
  packages: ['endpoint']
}
  1. Observe the failure:

image

This is thrown here:

throw new Error(`data_stream values are missing from the index template ${indexName}`);

  1. Ingest more data into the data stream (can probably use the same archive from step 3).
  2. Observe that the backing index has the value fields populated under data_stream

image

  1. Navigate back to the ingest manager and you will likely see another error

image

Or after some time this:

image

@jonathan-buttner jonathan-buttner added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 2, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-management (Team:Endpoint Management)

@jonathan-buttner jonathan-buttner added bug Fixes for quality problems that affect the customer experience v7.10.0 labels Oct 2, 2020
@jonathan-buttner
Copy link
Contributor Author

cc: @nnamdifrankie @kevinlog

@jonathan-buttner
Copy link
Contributor Author

@ruflin I reached to the elasticsearch team to see if it is expected behavior that the value fields will not be populated on a backing index immediately after a rollover. When you first install a data stream, there is no backing index so you don't run into this problem. And as soon as data is ingested the backing index will get the correct value fields.

@jonathan-buttner
Copy link
Contributor Author

@ruflin I reached to the elasticsearch team to see if it is expected behavior that the value fields will not be populated on a backing index immediately after a rollover. When you first install a data stream, there is no backing index so you don't run into this problem. And as soon as data is ingested the backing index will get the correct value fields.

Actually I chatted with @danhermann and this is the expected behavior as stated by the docs:

https://www.elastic.co/guide/en/elasticsearch/reference/7.x/keyword.html#constant-keyword-field-type

In case no value is provided in the mappings, the field will automatically configure itself based on the value contained in the first indexed document...

I'm not sure if we'd want to do this, but we could add the value field to each property when the ingest manager constructs the template. Since it should always be based on the contents of the package right?

Except the namespace field, that one we'd want the tool sending the data to fill the field 🤔

@neptunian
Copy link
Contributor

neptunian commented Oct 5, 2020

@jonathan-buttner thanks for creating this issue.

the only reason the error is thrown is because EPM does not know the namespace, which is why we also cant populate during template creation time.

I haven't tried it yet but I think we can pass mappings to the rollover, so perhaps we can pass the constants' values so they always get carried over.

@neptunian neptunian self-assigned this Oct 6, 2020
@MindyRS MindyRS added the impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. label Oct 8, 2020
@MindyRS MindyRS added Team:Defend Workflows “EDR Workflows” sub-team of Security Solution and removed Team:Endpoint Management labels Oct 29, 2020
@muskangulati-qasource
Copy link

muskangulati-qasource commented Nov 25, 2020

Bug Conversion

  • No Test Case Created for this ticket as its Dev Validation Ticket

Thanks!

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 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Defend Workflows “EDR Workflows” sub-team of Security Solution Team:Fleet Team label for Observability Data Collection Fleet team v7.10.0
Projects
None yet
5 participants