I facing this issue when we update kibana from 7.10.2 to 7.17.7. It is kind of strange behavior, there is a nginx proxy in between.
{"type":"log","@timestamp":"2022-11-29T13:32:08+00:00","tags":["error","http"],"pid":28043,
"message":"TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable,
Promise, Array, or Iterable.\n at Object.exports.subscribeTo (/usr/share/kibana/node_modules/rxjs/internal/util/subscribeTo.js:29:15)\n
at from (/usr/share/kibana/node_modules/rxjs/internal/observable/from.js:11:58)\n
at map$ (/usr/share/kibana/node_modules/@kbn/std/target_node/iteration/observable.js:33:25)\n
at Object.getResponseStream (/usr/share/kibana/src/plugins/bfetch/server/plugin.js:68:31)\n
at /usr/share/kibana/src/plugins/bfetch/server/plugin.js:58:62\n
at /usr/share/kibana/src/core/server/context/container/context.js:62:16\n
at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n
at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:163:30)\n
at handler (/usr/share/kibana/src/core/server/http/router/router.js:124:50)\n
at exports.Manager.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)\n
at Object.internals.handler (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)\n
at exports.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)\n
at Request._lifecycle (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:371:32)\n
at Request._execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:281:9)"}
{"type":"error","@timestamp":"2022-11-29T13:32:08+00:00","tags":[],"pid":28043,"level":"error","error":{"message":"Internal Server Error",
"name":"Error","stack":"Error: Internal Server Error\n at HapiResponseAdapter.toInternalError
(/usr/share/kibana/src/core/server/http/router/response_adapter.js:61:19)\n
at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:172:34)\n
at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n
at handler (/usr/share/kibana/src/core/server/http/router/router.js:124:50)\n at exports.Manager.execute
(/usr/share/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)\n at Object.internals.handler
(/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)\n
at exports.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)\n
at Request._lifecycle (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:371:32)\n
at Request._execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:281:9)"},
"url":"http://localhost:5601/internal/bsearch?compress=true","message":"Internal Server Error"}
{"type":"response","@timestamp":"2022-11-29T13:32:08+00:00","tags":[],"pid":28043,"method":"post","statusCode":500,"req":{"url":"/internal/bsearch?compress=true","method":"post","headers":{"kbn-version":"7.17.7","content-type":"text/plain; charset=UTF-8","content-length":"670","host":"localhost:5601","accept":"*/*","user-agent":"AHC/2.1"},"remoteAddress":"127.0.0.1","userAgent":"AHC/2.1"},"res":{"statusCode":500,"responseTime":126,"contentLength":97},"message":"POST /internal/bsearch?compress=true 500 126ms - 97.0B"}