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

Index templates are not compatible with file-based component templates #118594

Open
jeanfabrice opened this issue Dec 12, 2024 · 1 comment
Open
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team

Comments

@jeanfabrice
Copy link
Contributor

Elasticsearch Version

8.16.1

Installed Plugins

none

Java Version

bundled

OS Version

Kubernetes 1.30.4 on Ubuntu 22.04

Problem Description

Elasticsearch returns HTTP/400 when creating an index template via API call where one of the associated component templates is a file-based component template

This, for example, prevents integration from upgrading when it ships with an updated index templates.
E.g:
Image

(I'm sorry I can't copy-paste the error as the message is not persistent when I try to move my mouse to select it.)

Additional context in these Slack threads:

Steps to Reproduce

  1. Create and apply test@custom component template via ECK stackconfigpolicy
apiVersion: stackconfigpolicy.k8s.elastic.co/v1alpha1
kind: StackConfigPolicy
metadata:
  name: elasticsearch
spec:
  elasticsearch:
    indexTemplates:
      componentTemplates:
        test@custom:
          template:
            settings:
              refresh_interval: "10s"
  1. Wait for the stackconfigpolicy to be in ready phase (change propagated)
$ k get stackconfigpolicies.stackconfigpolicy.k8s.elastic.co elasticsearch 
NAME            READY   PHASE   AGE
elasticsearch   2/2     Ready   1d
  1. Go to Kibana developer tools and create a test index template this way
PUT _index_template/test
{
  "index_patterns": ["test*"],
  "template": {
    "settings": {},
    "mappings": {}
  },
  "priority": 200,
  "composed_of": ["test@custom","test2@custom"],
  "ignore_missing_component_templates": ["test@custom","test2@custom"]
}
  1. See the error returned
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": """Failed to process request [PutTemplateV2Request[name=test, cause=api, create=false, index_template={"index_patterns":["test*"],"template":{"settings":{}},"composed_of":["test@custom","test2@custom"],"priority":200,"ignore_missing_component_templates":["test@custom","test2@custom"]}]] with errors: [[component_template:test@custom] is reserved by [file_settings]]"""
      }
    ],
    "type": "illegal_argument_exception",
    "reason": """Failed to process request [PutTemplateV2Request[name=test, cause=api, create=false, index_template={"index_patterns":["test*"],"template":{"settings":{}},"composed_of":["test@custom","test2@custom"],"priority":200,"ignore_missing_component_templates":["test@custom","test2@custom"]}]] with errors: [[component_template:test@custom] is reserved by [file_settings]]"""
  },
  "status": 400
}

Logs (if relevant)

No response

@jeanfabrice jeanfabrice added >bug needs:triage Requires assignment of a team area label labels Dec 12, 2024
@gwbrown gwbrown added :Data Management/Indices APIs APIs to create and manage indices and templates and removed needs:triage Requires assignment of a team area label labels Dec 12, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team
Projects
None yet
Development

No branches or pull requests

3 participants