Closed austintlee closed 2 weeks ago
RestMLRemoteInferenceIT > testDeleteConnector FAILED org.opensearch.client.ResponseException: method [POST], host [http://127.0.0.1:55810], URI [/_plugins/_ml/connectors/_create], status line [HTTP/1.1 503 Service Unavailable] {"error":{"root_cause":[{"type":"unavailable_shards_exception","reason":"[.plugins-ml-connector][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[.plugins-ml-connector][0]] containing [index {[.plugins-ml-connector][bnO6yZEB1QdOTLrBQkCP], source[{\"name\":\"OpenAI Connector\",\"version\":\"1\",\"description\":\"The connector to public OpenAI model service for GPT 3.5\",\"protocol\":\"http\",\"parameters\":{\"endpoint\":\"api.openai.com\",\"content_type\":\"application/json\",\"auth\":\"API_Key\",\"max_tokens\":\"7\",\"temperature\":\"0\",\"model\":\"gpt-3.5-turbo-instruct\"},\"credential\":{\"openAI_key\":\"<api key>\"},\"actions\":[{\"action_type\":\"PREDICT\",\"method\":\"POST\",\"url\":\"https://${parameters.endpoint}/v1/completions\",\"headers\":{\"Authorization\":\"Bearer ${credential.openAI_key}\"},\"request_body\":\"{ \\\"model\\\": \\\"${parameters.model}\\\", \\\"prompt\\\": \\\"${parameters.prompt}\\\", \\\"max_tokens\\\": ${parameters.max_tokens}, \\\"temperature\\\": ${parameters.temperature} }\"}],\"client_config\":{\"max_connection\":20,\"connection_timeout\":50000,\"read_timeout\":50000,\"retry_backoff_millis\":200,\"retry_timeout_seconds\":30,\"max_retry_times\":0,\"retry_backoff_policy\":\"constant\"}}]}] and a refresh]"}],"type":"unavailable_shards_exception","reason":"[.plugins-ml-connector][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[.plugins-ml-connector][0]] containing [index {[.plugins-ml-connector][bnO6yZEB1QdOTLrBQkCP], source[{\"name\":\"OpenAI Connector\",\"version\":\"1\",\"description\":\"The connector to public OpenAI model service for GPT 3.5\",\"protocol\":\"http\",\"parameters\":{\"endpoint\":\"api.openai.com\",\"content_type\":\"application/json\",\"auth\":\"API_Key\",\"max_tokens\":\"7\",\"temperature\":\"0\",\"model\":\"gpt-3.5-turbo-instruct\"},\"credential\":{\"openAI_key\":\"<api key>\"},\"actions\":[{\"action_type\":\"PREDICT\",\"method\":\"POST\",\"url\":\"https://${parameters.endpoint}/v1/completions\",\"headers\":{\"Authorization\":\"Bearer ${credential.openAI_key}\"},\"request_body\":\"{ \\\"model\\\": \\\"${parameters.model}\\\", \\\"prompt\\\": \\\"${parameters.prompt}\\\", \\\"max_tokens\\\": ${parameters.max_tokens}, \\\"temperature\\\": ${parameters.temperature} }\"}],\"client_config\":{\"max_connection\":20,\"connection_timeout\":50000,\"read_timeout\":50000,\"retry_backoff_millis\":200,\"retry_timeout_seconds\":30,\"max_retry_times\":0,\"retry_backoff_policy\":\"constant\"}}]}] and a refresh]"},"status":503} at __randomizedtesting.SeedInfo.seed([5A4DB80AB4595406:9ADC268A24B8243E]:0) at app//org.opensearch.client.RestClient.convertResponse(RestClient.java:501) at app//org.opensearch.client.RestClient.performRequest(RestClient.java:384) at app//org.opensearch.client.RestClient.performRequest(RestClient.java:374) at app//org.opensearch.client.RestClient.performRequest(RestClient.java:359) at app//org.opensearch.ml.utils.TestHelper.makeRequest(TestHelper.java:182) at app//org.opensearch.ml.utils.TestHelper.makeRequest(TestHelper.java:155) at app//org.opensearch.ml.rest.RestMLRemoteInferenceIT.createConnector(RestMLRemoteInferenceIT.java:841) at app//org.opensearch.ml.rest.RestMLRemoteInferenceIT.testDeleteConnector(RestMLRemoteInferenceIT.java:98)
@dhrubo-os Is working on this.
Closing the issue as the PR is merged now.
What is the bug? It looks like the error message in the CreateConnector failure response contains the API key in the template.
How can one reproduce the bug? Steps to reproduce the behavior:
What is the expected behavior? A clear and concise description of what you expected to happen.
What is your host/environment?
Do you have any screenshots? If applicable, add screenshots to help explain your problem.
Do you have any additional context? Add any other context about the problem.