Error: ENOENT: no such file or directory.....Kibana docker failed to start

I'm trying to load kibana.yml version 7.5.2 with Dockerfile in Windows10. It fails to read file located in directory.
Error:

{"type":"log","@timestamp":"2020-03-27T11:01:51Z","tags":["fatal","root"],"pid":6,"message":"{ Error: ENOENT: no such file or directory, open 'D:\\\\ELK-certs\\\\kibana.crt'\n    at Object.openSync (fs.js:439:3)\n    at readFileSync (fs.js:344:35)\n    at getServerOptions (/usr/share/kibana/src/core/server/http/http_tools.js:77:34)\n    at HttpServer.setup (/usr/share/kibana/src/core/server/http/http_server.js:72:60)\n    at HttpService.runNotReadyServer (/usr/share/kibana/src/core/server/http/http_service.js:140:26)\n    at HttpService.setup (/usr/share/kibana/src/core/server/http/http_service.js:60:18)\n  errno: -2,\n  syscall: 'open',\n  code: 'ENOENT',\n  path: 'D:\\\\\\\\ELK-certs\\\\\\\\kibana.crt' }"}

 FATAL  Error: ENOENT: no such file or directory, open 'D:\\ELK-certs\\kibana.crt'

Kibana.yml file:

server.name: "kibana"
server.host: "app-vm2-ssl"
server.ssl.enabled: true
elasticsearch.hosts: ["https://app-vm2-ssl.company.com:9200","https://app-vm1-ssl.company.com:9200"]
elasticsearch.username: "kibana"
elasticsearch.password: "111111"
elasticsearch.ssl.certificateAuthorities: ["D:\\ELK-certs\\DigiCert Global Root CA.pem", "D:\\ELK-certs\\DigiCert SHA2 Secure Server CA.pem"]
server.ssl.key: D:\\ELK-certs\\companyPrivateKey.pem
server.ssl.certificate: D:\\ELK-certs\\kibana.crt

Docker file:

FROM docker.elastic.co/kibana/kibana:7.5.2
ADD kibana.yml /usr/share/kibana/config/kibana.yml
EXPOSE 5601

As Kibana runs within the container, it doesn't know anything about your host file system.

Either mount the certificate files when running docker or ADD it to the image itself and then reference it in the yml file using the path in the container file system - e.g. if you mount it via -v D:\\ELK-certs\\companyPrivateKey.pem:/myKey.pem:ro, then in kibana.yml you have to reference it like server.ssl.key: /myKey.pem.

1 Like

Thanks @flash1293. I am able to copy now with the ADD approach.

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