Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
P1llus opened this issue Dec 9, 2019 · 2 comments
Labels
Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@P1llus
Copy link
Member

P1llus commented Dec 9, 2019

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

@P1llus P1llus changed the title [Bug] When setting up a development environment, if elasticsearch.host is misconfigured it does catch error [Bug] When setting up a development environment, if elasticsearch.host is misconfigured it does not catch error Dec 10, 2019
@timroes timroes added Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Dec 10, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@rudolf
Copy link
Contributor

rudolf commented Feb 21, 2020

Was your elasticsearch.host pointing to an old version of Elasticsearch? If so this should be fixed by #51311

Failure on an authentication misconfiguration should be fixed by #51324

Please re-open if you're still seeing this behaviour.

@rudolf rudolf closed this as completed Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

4 participants