# License information from the X-Pack plugin could not be obtained from Elasticsearch for the \[data\] cluster. \[security\_exception\] missing authentication credentials for REST request \[/\_xpack\]

**URL:** <https://discuss.elastic.co/t/license-information-from-the-x-pack-plugin-could-not-be-obtained-from-elasticsearch-for-the-data-cluster-security-exception-missing-authentication-credentials-for-rest-request-xpack/184382>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [June 5, 2019, 2:15pm UTC](https://discuss.elastic.co/t/license-information-from-the-x-pack-plugin-could-not-be-obtained-from-elasticsearch-for-the-data-cluster-security-exception-missing-authentication-credentials-for-rest-request-xpack/184382 "2019-06-05T14:15:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![KatiukOleg](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@KatiukOleg](https://discuss.elastic.co/u/KatiukOleg)\
**Post date:** [June 5, 2019, 2:15pm UTC](https://discuss.elastic.co/t/license-information-from-the-x-pack-plugin-could-not-be-obtained-from-elasticsearch-for-the-data-cluster-security-exception-missing-authentication-credentials-for-rest-request-xpack/184382/1 "2019-06-05T14:15:25Z")

</div>

Hi guys, I have some trouble with Elastic and Kibana. I launched them in Azure through Azure Kubernetes Service and was using standard (not oss) images for it. So, Elasticsearch is up and running. I configured passwords for built-in user via elasticsearch-setup-passwords and can access to Elastic from Kibana container with kibana user credentials. But when I'm trying access to Kibana via browser I get - Kibana server is not ready yet. I was looking to logs and find this warning message

```auto
{"type":"log","@timestamp":"2019-06-05T13:37:42Z","tags":["license","warning","xpack"],"pid":1,"message":"License information from the X-Pack plugin could not be obtained from Elasticsearch for the [data] cluster. [security_exception] missing authentication credentials for REST request [/_xpack], with { header={ WWW-Authenticate=\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\" } } :: {\"path\":\"/_xpack\",\"statusCode\":401,\"response\":\"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"security_exception\\\",\\\"reason\\\":\\\"missing authentication credentials for REST request [/_xpack]\\\",\\\"header\\\":{\\\"WWW-Authenticate\\\":\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\"}}],\\\"type\\\":\\\"security_exception\\\",\\\"reason\\\":\\\"missing authentication credentials for REST request [/_xpack]\\\",\\\"header\\\":{\\\"WWW-Authenticate\\\":\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\"}},\\\"status\\\":401}\",\"wwwAuthenticateDirective\":\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\"}"}

```

My elasticdeployment yaml:

```auto
apiVersion: apps/v1
kind: Deployment
metadata:
  name: azure-elasticsearch-prod
spec:
  replicas: 1
  selector:
    matchLabels:
      app: azure-elasticsearch-prod
  template:
    metadata:
      labels:
        app: azure-elasticsearch-prod
    spec:
      containers:
      - name: azure-elasticsearch-prod
        image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
        resources:
          limits:
            memory: 1Gi
            cpu: 1000m
          requests:
            memory: 512Mi
            cpu: 350m
        ports:
        - containerPort: 9200
        - containerPort: 9300
        env:
        - name: bootstrap.memory_lock
          value: "true"
        - name: xpack.security.enabled
          value: "true"
        - name: discovery.type
          value: single-node
        - name: ES_JAVA_OPTS
          value: "-Xms512m -Xmx512m"
        - name: ES_HEAP_SIZE
          value: 2Gi

```

Mu Kibana yaml:

```auto
apiVersion: apps/v1
kind: Deployment
metadata:
  name: azure-kibana-prod
spec:
  replicas: 1
  selector:
    matchLabels:
      app: azure-kibana-prod
  template:
    metadata:
      labels:
        app: azure-kibana-prod
    spec:
      containers:
      - name: azure-kibana-prod
        image: docker.elastic.co/kibana/kibana:7.1.1
        resources:
          requests:
            cpu: 100m
            memory: 256Mi
          limits:
            cpu: 500m
            memory: 512Mi
        ports:
        - containerPort: 5601
        env:
        - name: ELASTICSEARCH_HOSTS        
          value: http://azure-elasticsearch-prod:9200
        - name: xpack.security.enabled
          value: "true"
        - name: xpack.monitoring.enabled
          value: "true"
        - name: xpack.reporting.enabled
          value: "true"
        - name: xpack.reporting.encryptionKey
          value: "myKey"
        - name: elasticsearch.username
          value: kibana
        - name: elasticsearch.password
          value: myPassword
        - name: xpack.monitoring.elasticsearch.username
          value: kibana
        - name: xpack.monitoring.elasticsearch.password
          value: myPassword

```

I'll be thankful for any response

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [June 6, 2019, 5:09am UTC](https://discuss.elastic.co/t/license-information-from-the-x-pack-plugin-could-not-be-obtained-from-elasticsearch-for-the-data-cluster-security-exception-missing-authentication-credentials-for-rest-request-xpack/184382/2 "2019-06-06T05:09:08Z")

</div>

Hi there,

Please use `</>` or (```) to format your post ( the config snippets ). YAML is very sensitive to syntax and it's really hard to see if there is an error or something missing there without the structure being obvious. You can use the preview panel on the right while you edit your answer to see how your post will look like

---

<div class="post-metadata">

**Author:** ![KatiukOleg](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@KatiukOleg](https://discuss.elastic.co/u/KatiukOleg)\
**Post date:** [June 6, 2019, 7:30am UTC](https://discuss.elastic.co/t/license-information-from-the-x-pack-plugin-could-not-be-obtained-from-elasticsearch-for-the-data-cluster-security-exception-missing-authentication-credentials-for-rest-request-xpack/184382/3 "2019-06-06T07:30:30Z")

</div>

Hi Ioannis, thanks for this formatting spot.

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [June 6, 2019, 7:37am UTC](https://discuss.elastic.co/t/license-information-from-the-x-pack-plugin-could-not-be-obtained-from-elasticsearch-for-the-data-cluster-security-exception-missing-authentication-credentials-for-rest-request-xpack/184382/4 "2019-06-06T07:37:05Z")

</div>

```auto
 env:
        - name: ELASTICSEARCH_HOSTS        
          value: http://azure-elasticsearch-prod:9200
        - name: xpack.security.enabled
          value: "true"
        - name: xpack.monitoring.enabled
          value: "true"
        - name: xpack.reporting.enabled
          value: "true"
        - name: xpack.reporting.encryptionKey
          value: "myKey"
        - name: elasticsearch.username
          value: kibana
        - name: elasticsearch.password
          value: myPassword
        - name: xpack.monitoring.elasticsearch.username
          value: kibana
        - name: xpack.monitoring.elasticsearch.password
          value: myPassword

```

Looking at [https://www.elastic.co/guide/en/kibana/current/docker.html#environment-variable-config](https://www.elastic.co/guide/en/kibana/current/docker.html#environment-variable-config) , it would seem that you need to pass all configuration parameters in the format of `ELASTICSEARCH_HOSTS` and not i.e. `xpack.security.enabled`.

This malformed configuration is consistent with what you see as behavior, that is Kibana trying to connect to elasticsearch without a username and password ( as it is not passed `elasticsearch.password` and `elasticsearch.username` that should be `ELASTICSEARCH_PASSWORD` and `ELASTICSEARCH_USERNAME` instead )

---

<div class="post-metadata">

**Author:** ![KatiukOleg](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@KatiukOleg](https://discuss.elastic.co/u/KatiukOleg)\
**Post date:** [June 6, 2019, 9:38am UTC](https://discuss.elastic.co/t/license-information-from-the-x-pack-plugin-could-not-be-obtained-from-elasticsearch-for-the-data-cluster-security-exception-missing-authentication-credentials-for-rest-request-xpack/184382/5 "2019-06-06T09:38:20Z")

</div>

Ioannis, it resolved my problem. Using upper case format help me. Thanks a lot

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 4, 2019, 9:43am UTC](https://discuss.elastic.co/t/license-information-from-the-x-pack-plugin-could-not-be-obtained-from-elasticsearch-for-the-data-cluster-security-exception-missing-authentication-credentials-for-rest-request-xpack/184382/6 "2019-07-04T09:43:31Z")

</div>

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