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

[cli/plugins] plugin installation format requirement and errors #74909

Open
spalger opened this issue Aug 12, 2020 · 7 comments
Open

[cli/plugins] plugin installation format requirement and errors #74909

spalger opened this issue Aug 12, 2020 · 7 comments
Labels
discuss Team:Operations Team label for Operations Team

Comments

@spalger
Copy link
Contributor

spalger commented Aug 12, 2020

When installing a Kibana plugin that was created by zipping a directory in the root plugins/ directory, the CLI produces a somewhat cryptic error:

"No kibana plugins found in archive"

This is because we identify a plugin by finding files which match the pattern: kibana/*/kibana.json. We should probably improve the error message and maybe remove the restriction that they exist in a kibana directory, but we should consult with other teams to see how they structure their plugins as we may be breaking cross-compatibility if we make any changes here.

@spalger spalger added discuss Team:Operations Team label for Operations Team labels Aug 12, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@bababrownbear
Copy link

bababrownbear commented Aug 13, 2020

I'm having this issue currently, I've tried zipping the plugin from the root plugins folder, and I've run yarn build on a plugin I created with the plugin generator. A screenshot of the source and the build output is below. I manually placed the kibana.json into this directly, and manually created the kibana folder for the plugin, but when I attempt to install the plugin I get "No kibana plugins found in archive."

Source folder
image
Build zip
image
Install fails
image

I've been unsuccessful debugging the issue for why this build output won't install.

If I place just the output in the plugins folder with the added kibana.json, like this:
image

I get something went wrong when trying to load Kibana.
image

@spalger
Copy link
Contributor Author

spalger commented Aug 13, 2020

Hey @bababrownbear, I'm working on updating the kibana-helpers tooling for building Kibana Platform plugins right now. Keep an eye on #66687 for updates. The plugin zip you create should more closely resemble the plugin you have in plugins/ss_update_index and should have it's own target/public directory. The kibana.json file you have for development is the one that should be in the distributable.

When you create the zip of the plugins/ss_update_index directory make sure it is within a kibana directory. The plugin installer looks for kibana.json files in kibana/*/kibana.json.

@bababrownbear
Copy link

@spalger Thank you! Still having troubles though.
This is the zip I created:
image
It's my plugin inside of a kibana folder. Kibana.json is within kibana/*/kibana.json.

image
I ran the plugin install for the zip, and it still said 'No kibana plugins found in archive.'.

@spalger
Copy link
Contributor Author

spalger commented Aug 14, 2020

Ah, didn't realize you are using tools from an installation. The changes to look for kibana.json are in #74604, which hasn't shipped yet and are slotted to ship with 7.10.

To use then in development you need to use node scripts/kibana_plugin instead of bin/kibana-plugin.

@bababrownbear
Copy link

Thank you for the insight. Is there a way to get my plugin to be installable on 7.8.0 then? Or I can only use this in development?

@spalger
Copy link
Contributor Author

spalger commented Aug 15, 2020

For 7.8 you need to use the legacy plugin format. That means using a package.json file and a kibana.json file at the same time. The package.json file doesn't need to include much, but I think it does need to have a "name", and "version" (which needs to match the Kibana version you're targeting). Kibana 7.8 should identify that your plugin is using the Kibana Platform because it has a kibana.json file. Additionally, you might find it easier to just extract your plugin into the plugins directory by hand until we revampt the tooling for KP support in 7.10.

If just adding a package.json file to your plugin doesn't work you might want to try generating a new plugin in 7.7 or 7.8 and then adding your specific plugin code to the generated plugin.

@tylersmalley tylersmalley added 1 and removed 1 labels Oct 11, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Feb 16, 2022
@exalate-issue-sync exalate-issue-sync bot removed the loe:small Small Level of Effort label Mar 2, 2022
@tylersmalley tylersmalley removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. EnableJiraSync labels Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

4 participants