License Expired

Recently I have faced issue with ElasticSearch License, I am getting below listed error while restarting, I had basic account.

2018-07-27T10:01:57,936][ERROR][o.e.x.s.a.f.SecurityActionFilter] [aYBc70q] blocking [cluster:monitor/stats] operation due to expired license. Cluster health, cluster stats and indices stats
operations are blocked on license expiration. All data operations (read and write) continue to work.
If you have a new license, please update it. Otherwise, please reach out to your support contact.
[2018-07-27T10:01:57,937][ERROR][o.e.x.m.c.c.ClusterStatsCollector] [aYBc70q] collector [cluster_stats] failed to collect data
org.elasticsearch.ElasticsearchSecurityException: current license is non-compliant for [security]

Below are the list of plugins installed.

[2018-07-27T09:57:03,310][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [aggs-matrix-stats]
[2018-07-27T09:57:03,310][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [analysis-common]
[2018-07-27T09:57:03,311][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [ingest-common]
[2018-07-27T09:57:03,311][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [lang-expression]
[2018-07-27T09:57:03,312][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [lang-mustache]
[2018-07-27T09:57:03,312][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [lang-painless]
[2018-07-27T09:57:03,312][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [mapper-extras]
[2018-07-27T09:57:03,313][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [parent-join]
[2018-07-27T09:57:03,313][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [percolator]
[2018-07-27T09:57:03,313][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [rank-eval]
[2018-07-27T09:57:03,314][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [reindex]
[2018-07-27T09:57:03,314][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [repository-url]
[2018-07-27T09:57:03,314][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [transport-netty4]
[2018-07-27T09:57:03,315][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [tribe]
[2018-07-27T09:57:03,315][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-core]
[2018-07-27T09:57:03,316][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-deprecation]
[2018-07-27T09:57:03,316][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-graph]
[2018-07-27T09:57:03,317][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-logstash]
[2018-07-27T09:57:03,317][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-ml]
[2018-07-27T09:57:03,318][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-monitoring]
[2018-07-27T09:57:03,318][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-rollup]
[2018-07-27T09:57:03,319][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-security]
[2018-07-27T09:57:03,319][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-sql]
[2018-07-27T09:57:03,319][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-upgrade]
[2018-07-27T09:57:03,320][INFO ][o.e.p.PluginsService ] [aYBc70q] loaded module [x-pack-watcher]

Below is the error which I am getting in elasaticsearch kibana

[data] Elasticsearch cluster did not respond with license information.

xpack license is empty.
curl -X GET "localhost:9200/_xpack/license"
{ }

Please help in this.

What version of Elasticsearch are you running?

What output do you get from this command?

curl -uelastic -XGET "http://localhost:9200/_xpack?pretty"

curl -XGET "http://localhost:9200/_xpack?pretty"
{
"build" : {
"hash" : "eb782d0",
"date" : "2018-06-29T22:03:21.668624Z"
},
"license" : null,
"features" : {
"graph" : {
"description" : "Graph Data Exploration for the Elastic Stack",
"available" : false,
"enabled" : true
},
"logstash" : {
"description" : "Logstash management component for X-Pack",
"available" : false,
"enabled" : true
},
"ml" : {
"description" : "Machine Learning for the Elastic Stack",
"available" : false,
"enabled" : true,
"native_code_info" : {
"version" : "6.3.1",
"build_hash" : "4d0b8f0a0ef401"
}
},
"monitoring" : {
"description" : "Monitoring for the Elastic Stack",
"available" : false,
"enabled" : true
},
"rollup" : {
"description" : "Time series pre-aggregation and rollup",
"available" : false,
"enabled" : true
},
"security" : {
"description" : "Security for the Elastic Stack",
"available" : false,
"enabled" : true
},
"watcher" : {
"description" : "Alerting, Notification and Automation for the Elastic Stack",
"available" : false,
"enabled" : true
}
},
"tagline" : "You know, for X"
}

The most likely cause for a null license is that the node you are connecting to is unable to establish a connection with the master node.

What is the output from this:

curl -uelastic -XGET 'http://localhost:9200/_cluster/health?pretty'

(if your node is disconnected from the cluster, then that might take 30 seconds and then respond with an error)

What does the log file (elasticsearch.log) say?

{
"error" : {
"root_cause" : [
{
"type" : "security_exception",
"reason" : "current license is non-compliant for [security]",
"license.expired.feature" : "security"
}
],
"type" : "security_exception",
"reason" : "current license is non-compliant for [security]",
"license.expired.feature" : "security"
},
"status" : 403
}

Actually I am running single node, so this is master himself.
So, how can I add license and which, cause I don't have any license, Can you share any basic/free license if possible.

That is not necessarily true, it depends on your configuration.

At the moment we're trying to work out what is preventing your node from generating a license.
And for that you need to answer my questions - you haven't provided the details from the logfile that I asked for:

I would like to share logs with you but, it says alot, I am not sure what to share.
I have around 32k lines.

[2018-07-27T12:08:06,457][ERROR][o.e.x.s.a.f.SecurityActionFilter] [aYBc70q] blocking [cluster:monitor/stats] operation due to expired license. Cluster health, cluster stats and indices stats
operations are blocked on license expiration. All data operations (read and write) continue to work.
If you have a new license, please update it. Otherwise, please reach out to your support contact.
[2018-07-27T12:08:06,458][ERROR][o.e.x.m.c.c.ClusterStatsCollector] [aYBc70q] collector [cluster_stats] failed to collect data
org.elasticsearch.ElasticsearchSecurityException: current license is non-compliant for [security]

[2018-07-27T12:08:40,290][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [aYBc70q] Failed to clear cache for realms []
[2018-07-27T12:08:40,325][INFO ][o.e.l.LicenseService ] [aYBc70q] license [TOMBSTONE] mode [trial] - valid
[2018-07-27T12:08:40,330][WARN ][o.e.l.LicenseService ] [aYBc70q] LICENSE [EXPIRED] ON [THURSDAY, JANUARY 01, 1970].

IF YOU HAVE A NEW LICENSE, PLEASE UPDATE IT. OTHERWISE, PLEASE REACH OUT TO

YOUR SUPPORT CONTACT.

COMMERCIAL PLUGINS OPERATING WITH REDUCED FUNCTIONALITY

- security

- Cluster health, cluster stats and indices stats operations are blocked

- All data operations (read and write) continue to work

- watcher

- PUT / GET watch APIs are disabled, DELETE watch API continues to work

- Watches execute and write to the history

- The actions of the watches don't execute

- monitoring

- The agent will stop collecting cluster and indices metrics

- The agent will stop automatically cleaning indices older than [xpack.monitoring.history.duration]

- graph

- Graph explore APIs are disabled

- ml

- Machine learning APIs are disabled

- logstash

- Logstash will continue to poll centrally-managed pipelines

- deprecation

- Deprecation APIs are disabled

- upgrade

- Upgrade API is disabled

- sql

- SQL support is disabled

- rollup

- Creating and Starting rollup jobs will no longer be allowed.

- Stopping/Deleting existing jobs, RollupCaps API and RollupSearch continue to function.

2018-07-27T12:08:42,009][ERROR][o.e.x.s.a.f.SecurityActionFilter] [aYBc70q] blocking [cluster:monitor/stats] operation due to expired license. Cluster health, cluster stats and indices stats
operations are blocked on license expiration. All data operations (read and write) continue to work.
If you have a new license, please update it. Otherwise, please reach out to your support contact.
[2018-07-27T12:08:42,012][ERROR][o.e.x.m.c.c.ClusterStatsCollector] [aYBc70q] collector [cluster_stats] failed to collect data
org.elasticsearch.ElasticsearchSecurityException: current license is non-compliant for [security]

[2018-07-27T12:09:00,215][ERROR][o.e.x.s.a.f.SecurityActionFilter] [aYBc70q] blocking [cluster:monitor/nodes/stats] operation due to expired license. Cluster health, cluster stats and indices stats
operations are blocked on license expiration. All data operations (read and write) continue to work.
If you have a new license, please update it. Otherwise, please reach out to your support contact.
[2018-07-27T12:09:00,219][WARN ][o.e.c.InternalClusterInfoService] [aYBc70q] Failed to execute NodeStatsAction for ClusterInfoUpdateJob
org.elasticsearch.ElasticsearchSecurityException: current license is non-compliant for [security]

Can you provide you config file (elasticsearch.yml)?

From the looks of it, you deleted your license.
Is that correct?

If so, I'll need to see what we can do to get you back up and running.

#======================== Elasticsearch Configuration =========================

#NOTE: Elasticsearch comes with reasonable defaults for most settings.
#Before you set out to tweak and tune the configuration, make sure you
#understand what are you trying to accomplish and the consequences.

#The primary way of configuring a node is via this file. This template lists
#the most important settings you may want to configure for a production cluster.

#Please consult the documentation for further information on configuration options:
#Elasticsearch Guide | Elastic

#---------------------------------- Cluster -----------------------------------

#Use a descriptive name for your cluster:

#cluster.name: my-application

#------------------------------------ Node ------------------------------------

#Use a descriptive name for the node:

#node.name: node-1

#Add custom attributes to the node:

#node.attr.rack: r1

#----------------------------------- Paths ------------------------------------

#Path to directory where to store the data (separate multiple locations by comma):

path.data: /var/lib/elasticsearch

#Path to log files:

path.logs: /var/log/elasticsearch

#----------------------------------- Memory -----------------------------------

#Lock the memory on startup:

#bootstrap.memory_lock: true

#Make sure that the heap size is set to about half the memory available
#on the system and that the owner of the process is allowed to use this
#limit.

elasticsearch performs poorly when the system is swapping the memory.

#---------------------------------- Network -----------------------------------

#Set the bind address to a specific IP (IPv4 or IPv6):

#network.host: 192.168.0.1

#Set a custom port for HTTP:

#http.port: 9200

#For more information, consult the network module documentation.

#--------------------------------- Discovery ----------------------------------

#Pass an initial list of hosts to perform discovery when new node is started:
#The default list of hosts is ["127.0.0.1", "[::1]"]

#discovery.zen.ping.unicast.hosts: ["host1", "host2"]

#Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):

#discovery.zen.minimum_master_nodes:

#For more information, consult the zen discovery module documentation.

#---------------------------------- Gateway -----------------------------------

#Block initial recovery after a full cluster restart until N nodes are started:

#gateway.recover_after_nodes: 3

#For more information, consult the gateway module documentation.

#---------------------------------- Various -----------------------------------

#Require explicit names when deleting indices:

#action.destructive_requires_name: true
#threadpool.search.queue_size: 10000
xpack.security.enabled: false

Yes I may be removed using curl -X DELETE but not sure.
Any way I can recover that or add new ?

Don't do that.

If you don't need the data on this cluster any more, then you can just delete everything (the data/ directory) start over, and it will regenerate the license.

Otherwise you need to explicitly start a new basic license with:

curl -uelastic -XPOST 'http://localhost:9200/_xpack/license/start_basic'
1 Like

Thanks alot, it resolved my issue.

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