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

Error when running Kibana in dev mode (plugin creation) #41683

Closed
synapticiel opened this issue Jul 22, 2019 · 8 comments · Fixed by #41741
Closed

Error when running Kibana in dev mode (plugin creation) #41683

synapticiel opened this issue Jul 22, 2019 · 8 comments · Fixed by #41741

Comments

@synapticiel
Copy link

@synapticiel synapticiel commented Jul 22, 2019

Kibana version: 8 (master)

Elasticsearch version: 8 (master)

Original install method (e.g. download page, yum, from source, etc.): yarn start

Describe the bug: when running yarn start

Steps to reproduce:
1.
2.
3.

Expected behavior:

Screenshots (if relevant):

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Any additional context:

yarn start
yarn run v1.16.0
$ node --trace-warnings --trace-deprecation scripts/kibana --dev
log [17:57:40.639] [warning][plugins-discovery] Explicit plugin paths [D:\kibana_dev\kibana\x-pack] are only supported in development. Relative imports will not work in production.
log [17:57:40.709] [info][plugins-service] Plugin initialization disabled. watching for changes (4460 files)
log [17:57:44.075] [info][server] basepath proxy server running at http://localhost:5601/ygz
optmzr log [17:57:50.025] [warning][plugins-discovery] Explicit plugin paths [D:\kibana_dev\kibana\x-pack] are only supported in development. Relative imports will not work in production.
server log [17:57:50.051] [warning][plugins-discovery] Explicit plugin paths [D:\kibana_dev\kibana\x-pack] are only supported in development. Relative imports will not work in production.
optmzr log [17:57:50.109] [info][plugins-service] Plugin initialization disabled.
server log [17:57:50.133] [info][plugins-system] Setting up [4] plugins: [security,testbed,translations,data]
server log [17:57:50.137] [info][plugins][security] Setting up plugin
server log [17:57:50.142] [warning][config][plugins][security] Session cookies will be transmitted over insecure connections. This is not recommended.
server log [17:57:50.263] [info][plugins][testbed] Setting up plugin
server log [17:57:50.266] [info][plugins][translations] Setting up plugin
server log [17:57:50.268] [info][data][plugins] Setting up plugin
server log [17:57:50.273] [info][plugins-system] Starting [4] plugins: [security,testbed,translations,data]
optmzr log [17:57:54.464] [fatal][root] Error: Failed to parse .i18nrc.json file at D:\kibana_dev\kibana\plugins\kibana_plugin.i18nrc.json at getTranslationPaths (D:\kibana_dev\kibana\src\legacy\server\i18n/get_translations_path.js:42:13)

FATAL Error: Failed to parse .i18nrc.json file at D:\kibana_dev\kibana\plugins\kibana_plugin.i18nrc.json

server log [17:57:54.504] [fatal][root] Error: Failed to parse .i18nrc.json file at D:\kibana_dev\kibana\plugins\kibana_plugin.i18nrc.json at getTranslationPaths (D:\kibana_dev\kibana\src\legacy\server\i18n/get_translations_path.js:42:13)
server log [17:57:54.513] [info][plugins-system] Stopping all plugins.
server log [17:57:54.516] [info][data][plugins] Stopping plugin
server log [17:57:54.518] [info][plugins][translations] Stopping plugin
server log [17:57:54.520] [info][plugins][testbed] Stopping plugin
server log [17:57:54.523] [info][plugins][security] Stopping plugin

FATAL Error: Failed to parse .i18nrc.json file at D:\kibana_dev\kibana\plugins\kibana_plugin.i18nrc.json

server crashed with status code 1
optimizer crashed with status code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@tylersmalley

This comment has been minimized.

Copy link
Member

@tylersmalley tylersmalley commented Jul 22, 2019

Also posted here: https://discuss.elastic.co/t/kibana-failed-to-start-after-creating-a-new-plugin/191685

@Bamieh, would you mind taking a look here?

@elasticmachine

This comment has been minimized.

Copy link
Contributor

@elasticmachine elasticmachine commented Jul 22, 2019

@tylersmalley tylersmalley added the bug label Jul 23, 2019
@Bamieh

This comment has been minimized.

Copy link
Member

@Bamieh Bamieh commented Jul 23, 2019

The only way I was able to reproduce this is by having a malformed .i18nrc.json file in a custom plugin. Can you guide me with the steps to reproduce?

  • a fresh kibana install runs normally
  • a kibana instance with a custom plugin with no .i18nrc.json file runs normally
  • a kibana instance with a custom plugin with a valid .i18nrc.json file runs normally.
@Bamieh Bamieh self-assigned this Jul 23, 2019
@synapticiel

This comment has been minimized.

Copy link
Author

@synapticiel synapticiel commented Jul 23, 2019

I tried to create a new plugin using node scripts/generate_plugin
When the plugin has been created, then i runned yarn start and got the error

@Bamieh

This comment has been minimized.

Copy link
Member

@Bamieh Bamieh commented Jul 23, 2019

Thanks for reporting this, I've been able to reproduce. Missing a translations array in the .i18nrc.json file throws this error. I've submitted a PR for the fix.

@sergibondarenko

This comment has been minimized.

Copy link

@sergibondarenko sergibondarenko commented Oct 2, 2019

@Bamieh @elastic/kibana-stack-services
Now I have the same error with Kibana v7.4.0.

$ rm -rf optimize/bundles/* && yarn start --oss
yarn run v1.16.0
$ node --trace-warnings --trace-deprecation scripts/kibana --dev  --oss
  log   [13:16:13.199] [info][plugins-service] Plugin initialization disabled.
 watching for changes  (4748 files)
  log   [13:16:13.700] [info][server] basepath proxy server running at http://localhost:5601/zwa
optmzr    log   [13:16:15.662] [info][plugins-service] Plugin initialization disabled.
server    log   [13:16:15.675] [info][plugins-system] Setting up [3] plugins: [testbed,inspector,data]
server    log   [13:16:15.681] [info][plugins][testbed] Setting up plugin
server    log   [13:16:15.682] [info][data][plugins] Setting up plugin
server    log   [13:16:15.684] [info][plugins-system] Starting [2] plugins: [testbed,data]
server    log   [13:16:16.766] [warning][config][deprecation] csp.rules no longer supports the {nonce} syntax. Replacing with 'self' in script-src
optmzr    log   [13:16:16.767] [warning][config][deprecation] csp.rules no longer supports the {nonce} syntax. Replacing with 'self' in script-src
server    log   [13:16:17.049] [fatal][root] Error: Failed to parse .i18nrc.json file at /Users/sergiibondarenko/Development/kibana/kibana/plugins/aplugin/.i18nrc.json
    at getTranslationPaths (/Users/sergiibondarenko/Development/kibana/kibana/src/legacy/server/i18n/get_translations_path.js:42:13)
optmzr    log   [13:16:17.049] [fatal][root] Error: Failed to parse .i18nrc.json file at /Users/sergiibondarenko/Development/kibana/kibana/plugins/aplugin/.i18nrc.json
    at getTranslationPaths (/Users/sergiibondarenko/Development/kibana/kibana/src/legacy/server/i18n/get_translations_path.js:42:13)
server    log   [13:16:17.054] [info][plugins-system] Stopping all plugins.
server    log   [13:16:17.054] [info][data][plugins] Stopping plugin
server    log   [13:16:17.054] [info][plugins][testbed] Stopping plugin

 FATAL  Error: Failed to parse .i18nrc.json file at /Users/sergiibondarenko/Development/kibana/kibana/plugins/aplugin/.i18nrc.json


 FATAL  Error: Failed to parse .i18nrc.json file at /Users/sergiibondarenko/Development/kibana/kibana/plugins/aplugin/.i18nrc.json

 optimizer crashed  with status code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The aplugin is the default generated plugin https://www.elastic.co/guide/en/kibana/current/development-plugin-resources.html#_plugin_generator

@sergibondarenko

This comment has been minimized.

Copy link

@sergibondarenko sergibondarenko commented Oct 2, 2019

The .i18nrc.json file

$ cat plugins/aplugin/.i18nrc.json 
{
  "paths": {
    "aplugin": "./"
  }
}
@Bamieh

This comment has been minimized.

Copy link
Member

@Bamieh Bamieh commented Oct 2, 2019

It seems the fix was not backported to 7.4 only to 7.x. Will fix it now. Thanks for reporting this. We've added integration tests for next releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.