Error while connecting to Prometheus

I’m trying to connect to Prometheus datasource, I’ve entered all the relevant details, but when I’m trying to connect, I get the following error :

“status”: 503,
“error”: {
“type”: “AwsCryptoException”,
“reason”: “There was internal problem at backend”,
“details”: “ Invalid AES key length: 4 bytes”

I’ve used the following script to generate the master key:

#Generate a 24-character key
masterkey=$(openssl rand -hex 12)
echo “Master Key: $masterkey”

I used base64 instead of hex, no luck there as well. Can you please help me out.

Hey @NandanIK

By chance did you add it to the configuration file and restart the service?

Hi @Gsmitt I used the script in a different file and ran it. After that I restarted the service using systemctl restart opensearch

I included plugins.query.datasources.encryption.masterkey: true in the opensearch.yml file, and data_source.enabled: true in opensearch_dashboards.yml file.

Hey @NandanIK

Try this.

plugins.query.datasources.encryption.masterkey:  <master_key>
1 Like

Hey @Gsmitt it worked, thanks for the help.

1 Like

Hey can i know how to access this opensearch.yml file and change the masterkey