# {"statusCode":503,"error":"Service Unavailable","message":"License is not available."}

**URL:** <https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741>\
**Category:** Kibana\
**Created:** [June 12, 2023, 7:20am UTC](https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741 "2023-06-12T07:20:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![R1d3rBG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/r1d3rbg/32/125307_2.png) [@R1d3rBG](https://discuss.elastic.co/u/R1d3rBG)\
**Post date:** [June 12, 2023, 7:20am UTC](https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741/1 "2023-06-12T07:20:34Z")

</div>

Hello,

I have installed Elastic, but after 2-3 days stops working with the following error.  
{"statusCode":503,"error":"Service Unavailable","message":"License is not available."}  
Could you help me with investigation why its happaning ?

cat /etc/redhat-release  
CentOS Linux release 7.9.2009 (Core)  
bin/kibana --version  
8.6.2  
bin/elasticsearch --version  
Version: 8.6.2, Build: rpm/2d58d0f136141f03239816a4e360a8d17b6d8f29/2023-02-13T09:35:20.314882762Z, JVM: 19.0.2

---

<div class="post-metadata">

**Author:** ![bhavya2810](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavya2810/32/122037_2.png) [@bhavya2810](https://discuss.elastic.co/u/bhavya2810)\
**Post date:** [June 12, 2023, 8:32am UTC](https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741/2 "2023-06-12T08:32:24Z")

</div>

> [@R1d3rBG](#):
>
> {"statusCode":503,"error":"Service Unavailable","message":"License is not available."}

I also got this error when my actual elastic url was `https://localhost:9200` and I set `http://localhost:9200` in kibana.yml.  
If you have SSH enabled in elasticsearch, check the url in `kibana.yml` and it should be https and `https`.  
On the other side there can be other reasons to this. I have mentioned my case in which i got this error.

---

<div class="post-metadata">

**Author:** ![R1d3rBG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/r1d3rbg/32/125307_2.png) [@R1d3rBG](https://discuss.elastic.co/u/R1d3rBG)\
**Post date:** [June 12, 2023, 12:23pm UTC](https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741/3 "2023-06-12T12:23:06Z")

</div>

Thanks for your reply.

No, I didnt change it to https, I'm using http.  
After rebooting of the machine works fine for several hours, but it fails in the end.  
I'm able to see this error in kibana logs:

"License is not available, authentication is not possible.","log":{"level":"ERROR","logger":"plugins.security.authentication"},"process":{"pid":2414},"trace":{"id":"f447e50c1e57107daa15e35cd6939541"},"transaction":{"id":"8468a3a52ea55e95"}}

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 12, 2023, 12:30pm UTC](https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741/4 "2023-06-12T12:30:23Z")

</div>

> [@R1d3rBG](#):
>
> "License is not available, authentication is not possible.","log":{"level":"ERROR","logger":"plugins.security.authentication"},"process":{"pid":2414},"trace":{"id":"f447e50c1e57107daa15e35cd6939541"},"transaction":{"id":"8468a3a52ea55e95"}}

This means that there is some issue for Kibana to talk with Elasticsearch.

What is the result of a curl to your elasticsearch server from the kibana machine?

`curl http://your-elastic-ip:9200`

---

<div class="post-metadata">

**Author:** ![R1d3rBG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/r1d3rbg/32/125307_2.png) [@R1d3rBG](https://discuss.elastic.co/u/R1d3rBG)\
**Post date:** [June 12, 2023, 12:38pm UTC](https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741/5 "2023-06-12T12:38:09Z")

</div>

Hello,

with that command

```auto
curl http://myiphere:9200
{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","ApiKey"]}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","ApiKey"]}},"status":401}

```

```auto
curl -u kibana_system:mypasswordhere http://myiphere:9200
{
  "name" : "elk01",
  "cluster_name" : "elk",
  "cluster_uuid" : "EW9pYnYfRLq5HKV5KXZ6JQ",
  "version" : {
    "number" : "8.6.2",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "2d58d0f136141f03239816a4e360a8d17b6d8f29",
    "build_date" : "2023-02-13T09:35:20.314882762Z",
    "build_snapshot" : false,
    "lucene_version" : "9.4.2",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

```

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 12, 2023, 12:50pm UTC](https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741/6 "2023-06-12T12:50:18Z")

</div>

Are Kibana and Elastic running on the same server?

If this request was from the Kibana server then it can talk to Elastic without any issues.

Did you change the default configuration? Per default version 8 will enable security and https, since you have http something was changed.

Can you share both your `elasticsearch.yml` and `kibana.yml`.

Also, share the logs of your Elasticsearch for the same time frame when you have the error in Kibana.

---

<div class="post-metadata">

**Author:** ![R1d3rBG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/r1d3rbg/32/125307_2.png) [@R1d3rBG](https://discuss.elastic.co/u/R1d3rBG)\
**Post date:** [June 12, 2023, 1:41pm UTC](https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741/7 "2023-06-12T13:41:52Z")

</div>

Yes, both are running and it works fine for a few hours after rebooting the machine.  
Here is kibana.yml. I removed all unnecessary comments#

```auto
server.port: 5601
server.host: "myipishere"
server.name: "еlk01"
elasticsearch.hosts: ["http://myipishere:9200"]
elasticsearch.username: "kibana_system"
elasticsearch.password: "mypasswordhere"
logging:
  appenders:
    file:
      type: file
      fileName: /var/log/kibana/kibana.log
      layout:
        type: json
  root:
    appenders:
      - default
      - file
pid.file: /run/kibana/kibana.pid

```

here is the elastic.yml

```auto
cluster.name: bgelk
node.name: elk01
path.logs: /var/log/elasticsearch
network.host: ["localhost", "myipishere"]
http.port: 9200
discovery.type: single-node
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
  enabled: false
  keystore.path: certs/http.p12
xpack.security.transport.ssl:
  enabled: false
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
http.host: 0.0.0.0

```

I have cleared the log because it was huge and hard to read. I will paste it once the issue is reproduced again.

---

<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 10, 2023, 1:42pm UTC](https://discuss.elastic.co/t/statuscode-503-error-service-unavailable-message-license-is-not-available/335741/8 "2023-07-10T13:42:35Z")

</div>

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