From aa6c37c2047b0100b82d4d251986839611e61591 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Thu, 12 Oct 2023 15:54:13 +0100 Subject: [PATCH] [ML] Remove noisy 'Could not find trained model' message (#100760) A 'Could not find trained model' was logged when a new ingest pipeline using a inference processor was created but the referenced model could not be found. This isn't unusual as it is common to create a pipeline before the model is loaded. This change does not log the error message in this situation --- docs/changelog/100760.yaml | 5 +++++ .../ml/inference/loadingservice/ModelLoadingService.java | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 docs/changelog/100760.yaml diff --git a/docs/changelog/100760.yaml b/docs/changelog/100760.yaml new file mode 100644 index 0000000000000..b8d149fff5758 --- /dev/null +++ b/docs/changelog/100760.yaml @@ -0,0 +1,5 @@ +pr: 100760 +summary: Remove noisy 'Could not find trained model' message +area: Machine Learning +type: bug +issues: [] diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/loadingservice/ModelLoadingService.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/loadingservice/ModelLoadingService.java index 7a202df6fa744..a82beaf936573 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/loadingservice/ModelLoadingService.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/loadingservice/ModelLoadingService.java @@ -491,7 +491,12 @@ private void loadModel(String modelId, Consumer consumer) { handleLoadFailure(modelId, failure); })); }, failure -> { - logger.warn(() -> "[" + modelId + "] failed to load model configuration", failure); + if (consumer != Consumer.PIPELINE) { + // The model loading was triggered by an ingest pipeline change + // referencing a model that cannot be found. This is not an error + // as the model may be put later + logger.warn(() -> "[" + modelId + "] failed to load model configuration ", failure); + } handleLoadFailure(modelId, failure); })); }