Unable to start Kibana - Port 5601 already in use

Hello Community -
after i enabled HTTPs on my Kibana Server - i cannot get it to start.
When i review the logs - i see the following error message:

{"type":"log","@timestamp":"2019-10-08T13:04:50Z","tags":["fatal","root"],"pid":14383,"message":"Error: Port 5601 is already in use. Another instance of Kibana may be running!\n at Root.shutdown (/usr/share/kibana/src/core/server/root/index.js:53:26)\n at Root.start (/usr/share/kibana/src/core/server/root/index.js:45:24)\n at process._tickCallback (internal/process/next_tick.js:68:7)\n at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)\n at startup (internal/bootstrap/node.js:283:19)\n at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)"

So i checked which PID is using that Port:

[root@kibanaserver kibana]# lsof -i :5601
[root@kibanaserver kibana]#

So there is no process active on this Port - why can't it bind to it then?

I check if there was another Process of Kibana Running:

[root@kibanaserver kibana]# ps aux | grep kibana
root     17751  0.0  0.0   9088   672 pts/0    S+   10:00   0:00 grep --color=auto kibana
[root@kibanaserver kibana]# kill -9 17751
bash: kill: (17751) - No such process
[root@kibanaserver kibana]# ps aux | grep kibana
root     17897  0.0  0.0   9088   668 pts/0    S+   10:01   0:00 grep --color=auto kibana

as you can see the process is being forked as soon as i kill it - can anybody help me? I don't know how to get rid of that Error.

I'm using CentOS7 with Kibana (as well as Elasticsearch) v7.6.

Thanks in advance!

After i outcommented the following settings in Kibana.yml it started normally again:

#server.ssl.enabled: true
#server.ssl.certificate: /etc/kibana/certs/kibana-server.csr
#server.ssl.key: /etc/kibana/certs/kibana-server.key

Why are they causing the error? Any ideas?

Ok i actually saw that there are no recent logs written to the file - so there seems to be a whole other Problem -

Apr 02 11:14:20 mykibana kibana[30287]: {"type":"log","@timestamp":"2020-04-02T09:14:20Z","tags":["fatal","root"],"pid":30287,"message":"Error: error:0909006C:PEM routines:get_name:no start line\n    at Object.createSecureContext (_tls_common.js:135:17)\n    at Server (_tls_wrap.js:873:27)\n    at new Server (http
Apr 02 11:14:20 mykibana kibana[30287]: FATAL  Error: error:0909006C:PEM routines:get_name:no start line

The process your are trying to kill in your original post is just the grep command looking for the string "kibana" - it basically finds itself.

From your config it looks like you are using the wrong certificate format. Make sure to pass it in as a pem file. You can find more info here: https://www.elastic.co/guide/en/kibana/current/configuring-tls.html

Hey @flash1293 thanks for your reply.

I indeed did use the wrong one - i simply forgot to sign the csr with my ca.

to generate my Kibana Certificate i used and edited version of:

bin/elasticsearch-certutil csr -name kibana-server -dns some-website.com,www.some-website.com

A week ago i setup encryption on my Elasticsearch cluster - how do i use the CA which i created there to sign the csr?

Or can i simply go with the

bin/elasticsearch-certutil cert --ca my-kibana.p12

then transform the outcome to .pem and use that one instead?

I've solved it by generating a new self-signed certificate via the OpenSSL Command and copying the .pem and the private key to config folder. After that i edited the kibana.yml file and restarted the service.

Now it's encrypted.

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