Skip to content

[Bug] When setting up a development environment, if elasticsearch.host is misconfigured it does not catch error #52572

@P1llus

Description

@P1llus

Tested on newest master revision of kibana: 32ab00be5c3519955d91ac79d4818ac944ce07eb
First time when forking the kibana repository, after running yarn kbn bootstrap and want to run yarn start you might get this error:

$ node --trace-warnings --throw-deprecation scripts/kibana --dev
  log   [22:17:22.363] [warning][plugins-discovery] Explicit plugin paths [D:\Projects\kibana\x-pack] are only supported in development. Relative imports will not work in production.
  log   [22:17:22.922] [info][plugins-service] Plugin "endpoint" is disabled.
  log   [22:17:22.956] [warning][legacy-plugins] Unable to scan directory for plugins "D:\Projects\kibana\plugins"
  log   [22:17:29.702] [info][plugins-service] Plugin initialization disabled.
  log   [22:17:29.881] [fatal][root] TypeError: Cannot read property 'properties' of undefined
    at assertIsSupportedIndex (D:\Projects\kibana\src\core\server\saved_objects\migrations\core/elastic_index.ts:284:32)
    at fetchInfo (D:\Projects\kibana\src\core\server\saved_objects\migrations\core/elastic_index.ts:60:10)
    at process._tickCallback (internal/process/next_tick.js:68:7)

 FATAL  TypeError: Cannot read property 'properties' of undefined

This happens because it is assumed that fetchInfo will always return an amount of indicies. If the elasticsearch.host is misconfigured or the username/password applied is wrong however, it will break like this.

It might be wise to apply a pre-check before running fetchInfo or catch the error somehow here:
https://github.com/elastic/kibana/blob/master/src/core/server/saved_objects/migrations/core/elastic_index.ts#L43

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:Saved ObjectsTeam:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions