Kibana server is not ready yet after upgrade 6.4 to 6.5

@Guillain your problem looks related with the optimization process itself and not with the kibana indices.

We have made several improvements on this matter that will come along by 6.6.x and 6.7.x .
Meanwhile I believe the best workaround to deal with optimization stalls would be:

  1. Stop kibana.
  2. Set the current directory to the Kibana installation dir. (For example cd /usr/share/kibana )
  3. rm -rf optimize/bundles
  4. NODE_OPTIONS="--max-old-space-size=4096" ./bin/kibana
  5. Kibana should optimize and start normally

If, otherwise, your problem were related with the kibana indices, you can find more info on the following thread: https://github.com/elastic/kibana/issues/25806