Error In Kibana After Upgrade to 9.x

HI Team,

After upgrading kibana from 8.x to 9.x , we are experiencing below error in kibana log file. Due to which the stack monitoring we are not able to perform.

{"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.11.0"},"@timestamp":"2025-06-03T07:11:54.346-04:00","message":"Unable to create alerts client because the Encrypted Saved Objects plugin is missing encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.","error":{"message":"Unable to create alerts client because the Encrypted Saved Objects plugin is missing encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.","type":"Error","stack_trace":"Error: Unable to create alerts client because the Encrypted Saved Objects plugin is missing encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.\n at Object.getRulesClientWithRequest (/usr/share/kibana/node_modules/@kbn/alerting-plugin/server/plugin.js:375:15)\n at Object.getRulesClient (/usr/share/kibana/node_modules/@kbn/monitoring-plugin/server/plugin.js:282:41)\n at getClustersFromRequest (/usr/share/kibana/node_modules/@kbn/monitoring-plugin/server/lib/cluster/get_clusters_from_request.js:106:37)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at Object.handler (/usr/share/kibana/node_modules/@kbn/monitoring-plugin/server/routes/api/v1/cluster/clusters.js:49:26)\n at handler (/usr/share/kibana/node_modules/@kbn/monitoring-plugin/server/plugin.js:324:28)\n at handle (/usr/share/kibana/node_modules/@kbn/core-http-router-server-internal/src/route.js:126:26)\n at handler (/usr/share/kibana/node_modules/@kbn/core-http-router-server-internal/src/route.js:47:14)\n at Router.handle (/usr/share/kibana/node_modules/@kbn/core-http-router-server-internal/src/router.js:127:30)\n at handler (/usr/share/kibana/node_modules/@kbn/core-http-router-server-internal/src/router.js:113:52)\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:370:32)\n at Request._execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:280:9)"},"log":{"level":"ERROR","logger":"plugins.monitoring.monitoring"},"process":{"pid":3134604,"uptime":252.565289742},"trace":{"id":"c39657ca22c69df162838ba23f391450"},"transaction":{"id":"3ec8fb472784b7be"}}

Please advise on the above error.

Note:- Currently both Elastic and kibana is upgraded to 9.x.

Thanks,
Debasis

Where you using security before as well or enabled after migration?

Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command

Have you checked this? Does the setting exists on kibana.yml ?

@leandrojmp Thanks for the reply. We do not added any security related features in kibana before upgrade. We had only added certificate from Elasticsearch and currently it is mentioned in kibana,yml and the file also present physically in the location.

# authority for your Elasticsearch instance.
elasticsearch.ssl.certificateAuthorities: [ "/etc/kibana/http_ca.crt" ]

Please let us know if anything is missing.

Thanks,
Debasis

Hi Team,

Could you please help on the above issue. Kibana is up and running and able to query through dev console also but getting error while navigate to stack monitoring section.

Thanks,
Debasis

I'm not sure exactly what is the issue, but did you do what it is asking?

Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command

Just add this setting as mentioned in the documentation and restart Kibana to see if it works.

Let me generate the keys and update in kibana.yml . I will update in case of any issues.

Thanks,
Debasis