FATAL Error: Unable to complete saved object migrations for the [.kibana] index. TypeError: Cannot read property 'error' of undefined

Hello,
I am trying to install Kibana7.12.0 on a new Win10 laptop that has elasticsearch7.12.0 already installed and running. However, Kibana install fails about halfway giving below fatal error

Any help on this is greatly appreciated

  log   [11:12:54.033] [info][plugins-service] Plugin "osquery" is disabled.
  log   [11:12:54.109] [warning][config][deprecation] Config key [monitoring.cluster_alerts.email_notifications.email_address] will be required for email notifications to work in 8.0."
  log   [11:12:54.309] [info][plugins-system] Setting up [100] plugins: [taskManager,licensing,globalSearch,globalSearchProviders,banners,code,usageCollection,xpackLegacy,telemetryCollectionManager,telemetry,telemetryCollectionXpack,kibanaUsageCollection,securityOss,share,mapsLegacy,newsfeed,kibanaLegacy,translations,legacyExport,embeddable,uiActionsEnhanced,expressions,charts,esUiShared,bfetch,data,home,observability,console,consoleExtensions,apmOss,painlessLab,searchprofiler,grokdebugger,management,indexPatternManagement,advancedSettings,fileUpload,savedObjects,visualizations,visTypeVislib,visTypeVega,visTypeTimelion,features,licenseManagement,watcher,canvas,visTypeTagcloud,visTypeMetric,visTypeTable,visTypeMarkdown,tileMap,regionMap,visTypeXy,graph,timelion,dashboard,dashboardEnhanced,visualize,visTypeTimeseries,inputControlVis,discover,discoverEnhanced,savedObjectsManagement,spaces,security,reporting,savedObjectsTagging,lens,maps,lists,dataEnhanced,encryptedSavedObjects,dashboardMode,cloud,upgradeAssistant,snapshotRestore,fleet,indexManagement,remoteClusters,crossClusterReplication,rollup,indexLifecycleManagement,enterpriseSearch,beatsManagement,transform,ingestPipelines,eventLog,actions,alerts,triggersActionsUi,stackAlerts,ml,securitySolution,case,infra,monitoring,logstash,apm,uptime]
  log   [11:12:54.313] [info][plugins][taskManager] TaskManager is identified by the Kibana UUID: 4d68cfb1-2c77-4ca9-afa9-cd2b55e4c11c
  log   [11:12:54.591] [warning][config][plugins][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.
  log   [11:12:54.592] [warning][config][plugins][security] Session cookies will be transmitted over insecure connections. This is not recommended.
  log   [11:12:54.620] [warning][config][plugins][reporting] Generating a random key for xpack.reporting.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.reporting.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.
  log   [11:12:54.643] [info][config][plugins][reporting] Chromium sandbox provides an additional layer of protection, and is supported for Win32 OS. Automatically enabling Chromium sandbox.
  log   [11:12:54.650] [warning][encryptedSavedObjects][plugins] Saved objects encryption key is not set. This will severely limit Kibana functionality. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.
  log   [11:12:54.662] [warning][fleet][plugins] Fleet APIs are disabled 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.
  log   [11:12:54.719] [warning][actions][actions][plugins] APIs are disabled 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.
  log   [11:12:54.730] [warning][alerting][alerts][plugins][plugins] APIs are disabled 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.
  log   [11:12:54.828] [info][monitoring][monitoring][plugins] config sourced from: production cluster
  log   [11:12:55.008] [info][savedobjects-service] Waiting until all Elasticsearch nodes are compatible with Kibana before starting saved objects migrations...
  log   [11:12:55.084] [info][savedobjects-service] Starting saved objects migrations
  log   [11:12:55.118] [info][savedobjects-service] [.kibana] INIT -> CREATE_NEW_TARGET
  log   [11:12:55.125] [info][savedobjects-service] [.kibana_task_manager] INIT -> CREATE_NEW_TARGET
  log   [11:13:25.122] [error][savedobjects-service] TypeError: Cannot read property 'error' of undefined
    at C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\saved_objects\migrationsv2\actions\index.js:559:22
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at stateActionMachine (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\saved_objects\migrationsv2\state_action_machine.js:63:28)
    at migrationStateActionMachine (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\saved_objects\migrationsv2\migrations_state_action_machine.js:80:24)
    at async Promise.all (index 0)
    at SavedObjectsService.start (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\saved_objects\saved_objects_service.js:163:7)
    at Server.start (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\server.js:283:31)
    at Root.start (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\root\index.js:58:14)
    at bootstrap (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\bootstrap.js:100:5)
    at Command.<anonymous> (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\cli\serve\serve.js:169:5)
  log   [11:13:25.133] [error][savedobjects-service] [.kibana] migration failed, dumping execution log:
  log   [11:13:25.135] [info][savedobjects-service] [.kibana] INIT RESPONSE
  log   [11:13:25.137] [info][savedobjects-service] [.kibana] INIT -> CREATE_NEW_TARGET
  log   [11:13:25.142] [fatal][root] Error: Unable to complete saved object migrations for the [.kibana] index. TypeError: Cannot read property 'error' of undefined
    at migrationStateActionMachine (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\saved_objects\migrationsv2\migrations_state_action_machine.js:148:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 0)
    at SavedObjectsService.start (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\saved_objects\saved_objects_service.js:163:7)
    at Server.start (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\server.js:283:31)
    at Root.start (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\root\index.js:58:14)
    at bootstrap (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\bootstrap.js:100:5)
    at Command.<anonymous> (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\cli\serve\serve.js:169:5)
  log   [11:13:25.145] [info][plugins-system] Stopping all plugins.
  log   [11:13:25.149] [info][kibana-monitoring][monitoring][monitoring][plugins] Monitoring stats collection is stopped
  log   [11:13:25.157] [error][savedobjects-service] TypeError: Cannot read property 'error' of undefined
    at C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\saved_objects\migrationsv2\actions\index.js:559:22
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at stateActionMachine (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\saved_objects\migrationsv2\state_action_machine.js:63:28)
    at migrationStateActionMachine (C:\DATA\TEMP\SoftwareInstallation\kibana-7.12.0-windows-x86_64\src\core\server\saved_objects\migrationsv2\migrations_state_action_machine.js:80:24)
    at async Promise.all (index 1)
  log   [11:13:25.159] [error][savedobjects-service] [.kibana_task_manager] migration failed, dumping execution log:
  log   [11:13:25.160] [info][savedobjects-service] [.kibana_task_manager] INIT RESPONSE
  log   [11:13:25.165] [info][savedobjects-service] [.kibana_task_manager] INIT -> CREATE_NEW_TARGET
  log   [11:13:55.020] [warning][licensing][plugins] License information could not be obtained from Elasticsearch due to Error: Cluster client cannot be used after it has been closed. error
  log   [11:13:55.157] [warning][plugins-system] "eventLog" plugin didn't stop in 30sec., move on to the next.

 **FATAL  Error: Unable to complete saved object migrations for the [.kibana] index. TypeError: Cannot read property 'error' of undefined** 

Hi @elk_usr,

it looks like you're installing Kibana from source. From the log it seems failing at the saved object migrations step: did you have a previous version of Kibana installed before this one?

Hi @Marco_Liberati ,
Thank you for your response. No, I did not have any previous version on this laptop. It is a new/fresh Kibana install as I mentioned in my previous post. What is strange is I tried running 'kibana.bat' again and the error no longer appears! I'm wondering if the 'supposed migration' already took place? Is there a way to check Kibana's health through its webpage to see if everything is normal or is setup how it is supposed to be? I do see Kibana's webpage when I browse to localhost:5601. Thank you once again for your assistance