question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Put Lifecycle method in ILM Client causes 400 Bad Request

See original GitHub issue

The PUT Lifecycle Endpoint send the name as a property in the body, which is not accepted by Elasticsearch. This causes a 400 Bad Request Response. Therefore this method is not usable.

Code

Application

client.ilm().putLifecycle(it -> {
    it.name(policy.name())
    it.policy(policy)
});

Request

Endpoint: PUT /_ilm/policy/{id}

{
  "policy": {
    "phases": {...},
    "name": "{id}"
  }
}

Response

Status: 400 Bad Request

{
  "error": {
    "root_cause": [
      {
        "type": "x_content_parse_exception",
        "reason": "[1:94] [lifecycle_policy] unknown field [name]"
      }
    ],
    "type": "x_content_parse_exception",
    "reason": "[1:101] [put_lifecycle_request] failed to parse field [policy]",
    "caused_by": {
      "type": "x_content_parse_exception",
      "reason": "[1:94] [lifecycle_policy] unknown field [name]"
    }
  },
  "status": 400
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
swallezcommented, May 4, 2022

@oliverlockwood I’m working on a number of things both on the Java client and other projects, and prioritizing something will make some people happy but will obviously not be satisfying for others who don’t care much about it. I understand your concerns and I’m currently actively working on fixing the data structure related issues (coming from the API specification) since they’re more problematic that say missing features or a more extensive documentation, which are also highly requested. However data structure related issues also have to be prioritized according to the usage frequency of the affected APIs.

Now I heard you, and expect some news on these issues very soon. Thanks.

I also added a comment in #203 about the split package issue.

2reactions
swallezcommented, May 24, 2022

This has been fixed in PR #292, backported to version 8.2 in PR #293 and to version 7.17 in PR #294.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting index lifecycle management errors - Elastic
When ILM executes a lifecycle policy, it's possible for errors to occur while performing the necessary index operations for a step. When this...
Read more >
Error 400 navigating around IBM Engineering Lifecycle ...
Error 400 navigating around IBM Engineering Lifecycle Management applications due to cookies header exceeding a size limit.
Read more >
ILM Store Troubleshooting - SAP Blogs
SLG1 Error: 400 Bad Request. Resolution: Implement SAP Note 2630651. Storage Media – File System. For using the file system as storage media, ......
Read more >
elascticsearch roll over based on ilm policy with keeping ...
First, it looks like the application code is doing the "rollover" by itself since it's changing the index name everyday.
Read more >
Why do I get a 400 Bad Request error when working ... - JFrog
Moreover, when using a Gradle client to resolve from a Maven repository, the request will always fail regardless of the version. Typically, only ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found