Skip to content

Inference API returns an incorrect error message when inference ID = model ID #111312

@ppf2

Description

@ppf2

Elasticsearch Version

8.15

Installed Plugins

No response

Java Version

bundled

OS Version

Mac OS

Problem Description

When creating an inference endpoint using an inference_id that is identical to the model_id, it returns a misleading error suggesting that the inference API is trying to re-deploy the model again after eland has already deployed it to ML.

Steps to Reproduce

When creating an inference endpoint using an inference_id that is identical to the model_id:

PUT _inference/text_embedding/sentence-transformers__all-minilm-l6-v2
{
  "service": "elasticsearch",
  "service_settings": {
    "num_allocations": 1,
    "num_threads": 1,
    "model_id": "sentence-transformers__all-minilm-l6-v2" 
  }
}

It returns a misleading error message:

{
  "error": {
    "root_cause": [
      {
        "type": "status_exception",
        "reason": "Model IDs must be unique. Requested model ID [sentence-transformers__all-minilm-l6-v2] matches existing model IDs but must not."
      }
    ],
    "type": "status_exception",
    "reason": "Model IDs must be unique. Requested model ID [sentence-transformers__all-minilm-l6-v2] matches existing model IDs but must not."
  },
  "status": 400
}

The error should say something like the following instead:

Inference ID [<inference_id>] must be unique and must not match the <model_id>.

Logs (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    :mlMachine learning>bugTeam:MLMeta label for the ML team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions