Kibana custom plugin 7.13.3 installation fails

Hello,

I am upgrading my elasticstack from version 7.9.2 to 7.13.3. I checked my plugin with the development environment I created for kibana 7.13.3. it works fine. now I need to add that plugin to my windows elasticstack and I think I found a way to Install that plugin.

According to this link above, first I need to run the following.

$ bin/kibana-plugin install file:///local/path/to/custom_plugin.zip

But when I run this it gives following errors.

Attempting to transfer from file:///C:/ELK7.13.3/kibana-7.13.3/plugins/myplugin.zip
Transferring 37053422 bytes....................
Transfer complete
Retrieving metadata from plugin archive
Plugin installation was unsuccessful due to error "No kibana plugins found in archive"

Has anyone seen this error before?

Thanks in advance!

Hey there! So I was looking through the code for the kibana-plugin CLI tool and it looks like it's trying to find a kibana.json file within the archive. Can you confirm that that exists within the root directory of the archive?

Hello @poff ,

yes, there is a kibana.json file within the root directory of the archive.

And following are the contents of the kibana.json file.

{
  "id": "myplugin",
  "version": "1.0.0",
  "kibanaVersion": "kibana",
  "server": true,
  "ui": true,
  "requiredPlugins": ["navigation"],
  "optionalPlugins": []
}

Thanks for helping me!

Any thoughts? anyone?

Hello,

How are you current building your plugin for production? You should be able to run yarn build from your plugin's directory if it was generated with our tooling. This will produce a fully built plugin that looks like:

image

I do see that you do not have a package.json file so this may not work for you. I'd recommend either generating a new plugin (node scripts/generate_plugin from the Kibana repository) and copying your code into it or adding a package.json file with these contents:

{
  "name": "my-plugin",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "yarn plugin-helpers build",
    "plugin-helpers": "node ../../scripts/plugin_helpers",
    "kbn": "node ../../scripts/kbn"
  }
}

Hello @joshdover,

Thanks for replying. So I have created development environment for kibana 7.13.3 using development guide. then I created a plugin called myplugin with following command.

node scripts/generate_plugin my_plugin_name # replaced "my_plugin_name" with my custom plugin name that I was already using with version 7.9.2.

Then I ran elasticsearch and Kibana dev. Everything worked alright. so I changed the plugin with my original plugin and It still works. so, that means my plugin is compatible with version 7.13.3.
The structure of plugin created by generate_plugin script is same as my custom plugin that I already have.

Then I downloaded ELK 7.13.3 for windows and ran the script to install the plugin.

Now, what I added package.json to my plugin as you said but now it gives following error.

C:\ELK7.13.3\kibana-7.13.3\bin>kibana-plugin install file:///C:/TEMP/myplugin.zip
Found previous install attempt. Deleting...
Attempting to transfer from file:///C:/TEMP/myplugin.zip
Transferring 27055 bytes....................
Transfer complete
Retrieving metadata from plugin archive
Extracting plugin archive
Extraction complete
Plugin installation was unsuccessful due to error "Plugin myplugin[kibana] is incompatible with Kibana [7.13.3]"

This is not supposed to happend. because the same plugin is compatible with the development environment. why not compatible with regular environment?

Thanks.

Try updating the version in your kibana.json file to 7.13.3. I believe that should help.

Hi @joshdover,

I generated the plugin again, added data from my old plugin and changed the version to 7.13.3 in kibana.json. checked with development version and it is compatible and the new structure is like following.

but it still gives me the same errors

Found previous install attempt. Deleting...
Attempting to transfer from file:///C:/TEMP/myplugin.zip
Transferring 36888369 bytes....................
Transfer complete
Retrieving metadata from plugin archive
Extracting plugin archive
Extraction complete
Plugin installation was unsuccessful due to error "Plugin myplugin[kibana] is incompatible with Kibana [7.13.3]"

Is there any way to get more information on what is happening or what is incompatible?

Thanks,

any thoughts? @tsullivan @tiagocosta

@Akhil2 could you please post the file contents present both on kibana.json and package.json inside your myplugin.zip?

Cheers

Hello @tiagocosta,

Here it is.

Kibana.json

{
  "id": "myplugin",
  "version": "7.13.3",
  "kibanaVersion": "kibana",
  "server": true,
  "ui": true,
  "requiredPlugins": ["navigation"],
  "optionalPlugins": []
}

package.json

{
  "name": "myplugin",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "yarn plugin-helpers build",
    "plugin-helpers": "node ../../scripts/plugin_helpers",
    "kbn": "node ../../scripts/kbn"
  }
}

Thanks

Hello,

anyone? @tiagocosta @joshdover @poff

I have been stuck with this from long time. is there any other way I can try?

Thanks.

@Akhil2 could you try to setup your plugin's kibana.json and package.json as the following:

{
  "id": "myplugin",
  "kibanaVersion": "kibana",
  "server": true,
  "ui": true,
  "requiredPlugins": ["navigation"],
  "optionalPlugins": []
}
{
  "name": "myplugin",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "build": "yarn plugin-helpers build",
    "plugin-helpers": "node ../../scripts/plugin_helpers",
    "kbn": "node ../../scripts/kbn"
  }
}

After this just run yarn build on your plugin cwd and just try to install it again.

Cheers

Hello @tiagocosta,

I changed the plugin's kibana.json and package.json and tried to run yarn build in development version. but it gave me following errors.

$ yarn build
yarn run v1.21.1
$ node scripts/build --all-platforms
 info [  global  ] Verifying environment meets requirements
   │ succ Node.js version verified
   │ succ ✓ 0 sec

 info [  global  ] Cleaning artifacts from previous builds
   │ debg Deleting patterns: [
   │        'C:\\TEMP\\kibana-development\\developed-kibana\\kibana\\build',
   │        'C:\\TEMP\\kibana-development\\developed-kibana\\kibana\\target',
   │        'C:\\TEMP\\kibana-development\\developed-kibana\\kibana\\.node_binaries'
   │      ]
   │ debg Deleted 1 files/directories
   │ succ ✓ 0 sec

 info [  global  ] Downloading node.js builds for all platforms
   │ debg Downloading shasum values for node version 14.17.2 from https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v14.17.2/SHASUMS256.txt
   │ERROR failure 0 sec
   │ERROR Error: getaddrinfo ENOTFOUND us-central1-elastic-kibana-184716.cloudfunctions.net
   │          at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:26)

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

Thanks

@Akhil2 where are you running the yarn build command? In order to build the plugin you should run the command in the cwd of the plugin not in the kibana repo one.

Cheers

it is working now. thank you for being patient @tiagocosta and help me get this working.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.