Cannot PUT _index_template/template_1

Nope. This is in our internal jira.

Ok, I just opened an issue on the github repository, where it is far easier to follow up.

2 Likes

When can we expect the fix?

please see my post above:

Hi there,

The new 1.25 is out, but it seems the fix is not in.
Am I right or did I miss something? Could you please update us on the status of this issue?

Regards,
Benoît

Yes, it was moved to sprint 1.26.0 because of ROR enterprise users hot requests which we solve in the first place. Sorry for the delay.

Hello,

Would you have sone news ?
I also need that feature.

Is there any hope to have it in the next release ?

Regards,
Hugues

yes, for sure it will be included in the next release. I’m currently working on it. I’ll send pre-build to test soon. Just leave an info about ES version you use.

Hello,

I am currently building an ES cluster 7.10.1 with ReadonlyREST 1.26.1 and I would gladly test it if you have a working pre-build because I also need this feature.

Regards.

Hello,
any update about this issue? We have been following this discussion but there are no updates since more than a month.
Is is fixed in any recent release?

Regards.

it’s almost done. Please leave info about ES version you use and I’ll send you a prebuild to test soon.

This is already merged to develop. I’m waiting for the pipeline and I’m going to paste here links to a prebuild for ES versions mentioned in this thread. If anyone wants to test it, but didn’t let us know yet, let don’t hesitate to do it now (obviously, please give an info about ES version)

@kkt2mail ROR 1.28.0-pre5 for ES 7.9.0

@askids ROR 1.28.0-pre5 for ES 7.8.1

@bquartier ROR 1.28.0-pre5 for ES 7.9.2

@lenny ROR 1.28.0-pre5 for ES 7.10.1

And: ROR 1.28.0-pre5 for ES 7.11.1

I’d be grateful if you guys could test it and let me know if it works for you.

Hello,

I tested the new plugin and it is ok to add an index_template :

curl -X PUT "https://my-elasticsearch/_index_template/template_1?pretty" -H 'Content-Type: application/json' -d'
{
  "index_patterns" : ["test*"],
  "priority" : 1,
  "template": {
    "settings" : {
      ......
    }
  }
}'

{
  "acknowledged" : true
}

Thanks.

For information we use component templates on our platform and is seems its not working with the plugin :

curl -X PUT "https://my-elasticsearch/_index_template/template_1?pretty" -H 'Content-Type: application/json' -d'
{
  "index_patterns": ["test*"],
  "composed_of": ["component_1"]
}'

{
  "error" : {
    "root_cause" : [
      {
        "type" : "null_pointer_exception",
        "reason" : "Cannot invoke \"org.elasticsearch.cluster.metadata.Template.aliases()\" because the return value of \"org.elasticsearch.cluster.metadata.ComposableIndexTemplate.template()\" is null"
      }
    ],
  "status" : 500
}

(the same request bypassing the Readonlyrest plugin works great)

Regards,

Thanks for the info. We will check that. The component templates are supported, so it looks like a bug.

Could you please test this version?

If it fixes the issue you reported, we’ll release 1.28.1 with the bug fix as fast as possible.

Hello,

I tested the new version :

curl "https://es-cluster/_cat/plugins"                                                                                                       
es-master-2 readonlyrest  1.28.1-pre1

But I still have the same error :

curl -X PUT "https://es-master-2:9200/_index_template/testror?pretty" -H 'Content-Type: application/json' -d'
{
  "index_patterns": ["testror*"],
  "composed_of": ["component_1"]
}
'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "null_pointer_exception",
        "reason" : "Cannot invoke \"org.elasticsearch.cluster.metadata.Template.aliases()\" because the return value of \"org.elasticsearch.cluster.metadata.ComposableIndexTemplate.template()\" is null"
      }
    ],
    "type" : "null_pointer_exception",
    "reason" : "Cannot invoke \"org.elasticsearch.cluster.metadata.Template.aliases()\" because the return value of \"org.elasticsearch.cluster.metadata.ComposableIndexTemplate.template()\" is null"
  },
  "status" : 500
}

(Also tested with the terraform provider)

Here is the stacktrace in the master logs when th API call is done :
master_stacktrace.zip (1.8 KB)

Regards.

@lenny thanks for the stacktrace. Now it was easy to identify place where NPE occurred. Here is a build with fix: click

BTW. we have found 2 more issues with templates. They will be fixed soon. We’ll release 1.28.1 as soon as possible (at the beginning of the next week)

@lenny did you check the build? We’re about to release 1.28.1 and if it still doesn’t work in your case, please let us know.

I just tested the 1.28.1-pre3 version, everything works great !

I’ll wait for the 1.28.1 then, thanks !

Regards.

2 Likes