Open K1vs opened 1 year ago
Pinging @elastic/platform-deployment-management (Team:Deployment Management)
guys this is a serious bug !!!
We cannot secure properly elasticsearch stack and use kibana devtools, all Kibana stuff are OK.
(ECK 2.9 / Kibana 8.8.1 / Licence)
Pinging @elastic/kibana-management (Team:Kibana Management)
Kibana version: <=8.8.0
Elasticsearch version: any
Server OS version: any
Browser version: any
Browser OS version: any
Original install method (e.g. download page, yum, from source, etc.): k8s https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-kibana.html
Describe the bug: Http and https hosts not supported for console plugin proxy together. And although the configuration is created for each host separately, the agent is created based on the first host in the list. Which will result in an ERR_INVALID_PROTOCOL error if there are hosts with different protocols in the list of hosts.
https://github.com/elastic/kibana/blob/main/src/plugins/console/server/lib/elasticsearch_proxy_config.ts#L17
https://github.com/elastic/kibana/blob/main/src/plugins/console/server/routes/api/console/proxy/create_handler.ts#L68
Steps to reproduce:
Expected behavior: Succesfull using dev tools with second host (http://bhost.dev).
Screenshots (if relevant):
Errors in browser console (if relevant):
Provide logs and/or server output (if relevant): [2023-05-31T10:07:20.011+00:00][ERROR][plugins.console] Error: connect ECONNREFUSED 10.2.0.202:9200 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) [2023-05-31T10:07:20.012+00:00][ERROR][plugins.console] TypeError: Protocol "http:" not supported. Expected "https:" at new NodeError (node:internal/errors:387:5) at new ClientRequest (node:_http_client:186:11) at Object.request (node:http:97:10) at Object.request (/usr/share/kibana/node_modules/elastic-apm-node/lib/instrumentation/http-shared.js:224:21) at proxyRequest (/usr/share/kibana/node_modules/@kbn/console-plugin/server/lib/proxy_request.js:54:22) at /usr/share/kibana/node_modules/@kbn/console-plugin/server/routes/api/console/proxy/create_handler.js:135:55 at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Router.handle (/usr/share/kibana/node_modules/@kbn/core-http-router-server-internal/src/router.js:149:30)
at handler (/usr/share/kibana/node_modules/@kbn/core-http-router-server-internal/src/router.js:115:50)
at exports.Manager.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
at Object.internals.handler (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)
at exports.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)
at Request._lifecycle (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:371:32)
at Request._execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:281:9)
[2023-05-31T10:07:20.014+00:00][WARN ][plugins.console] Could not connect to any configured ES node
Any additional context: I don't need both protocols in the hosts, but the https host is automatically added first when deployed to k8s. Why this addition happens is not clear to me, but it does not interfere with the work of other kibana functionality, but because of the bug described above, it turned out to be critical for the console.