Missing authentication token for REST error

Hello! I'm getting a missing authentication error and was wondering if anyone can help me.
I'm using version 6.1.1

My code without credentials:

PUT _xpack/watcher/watch/cluster_yellow3
{
  "trigger": {
    "schedule": {
      "interval": "10s"
    }
  },
  "input": {
    "http": {
      "request": {
        "scheme": "http",
        "host": "localhost",
        "port": 9200,
        "method": "GET",
        "path": "/_cluster/health",
        "params": {},
        "headers": {}
      }
    }
  },
  "condition": {
    "compare": {
      "ctx.payload.status": {
        "eq": "yellow"
      }
    }
  },
  "actions": {
    "notify_pager" : {
      "webhook" : {
        "method" : "GET",
        "host" : "ip",
        "port" : 8030,
        "path" : "/TSSparam.do"
      }
    }
  }
}

Error code (result of my simulation):

"error": {
  "root_cause": [
    {
      "type": "security_exception",
      "reason": "missing authentication token for REST request [/_cluster/health?]",
      "header": {
    "WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
      }
    }
  ],

Hello @Miho,

Your /_cluster/health HTTP query is missing authn info. This here is an old answer about the same error.

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