Sagemaker Connector - Temporary failure in name resolution

Hi,

On testing the Amazon Sagemaker model integration in v2.9.0, I receive the following error when calling the _predict api on the deployed model using sagemaker connector

"caused_by": {
      "type": "privileged_action_exception",
      "reason": "privileged_action_exception: null",
      "caused_by": {
        "type": "i_o_exception",
        "reason": "runtime.sagemaker.us-east-1.amazonaws.com: Temporary failure in name resolution"
      }
    }

The url, I use when creating the sagemaker connector is “https://runtime.sagemaker.us-east-1.amazonaws.com/endpoints/{endpoint_name}/invocations

Can anyone please spot me what is going wrong here. Thanks in advance.

Can you paste your request body here by removing the credential values ?

From your connector url https://runtime.sagemaker.us-east-1.amazonaws.com/endpoints/{endpoint_name}/invocations, you want to refer to endpoint_name defined in parameters part ? If yes, you should use https://runtime.sagemaker.us-east-1.amazonaws.com/endpoints/${parameters.endpoint_name}/invocations

You can find connector blueprint for several ML platforms like OpenAI, Cohere, Sagemaker here https://github.com/opensearch-project/ml-commons/tree/2.x/docs/remote_inference_blueprints

@ylwu Thanks for the response.

Request body,

POST /_plugins/_ml/connectors/_create
{
    "name": "test",
    "description": "Test connector for Sagemaker embedding model",
    "version": 1,
    "protocol": "aws_sigv4",
    "credential": {
        "access_key": "",
        "secret_key": "",
        "session_token": ""
    },
    "parameters": {
        "region": "us-east-1",
        "service_name": "sagemaker"
    },
    "actions": [
        {
            "action_type": "predict",
            "method": "POST",
            "headers": {
                "content-type": "text/plain"
            },
            "url": "https://runtime.sagemaker.${parameters.region}.amazonaws.com/endpoints/<endpoint-name>/invocations",
            "request_body": "[\"${parameters.inputs}\"]"
        }
    ]
}

I am hardcoding the value for endpoint-name directly in the url.

Can you share a sample request body for your Sagemaker model? You can use PostMan or Insomnia to test your Sagemaker endpoint first. This one may not suitable for your model: "[\"${parameters.inputs}\"]"

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.