Login is currently disabled because the license could not be determined. Please check that Elasticsearch has the X-Pack plugin installed and is reachable

please help,I recently Installed x-pack to the elk server and i am getting license is currently disabled error and i checked the x-pack it is in trial version and the license is still active.
root@niconet04:/usr/share/kibana/bin# ./kibana
log [20:41:59.036] [info][status][plugin:kibana@5.6.8] Status changed from uninitialized to green - Ready
log [20:41:59.208] [info][status][plugin:elasticsearch@5.6.8] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [20:41:59.278] [info][status][plugin:xpack_main@5.6.8] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [20:41:59.340] [info][status][plugin:graph@5.6.8] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [20:41:59.365] [info][status][plugin:monitoring@5.6.8] Status changed from uninitialized to green - Ready
log [20:41:59.693] [warning][reporting] Generating a random key for xpack.reporting.encryptionKey. To prevent pending reports from failing on restart, please set xpack.reporting.encryptionKey in kibana.yml
log [20:41:59.706] [info][status][plugin:reporting@5.6.8] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [20:41:59.800] [info][status][plugin:security@5.6.8] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [20:41:59.801] [warning][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
log [20:41:59.864] [warning][security] Session cookies will be transmitted over insecure connections. This is not recommended.
log [20:42:00.010] [info][status][plugin:searchprofiler@5.6.8] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [20:42:00.019] [info][status][plugin:ml@5.6.8] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [20:42:00.088] [error][status][plugin:xpack_main@5.6.8] Status changed from yellow to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.096] [error][status][plugin:graph@5.6.8] Status changed from yellow to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.102] [error][status][plugin:reporting@5.6.8] Status changed from yellow to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.107] [error][status][plugin:security@5.6.8] Status changed from yellow to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.108] [error][status][plugin:searchprofiler@5.6.8] Status changed from yellow to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.113] [error][status][plugin:ml@5.6.8] Status changed from yellow to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.128] [error][status][plugin:elasticsearch@5.6.8] Status changed from yellow to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.139] [info][status][plugin:ml@5.6.8] Status changed from red to green - Ready
log [20:42:00.151] [error][status][plugin:tilemap@5.6.8] Status changed from uninitialized to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.157] [error][status][plugin:watcher@5.6.8] Status changed from uninitialized to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.198] [info][status][plugin:grokdebugger@5.6.8] Status changed from uninitialized to green - Ready
log [20:42:00.205] [error][status][plugin:upgrade@5.6.8] Status changed from uninitialized to red - Elasticsearch is still initializing the kibana index.
log [20:42:00.266] [info][status][plugin:console@5.6.8] Status changed from uninitialized to green - Ready
log [20:42:00.290] [info][status][plugin:metrics@5.6.8] Status changed from uninitialized to green - Ready
log [20:42:00.827] [info][status][plugin:timelion@5.6.8] Status changed from uninitialized to green - Ready
log [20:42:00.930] [fatal] Port 5601 is already in use. Another instance of Kibana may be running!
FATAL Port 5601 is already in use. Another instance of Kibana may be running!

That is not what the error actually says:

the license could not be determined.
Please check that Elasticsearch ... is reachable

This indicates that Kibana cannot connect to Elasticsearch.
Something about your config is incorrect.

The problem in this log is that Kibana is already running. It has nothing to do with the license.

Hi

I have another issue when i am trying to access elastic search from another machine i am getting refused connection error and i tried to change the host to global and restarted the elastic search and after one minute it is failed to start and i changed the host to 0.0.0.0, i am getting the same error so i changed it to local it is working fine.Please advice?

I suspect you are running into Elasitcsearch's Bootstrap Checks. Please check the elasticsearch logs.

I see from your original post that you are using version 5.6.8 - that's a very old version, and is no longer supported. If this is a new project then I would strongly recommend you install a newer version such as 7.2.

Are there any steps to upgrade all the three (kibana,elastic search,logstash) i am using 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux