Troubleshooting 401 AuthenticationException { "Message": "Your request: '/_cluster/settings' payload is not allowed." }

0

Hello AWS Community,

I'm currently working on implementing semantic search using OpenSearch, following the steps outlined in the AWS tutorial 'Amazon OpenSearch Service for Vector Search: Demo' by Aruna Govindaraju Video Link.

In the tutorial, there's a crucial step where I need to upload a model using the command:

POST /_plugins/_ml/models/_upload
{
    "name": "sentence-transformers/all-distilroberta-v1",
    "version": "1.0.1",
    "description": "This is a sentence-transformers model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.",
    "model_task_type": "TEXT_EMBEDDING",
    "model_format": "TORCH_SCRIPT",
    "model_content_size_in_bytes": 330811571,
    "model_content_hash_value": "92bc10216c720b57a6bab1d7ca2cc2e559156997212a7f0d8bb70f2edfedc78b",
    "model_config": {
        "model_type": "roberta",
        "embedding_dimension": 768,
        "framework_type": "sentence_transformers",
        "all_config": "{\"_name_or_path\":\"distilroberta-base\",\"architectures\":[\"RobertaForMaskedLM\"],\"attention_probs_dropout_prob\":0.1,\"bos_token_id\":0,\"eos_token_id\":2,\"gradient_checkpointing\":false,\"hidden_act\":\"gelu\",\"hidden_dropout_prob\":0.1,\"hidden_size\":768,\"initializer_range\":0.02,\"intermediate_size\":3072,\"layer_norm_eps\":0.00001,\"max_position_embeddings\":514,\"model_type\":\"roberta\",\"num_attention_heads\":12,\"num_hidden_layers\":6,\"pad_token_id\":1,\"position_embedding_type\":\"absolute\",\"transformers_version\":\"4.8.2\",\"type_vocab_size\":1,\"use_cache\":true,\"vocab_size\":50265}"
    },
    "created_time": 1676072210947,
    "url": "https://artifacts.opensearch.org/models/ml-models/huggingface/sentence-transformers/all-distilroberta-v1/1.0.1/torch_script/sentence-transformers_all-distilroberta-v1-1.0.1-torch_script.zip"
}

encountered error

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "To upload custom model user needs to enable allow_registering_model_via_url settings. Otherwise please use opensearch pre-trained models."
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "To upload custom model user needs to enable allow_registering_model_via_url settings. Otherwise please use opensearch pre-trained models."
  },
  "status": 400
}

As the error said I must enable the setting:

PUT _cluster/settings 
{
  "persistent": {
    "plugins.ml_commons.allow_registering_model_via_url": true
}

Regrettably, when I attempt to run this command, I encounter the following error:

{
    "Message": "Your request: '/_cluster/settings' payload is not allowed."
}

I'm seeking guidance on how to resolve this issue and successfully enable model uploading via local files in my OpenSearch environment.

Here are the configurations of my current domain: (Complete configuration attached in image)

  • Version: OpenSearch 2.9 (latest)
  • Service software version: OpenSearch_2_9_R20230926
  • Instance type: m6g.large.search
  • Number of nodes: 1
  • Network Access: Public

Data nodes

  • Availability Zone(s): 1-AZ without standby
  • Instance type: m6g.large.search
  • Number of nodes: 1
  • Storage type: EBS
  • EBS volume type: General Purpose (SSD) - gp3
  • EBS volume size: 10 GiB
  • Provisioned IOPS: 3000 IOPS
  • Provisioned Throughput (MiB/s): 125 MiB/s
  • Dedicated m@ster nodes Enabled : No
  • Warm and cold data storage :UltraWarm data nodes enabled : No
  • IP address type: IPv4
  • Custom endpoint Enabled: No

Advanced cluster settings

  • Allow references to indices inside the body of HTTP requests.: Yes
  • Fielddata cache allocation: 20
  • Max clause count: 1024

security settings

  • Fine-grained access control Enabled: Yes
  • M@ster user type :Internal user database

** Authentication for OpenSearch Dashboards/Kibana **

  • SAML enabled :No
  • Cognito enabled :No -Region :Asia Pacific (Mumbai)

** Encryption ** -Required HTTPS : Yes -Node-to-node encryption :Yes -Encryption at rest : Yes

** Access Policy **

{
 "Version": "2012-10-17",
 "Statement": [
   {
     "Effect": "Allow",
     "Principal": {
       "AWS": "*"
     },
     "Action": "es:*",
     "Resource": "arn:aws:es:ap-south-1:<resource_id>:domain/temp1/*"
   }
 ]
}

inside the dashboard

** Roles (3) ** Roles you are currently mapped to by your administrator.

  • security_manager
  • ml_full_access
  • all_access

Backend roles (1) Backend roles you are currently mapped to by your administrator.

  • ml_full_access

Any insights or suggestions would be greatly appreciated! Thank you in advance for your assistance.

1 Answer
0

Hi Prajwal William. Did you resolve?

answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions