Why am I getting a 401 error when trying to update OpenSearch settings after my upgrade?

0
0
Asked By CuriousCoder92 On

Hey everyone! I've recently upgraded my AWS OpenSearch from version 2.13 to 2.17, and I'm having a tough time with a 401 error when I try to update cluster settings using a curl command. Here's the command I'm using:

```bash
curl -u 'dude:sweet' -k -X PUT https://localhost:5601/_cluster/settings -w "%{http_code}"
-H 'Content-Type: application/json'
-d '{
"persistent": {
"cluster.max_shards_per_node": 1000
}
}'
```

The user I'm using is the master user created through Terraform, and fine-grained access controls are enabled. I can successfully perform a GET request on the same endpoint and log into the UI without any issues. The user "dude" has all access permissions, yet I still receive a 401 error when trying to put the settings.

Am I referencing the setting incorrectly, or is there something else I might be missing? Also, just to clarify, we are using multi-AZ without standby, and according to the documentation, that should be supported. I need to set this value to set alerts regarding the number of shards to avoid upsizing earlier than necessary. Any thoughts or tips would be appreciated!

2 Answers

Answered By TechWhiz99 On

It sounds like you've checked a lot of the common issues already. One possibility is that the security settings got stricter in the newer version. You might want to double-check your user's permissions specifically for updating cluster settings. Sometimes, after an upgrade, certain permissions can change, even if they appear to be set correctly. Another thing to consider is whether there are any new role requirements that weren't there in 2.13 that could be preventing you from executing the PUT command. Good luck!

DudeWithQuestions -

Thanks! I hadn't considered that the permissions might be different after the upgrade. I'll definitely revisit the security settings and the user's roles.

Answered By DataNinja45 On

I’ve seen similar issues with permissions turning up after version upgrades. Have you tried recreating the user or generating a new one to rule out any unseen issues? Also, make sure to check the service policies in your AWS settings; sometimes they require updates too after such changes. It might not be exactly what you're looking for, but it’s worth a shot!

CuriousCoder92 -

Recreating the user sounds like a good approach to clear any potential issues! I'll try that and see if it helps.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.