-
Notifications
You must be signed in to change notification settings - Fork 248
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
Put Lifecycle method in ILM Client causes 400 Bad Request #160
Comments
Yup, this leaves people forced to continue using the RHLC to set lifecycle policies. |
I updated my cluster to 8.1.3 and tried to use the RHLC but this did not work due to an incompatibility (see Stack Trace below). But I can not fully replace the RHLC because of this issue.
|
@swallez it's been 7 weeks since I flagged this issue with you in a comment on #203. Perhaps this and the other issues I highlighted need to be tagged with a label such as "blocks use of new Java client"? Also, surely this particular issur is trivial to resolve, so why not just get it fixed? If you're really short staffed I'll consider raising a PR myself. Let me know. Many thanks. |
@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. |
Thank you @swallez |
@raynigon what is the content of your client.ilm().putLifecycle(it -> {
it.name(policy.name())
it.policy(policy)
}); I was able to reproduce the problem by setting the However, when removing Example: Time tenDays = Time.of(t -> t.time("10d"));
JsonObject empty = Json.createObjectBuilder().build();
PutLifecycleRequest req = PutLifecycleRequest.of(it -> it
.name("foo") // <=== set this one
.policy(pol -> pol
.phases(ph -> ph
.hot(h -> h
.minAge(tenDays)
.actions(JsonData.of(empty))
)
)
.name("bar") // <=== do NOT set this one
)
); We'll remove |
Also:
Have you enabled HLRC compatibility mode using This allows the HLRC to work with Elasticsearch version |
@swallez Thanks that helped a lot. Not setting the name on the ILM Policy resolves the error. One of the next steps in my MigrationService handles component templates i found an error case there as well, see #282 |
Absolutely. I've already fixed this in the API specification as part or a larger batch of fixes, and will close this issue once the Java code has been udpated to remove this property that should not exist. |
* Fix MultiTermsRequest - elastic/elasticsearch-java#160 * TypeFieldMappings is a multi-key dictionary - elastic/elasticsearch-java#166 * Fix TranslateSqlResponse - elastic/elasticsearch-java#167 * Token filter properties are generally optional - elastic/elasticsearch-java#199 * Fix typo in IndexSettings.mapping and allow extended settings - elastic/elasticsearch-java#295 * ShardRecovery.stop_time_in_millis is optional - elastic/elasticsearch-java#202
* Fix MultiTermsRequest - elastic/elasticsearch-java#160 * TypeFieldMappings is a multi-key dictionary - elastic/elasticsearch-java#166 * Fix TranslateSqlResponse - elastic/elasticsearch-java#167 * Token filter properties are generally optional - elastic/elasticsearch-java#199 * Fix typo in IndexSettings.mapping and allow extended settings - elastic/elasticsearch-java#295 * ShardRecovery.stop_time_in_millis is optional - elastic/elasticsearch-java#202
* Fix MultiTermsRequest - elastic/elasticsearch-java#160 * TypeFieldMappings is a multi-key dictionary - elastic/elasticsearch-java#166 * Fix TranslateSqlResponse - elastic/elasticsearch-java#167 * Token filter properties are generally optional - elastic/elasticsearch-java#199 * Fix typo in IndexSettings.mapping and allow extended settings - elastic/elasticsearch-java#295 * ShardRecovery.stop_time_in_millis is optional - elastic/elasticsearch-java#202
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
Request
Endpoint: PUT /_ilm/policy/{id}
Response
Status: 400 Bad Request
The text was updated successfully, but these errors were encountered: