Versions: OpenSearch 2.19 (AWS managed servers)
Describe the issue:
I’ve configured a connector (that goes on company’s internal API embedding model) and a model to use it. Running a predict on model works just fine (got back the “inference_results”, the embedding vector, etc).
Now I’m trying to create a pipeline in order to ingest a document and store its embedded data, as it’s supposed to be integrated with the model and connector.
The issue is that putting a new doc on a index, using this pipeline, give me back the error below:
PUT /index-01/_doc/1
{
“text”: “Hello world”,
“id”: “s1”
}
{
“error”: {
“root_cause”: [
{
“type”: “illegal_state_exception”,
“reason”: “failed while calling model, check error log for details”
}
],
“type”: “illegal_state_exception”,
“reason”: “failed while calling model, check error log for details”
},
“status”: 500
}
Please, help me understanding what is the issue and how to fix it.
I don’t see how the “input” parameter on connector is linked to the index “text” field. I can’t find on official docs what should I do.
I also don’t know which log is it talking about. I’ve log groups configurated on CloudWatch, but couldn’t find any regarding this issue. Where can I find it?
Am I missing something? What should I change?
Configuration:
#################
CONNECTOR
#################
GET /_plugins/_ml/connectors/zQTjfpoBTaRJSyt75N7r
{
“name”: “LiteLLM embeddings - text-embedding-3-small”,
“version”: “1”,
“description”: “LiteLLM embeddings - text-embedding-3-small”,
“protocol”: “http”,
“parameters”: {
“endpoint”: “``api.example.com``”,
“model”: “text-embedding-3-small”
},
“actions”: [
{
“action_type”: “PREDICT”,
“method”: “POST”,
“url”: “``https://$``{parameters.endpoint}/ia/texto/v1/litellm/litellm/engines/${parameters.model}/embeddings”,
“headers”: {
“api-key”: “${credential.secretArn.api-key}”,
“Host”: “``api.example.com``”,
“Content-Type”: “application/json”
},
“request_body”: “”“{ “input”: ${parameters.input} }”“”
}
],
“owner”: {
“name”: “xxx”,
“backend_roles”: [
“xxx”
],
“roles”: [
“manage_snapshots”,
“ml_full_access”,
“snapshot_management_read_access”
],
“custom_attribute_names”:,
“user_requested_tenant”: “null”,
“user_requested_tenant_access”: “NONE”
},
“access”: “public”,
“created_time”: 1763065455850,
“last_updated_time”: 1763065455850,
“client_config”: {
“max_connection”: 30,
“connection_timeout”: 30000,
“read_timeout”: 30000,
“retry_backoff_millis”: 200,
“retry_timeout_seconds”: 30,
“max_retry_times”: 0,
“retry_backoff_policy”: “constant”,
“verify_ssl”: false
}
}
#################
MODEL GROUP
#################
GET /_plugins/_ml/model_groups/URXlfpoBMnrhtYk0Va3l
{
“name”: “LiteLLM embeddings - text-embedding-3-small”,
“latest_version”: 2,
“description”: “LiteLLM embeddings - text-embedding-3-small”,
“backend_roles”: [
“xxx”
],
“owner”: {
“name”: “xxx”,
“backend_roles”:,
“roles”: [
“security_manager”,
“all_access”
],
“custom_attribute_names”:,
“user_requested_tenant”: null,
“user_requested_tenant_access”: “WRITE”
},
“access”: “restricted”,
“created_time”: 1763065550309,
“last_updated_time”: 1763066083432
}
#################
MODEL
#################
GET /_plugins/_ml/models/0hXrfpoBMnrhtYk0lcXw
{
“name”: “LiteLLM embeddings - text-embedding-3-small”,
“model_group_id”: “URXlfpoBMnrhtYk0Va3l”,
“algorithm”: “REMOTE”,
“model_version”: “1”,
“description”: “LiteLLM embeddings - text-embedding-3-small”,
“model_state”: “DEPLOYED”,
“created_time”: 1763065959920,
“last_updated_time”: 1763066030159,
“last_deployed_time”: 1763066030159,
“auto_redeploy_retry_times”: 0,
“planning_worker_node_count”: 3,
“current_worker_node_count”: 3,
“planning_worker_nodes”: [
“WYAJWdCOTpqTP2zF4LjzhA”,
“Lgkv7fYeTou7zX0mtAoJMQ”,
“NzhBKp-VTLW99scG79875A”
],
“deploy_to_all_nodes”: true,
“is_hidden”: false,
“connector_id”: “zQTjfpoBTaRJSyt75N7r”
}
Validating connector:
POST /_plugins/_ml/models/0hXrfpoBMnrhtYk0lcXw/_predict
{
“parameters”: {
“input”: [“Hello world”]
}
}
{
“inference_results”: [
{
“output”: [
{
“name”: “response”,
“dataAsMap”: {
“model”: “text-embedding-3-small”,
“data”: [
{
“embedding”: [
-0.002078542485833168,
-0.04908587411046028,
[…]
-0.006101156119257212
],
“index”: 0,
“object”: “embedding”
}
],
“object”: “list”,
“usage”: {
“completion_tokens”: 0,
“prompt_tokens”: 2,
“total_tokens”: 2
}
}
}
],
“status_code”: 200
}
]
}
#################
PIPELINE
#################
GET _ingest/pipeline/api_text-embedding-3-small_field_text
{
“api_text-embedding-3-small_field_text”: {
“description”: “LiteLLM embeddings - text-embedding-3-small”,
“processors”: [
{
“text_embedding”: {
“model_id”: “0hXrfpoBMnrhtYk0lcXw”,
“field_map”: {
“text”: “passage_embedding”
}
}
}
]
}
}
#################
INDEX
#################
GET index-01
{
“index-01”: {
“aliases”: {},
“mappings”: {
“properties”: {
“id”: {
“type”: “text”
},
“passage_embedding”: {
“type”: “knn_vector”,
“dimension”: 3072,
“method”: {
“engine”: “lucene”,
“space_type”: “l2”,
“name”: “hnsw”,
“parameters”: {}
}
},
“text”: {
“type”: “text”
}
}
},
“settings”: {
“index”: {
“replication”: {
“type”: “DOCUMENT”
},
“number_of_shards”: “1”,
“provided_name”: “index-01”,
“default_pipeline”: “api_text-embedding-3-small_field_text”,
“knn”: “true”,
“creation_date”: “1763037729696”,
“number_of_replicas”: “1”,
“uuid”: “XU2HJSpsQZa4lGpnIjivNg”,
“version”: {
“created”: “136407827”
}
}
}
}
}
Getting error when inserting data:
PUT /index-01/_doc/1
{
“text”: “Hello world”,
“id”: “s1”
}
{
“error”: {
“root_cause”: [
{
“type”: “illegal_state_exception”,
“reason”: “failed while calling model, check error log for details”
}
],
“type”: “illegal_state_exception”,
“reason”: “failed while calling model, check error log for details”
},
“status”: 500
}