Skip to content

[Ingest Manager] [EPM] Index pattern installation uses latest package version #80022

@jonathan-buttner

Description

@jonathan-buttner

When installing a package the index pattern installation functionality will use the latest package available in the registry to install the kibana index patterns.

Steps to reproduce:

  1. Start a fresh kibana and elasticsearch
  2. Force install the endpoint package version 0.13.1
curl --location --request POST 'http://elastic:changeme@localhost:5601/api/fleet/epm/packages/endpoint-0.13.1' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'kbn-xsrf: xxx' \
--data-raw '{
    "force": true
}'
  1. Navigate to the index patterns in stack management and search for a term that should not exist in that version of the endpoint package (e.g. caseless fields were added in 0.16.0)

image

elastic/endpoint-package#79

If you run the package registry locally you'll also notice that ingest manager made requests to download the requested package version and the latest version:

package-registry_1  | 2020/10/08 16:02:07 source.ip:, url.original: /package/endpoint/0.13.1
package-registry_1  | 2020/10/08 16:02:07 source.ip:, url.original: /package/endpoint/0.13.1/
package-registry_1  | 2020/10/08 16:02:07 source.ip:, url.original: /epr/endpoint/endpoint-0.13.1.zip
package-registry_1  | 2020/10/08 16:02:07 source.ip:, url.original: /package/endpoint/0.13.1
package-registry_1  | 2020/10/08 16:02:07 source.ip:, url.original: /package/endpoint/0.13.1/
package-registry_1  | 2020/10/08 16:02:08 source.ip:, url.original: /search
package-registry_1  | 2020/10/08 16:02:08 source.ip:, url.original: /package/endpoint/0.17.0-dev.0
package-registry_1  | 2020/10/08 16:02:08 source.ip:, url.original: /package/endpoint/0.17.0-dev.0/
package-registry_1  | 2020/10/08 16:02:08 source.ip:, url.original: /epr/endpoint/endpoint-0.17.0-dev.0.zip
package-registry_1  | 2020/10/08 16:02:08 source.ip:, url.original: /package/endpoint/0.17.0-dev.0
package-registry_1  | 2020/10/08 16:02:08 source.ip:, url.original: /package/endpoint/0.17.0-dev.0/
package-registry_1  | 2020/10/08 16:02:08 source.ip:, url.original: /package/endpoint/0.17.0-dev.0
package-registry_1  | 2020/10/08 16:02:08 source.ip:, url.original: /package/endpoint/0.17.0-dev.0/

Execution flow:

https://github.com/elastic/kibana/blob/master/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts#L375
calls

const installedPackages = await getPackageKeysByStatus(

calls
acc.push({ pkgName: pkg.name, pkgVersion: pkg.version });
which uses the version field which is populated by the registry's /search response here:
const registryItems = await Registry.fetchList({ category, experimental }).then((items) => {

which causes it to be version: 0.17.0-dev.0 instead of 0.13.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team:FleetTeam label for Observability Data Collection Fleet teambugFixes for quality problems that affect the customer experience

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions