**Build scan:**
https://gradle-enterprise.elastic.co/s/mekmugbnxei5c/tests/:x-pack:plugin:yamlRestTest/org.elasticsearch.xpack.test.rest.XPackRestIT/test%20%7Bp0=ml%2Finference_rescore%2FTest%20rescore%20with%20missing%20model%7D
**Reproduction line:**
```
./gradlew ':x-pack:plugin:yamlRestTest' --tests "org.elasticsearch.xpack.test.rest.XPackRestIT.test {p0=ml/inference_rescore/Test rescore with missing model}" -Dtests.seed=3CC63A1B77F9742E -Dbuild.snapshot=false -Dtests.jvm.argline="-Dbuild.snapshot=false" -Dtests.locale=ar-IQ -Dtests.timezone=Asia/Kathmandu -Druntime.java=21
```

**Applicable branches:**
8.10

**Reproduces locally?:**
Didn't try

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.xpack.test.rest.XPackRestIT&tests.test=test%20%7Bp0%3Dml/inference_rescore/Test%20rescore%20with%20missing%20model%7D
**Failure excerpt:**
```
java.lang.AssertionError: Failure at [ml/inference_rescore:4]: expected [2xx] status code but api [ml.put_trained_model] returned [400 Bad Request] [{"error":{"root_cause":[{"type":"named_object_not_found_exception","reason":"[-1:54] unknown field [learn_to_rank]","stack_trace":"org.elasticsearch.ElasticsearchException$1: [-1:54] unknown field [learn_to_rank]\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:667)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:663)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:663)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.ElasticsearchException.generateFailureXContent(ElasticsearchException.java:595)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestResponse.build(RestResponse.java:176)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestResponse.<init>(RestResponse.java:124)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestResponse.<init>(RestResponse.java:103)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleException(SecurityRestFilter.java:108)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$1(SecurityRestFilter.java:88)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations.safeAcceptException(ActionListenerImplementations.java:62)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onFailure(ActionListener.java:185)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:179)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.lambda$authenticateAndAttachToContext$3(SecondaryAuthenticator.java:99)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticate(SecondaryAuthenticator.java:109)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticateAndAttachToContext(SecondaryAuthenticator.java:90)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:82)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:415)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:544)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:317)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:453)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:549)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:426)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.handlePipelinedRequest(Netty4HttpPipeliningHandler.java:128)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:118)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardData(Netty4HttpHeaderValidator.java:194)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardFullRequest(Netty4HttpHeaderValidator.java:137)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.lambda$requestStart$1(Netty4HttpHeaderValidator.java:120)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.run(PromiseTask.java:106)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)\n\tat io.netty.common@4.1.94.Final/io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\nCaused by: org.elasticsearch.xcontent.NamedObjectNotFoundException: [-1:54] unknown field [learn_to_rank]\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.lookupParser(NamedXContentRegistry.java:162)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:146)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:414)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig.lambda$createParser$6(TrainedModelConfig.java:151)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$12(ObjectParser.java:460)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$13(ObjectParser.java:473)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:609)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:629)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:315)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:259)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:382)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction$Request.parseRequest(PutTrainedModelAction.java:46)\n\tat org.elasticsearch.ml@8.10.3/org.elasticsearch.xpack.ml.rest.inference.RestPutTrainedModelAction.prepareRequest(RestPutTrainedModelAction.java:49)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:80)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.doHandleRequest(SecurityRestFilter.java:96)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$0(SecurityRestFilter.java:87)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:177)\n\t... 41 more\n"}],"type":"x_content_parse_exception","reason":"[-1:54] [trained_model_config] failed to parse field [inference_config]","caused_by":{"type":"x_content_parse_exception","reason":"[-1:54] [inference_config] failed to parse field [learn_to_rank]","caused_by":{"type":"named_object_not_found_exception","reason":"[-1:54] unknown field [learn_to_rank]","stack_trace":"org.elasticsearch.xcontent.NamedObjectNotFoundException: [-1:54] unknown field [learn_to_rank]\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.lookupParser(NamedXContentRegistry.java:162)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:146)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:414)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig.lambda$createParser$6(TrainedModelConfig.java:151)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$12(ObjectParser.java:460)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$13(ObjectParser.java:473)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:609)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:629)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:315)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:259)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:382)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction$Request.parseRequest(PutTrainedModelAction.java:46)\n\tat org.elasticsearch.ml@8.10.3/org.elasticsearch.xpack.ml.rest.inference.RestPutTrainedModelAction.prepareRequest(RestPutTrainedModelAction.java:49)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:80)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.doHandleRequest(SecurityRestFilter.java:96)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$0(SecurityRestFilter.java:87)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:177)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.lambda$authenticateAndAttachToContext$3(SecondaryAuthenticator.java:99)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticate(SecondaryAuthenticator.java:109)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticateAndAttachToContext(SecondaryAuthenticator.java:90)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:82)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:415)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:544)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:317)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:453)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:549)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:426)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.handlePipelinedRequest(Netty4HttpPipeliningHandler.java:128)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:118)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardData(Netty4HttpHeaderValidator.java:194)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardFullRequest(Netty4HttpHeaderValidator.java:137)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.lambda$requestStart$1(Netty4HttpHeaderValidator.java:120)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.run(PromiseTask.java:106)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)\n\tat io.netty.common@4.1.94.Final/io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\n"},"stack_trace":"org.elasticsearch.xcontent.XContentParseException: [-1:54] [inference_config] failed to parse field [learn_to_rank]\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.rethrowFieldParseFailure(ObjectParser.java:554)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$12(ObjectParser.java:466)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$13(ObjectParser.java:473)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:609)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:629)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:315)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:259)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:382)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction$Request.parseRequest(PutTrainedModelAction.java:46)\n\tat org.elasticsearch.ml@8.10.3/org.elasticsearch.xpack.ml.rest.inference.RestPutTrainedModelAction.prepareRequest(RestPutTrainedModelAction.java:49)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:80)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.doHandleRequest(SecurityRestFilter.java:96)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$0(SecurityRestFilter.java:87)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:177)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.lambda$authenticateAndAttachToContext$3(SecondaryAuthenticator.java:99)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticate(SecondaryAuthenticator.java:109)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticateAndAttachToContext(SecondaryAuthenticator.java:90)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:82)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:415)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:544)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:317)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:453)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:549)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:426)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.handlePipelinedRequest(Netty4HttpPipeliningHandler.java:128)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:118)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardData(Netty4HttpHeaderValidator.java:194)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardFullRequest(Netty4HttpHeaderValidator.java:137)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.lambda$requestStart$1(Netty4HttpHeaderValidator.java:120)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.run(PromiseTask.java:106)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)\n\tat io.netty.common@4.1.94.Final/io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\nCaused by: org.elasticsearch.xcontent.NamedObjectNotFoundException: [-1:54] unknown field [learn_to_rank]\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.lookupParser(NamedXContentRegistry.java:162)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:146)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:414)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig.lambda$createParser$6(TrainedModelConfig.java:151)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$12(ObjectParser.java:460)\n\t... 53 more\n"},"stack_trace":"org.elasticsearch.xcontent.XContentParseException: [-1:54] [trained_model_config] failed to parse field [inference_config]\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.throwFailedToParse(ObjectParser.java:616)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:611)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:629)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:315)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:259)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:382)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction$Request.parseRequest(PutTrainedModelAction.java:46)\n\tat org.elasticsearch.ml@8.10.3/org.elasticsearch.xpack.ml.rest.inference.RestPutTrainedModelAction.prepareRequest(RestPutTrainedModelAction.java:49)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:80)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.doHandleRequest(SecurityRestFilter.java:96)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$0(SecurityRestFilter.java:87)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:177)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.lambda$authenticateAndAttachToContext$3(SecondaryAuthenticator.java:99)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticate(SecondaryAuthenticator.java:109)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticateAndAttachToContext(SecondaryAuthenticator.java:90)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:82)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:415)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:544)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:317)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:453)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:549)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:426)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.handlePipelinedRequest(Netty4HttpPipeliningHandler.java:128)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:118)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardData(Netty4HttpHeaderValidator.java:194)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardFullRequest(Netty4HttpHeaderValidator.java:137)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.lambda$requestStart$1(Netty4HttpHeaderValidator.java:120)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.run(PromiseTask.java:106)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)\n\tat io.netty.common@4.1.94.Final/io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\nCaused by: org.elasticsearch.xcontent.XContentParseException: [-1:54] [inference_config] failed to parse field [learn_to_rank]\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.rethrowFieldParseFailure(ObjectParser.java:554)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$12(ObjectParser.java:466)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$13(ObjectParser.java:473)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:609)\n\t... 51 more\nCaused by: org.elasticsearch.xcontent.NamedObjectNotFoundException: [-1:54] unknown field [learn_to_rank]\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.lookupParser(NamedXContentRegistry.java:162)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:146)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:414)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig.lambda$createParser$6(TrainedModelConfig.java:151)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$12(ObjectParser.java:460)\n\t... 53 more\n"},"status":400}]

  at __randomizedtesting.SeedInfo.seed([3CC63A1B77F9742E:B49205C1D90519D6]:0)
  at org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.executeSection(ESClientYamlSuiteTestCase.java:571)
  at org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.test(ESClientYamlSuiteTestCase.java:514)
  at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
  at java.lang.reflect.Method.invoke(Method.java:580)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.elasticsearch.test.cluster.DefaultElasticsearchCluster$1.evaluate(DefaultElasticsearchCluster.java:37)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:1583)

  Caused by: java.lang.AssertionError: expected [2xx] status code but api [ml.put_trained_model] returned [400 Bad Request] [{"error":{"root_cause":[{"type":"named_object_not_found_exception","reason":"[-1:54] unknown field [learn_to_rank]","stack_trace":"org.elasticsearch.ElasticsearchException$1: [-1:54] unknown field [learn_to_rank]\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:667)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:663)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:663)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.ElasticsearchException.generateFailureXContent(ElasticsearchException.java:595)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestResponse.build(RestResponse.java:176)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestResponse.<init>(RestResponse.java:124)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestResponse.<init>(RestResponse.java:103)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleException(SecurityRestFilter.java:108)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$1(SecurityRestFilter.java:88)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations.safeAcceptException(ActionListenerImplementations.java:62)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onFailure(ActionListener.java:185)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:179)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.lambda$authenticateAndAttachToContext$3(SecondaryAuthenticator.java:99)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticate(SecondaryAuthenticator.java:109)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticateAndAttachToContext(SecondaryAuthenticator.java:90)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:82)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:415)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:544)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:317)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:453)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:549)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:426)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.handlePipelinedRequest(Netty4HttpPipeliningHandler.java:128)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:118)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.codec@4.1.94.Final/io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardData(Netty4HttpHeaderValidator.java:194)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.forwardFullRequest(Netty4HttpHeaderValidator.java:137)\n\tat org.elasticsearch.transport.netty4@8.10.3/org.elasticsearch.http.netty4.Netty4HttpHeaderValidator.lambda$requestStart$1(Netty4HttpHeaderValidator.java:120)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.PromiseTask.run(PromiseTask.java:106)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)\n\tat io.netty.transport@4.1.94.Final/io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)\n\tat io.netty.common@4.1.94.Final/io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)\n\tat io.netty.common@4.1.94.Final/io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\nCaused by: org.elasticsearch.xcontent.NamedObjectNotFoundException: [-1:54] unknown field [learn_to_rank]\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.lookupParser(NamedXContentRegistry.java:162)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:146)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:414)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig.lambda$createParser$6(TrainedModelConfig.java:151)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$12(ObjectParser.java:460)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$13(ObjectParser.java:473)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:609)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:629)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:315)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:259)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:382)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction$Request.parseRequest(PutTrainedModelAction.java:46)\n\tat org.elasticsearch.ml@8.10.3/org.elasticsearch.xpack.ml.rest.inference.RestPutTrainedModelAction.prepareRequest(RestPutTrainedModelAction.java:49)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:80)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.doHandleRequest(SecurityRestFilter.java:96)\n\tat org.elasticsearch.security@8.10.3/org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$0(SecurityRestFilter.java:87)\n\tat org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:177)\n\t... 41 more\n"}],"type":"x_content_parse_exception","reason":"[-1:54] [trained_model_config] failed to parse field [inference_config]","caused_by":{"type":"x_content_parse_exception","reason":"[-1:54] [inference_config] failed to parse field [learn_to_rank]","caused_by":{"type":"named_object_not_found_exception","reason":"[-1:54] unknown field [learn_to_rank]","stack_trace":"org.elasticsearch.xcontent.NamedObjectNotFoundException: [-1:54] unknown field [learn_to_rank]\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.lookupParser(NamedXContentRegistry.java:162)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:146)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:414)\n\tat org.elasticsearch.xcore@8.10.3/org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig.lambda$createParser$6(TrainedModelConfig.java:151)\n\tat org.elasticsearch.xcontent@8.10.3/org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObject$12(ObjectParser.java:460)\n\tat...
```
test/test-clusters/src/main/java/org/elasticsearch/test/cluster/FeatureFlag.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.test.cluster;
import org.elasticsearch.test.cluster.util.Version;
/**
 * Elasticsearch feature flags. Used in conjunction with {@link org.elasticsearch.test.cluster.local.LocalSpecBuilder#feature(FeatureFlag)}
 * to indicate that this feature is required and should be enabled when appropriate.
 */
public enum FeatureFlag {
    TIME_SERIES_MODE("es.index_mode_feature_flag_registered=true", Version.fromString("8.0.0"), null),
    INFERENCE_RESCORER("es.inference_rescorer_feature_flag_enabled", Version.fromString("8.10.0"), null);
    public final String systemProperty;
    public final Version from;
    public final Version until;
    FeatureFlag(String systemProperty, Version from, Version until) {
        this.systemProperty = systemProperty;
        this.from = from;
        this.until = until;
    }
}