# My plugin will build and install, but kibana wont run

**URL:** <https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126>\
**Category:** Kibana\
**Created:** [January 7, 2020, 8:33pm UTC](https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126 "2020-01-07T20:33:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![McKittrick\_Kaminski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mckittrick_kaminski/32/59595_2.png) [@McKittrick\_Kaminski](https://discuss.elastic.co/u/McKittrick_Kaminski)\
**Post date:** [January 7, 2020, 8:33pm UTC](https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126/1 "2020-01-07T20:33:18Z")

</div>

I'm developing a plugin with Kibana v7.5.1, and I have it in a state where I want to build the plugin and install it into a docker container, and recommit the container and save it to my private registry.  
All of these steps works just fine

```bash
yarn kbn bootstrap
yarn start # for development
yarn build

```

builds just fine, then trying to install and run, the following steps are actually in a Dockerfile, but behave the same done this way.

```bash
docker run --rm -it --name kb docker.elastic.co/kibana/kibana:7.5.1 bash

```

In another shell:

```bash
docker cp /path/to/built/plugin.zip kb:/plugin.zip

```

back in kibana container

```bash
bin/kibana-plugin install file:///plugin.zip
... # installs just fine
bin/kibana

```

the `bin/kibana` command will give me the following output:  
`FATAL Error: Cannot find module '/usr/share/kibana/plugins/myPlugin'`

`plugins/myPlugin` exists, and has my code in it. Why cant it be found?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 8, 2020, 5:08pm UTC](https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126/2 "2020-01-08T17:08:12Z")

</div>

Hi, it looks to me like you're using the right steps to make this Docker image.

- Have you tried running your plugin in "dist" mode before this? Instead of `yarn start` give this a try: `node scripts/kibana --config=config/kibana.dev.yml` and see if Kibana can run with your plugin in non-dev mode.

- Can you include more of the error message? I want to see if there is a stack trace that is pointing to the problem

---

<div class="post-metadata">

**Author:** ![McKittrick\_Kaminski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mckittrick_kaminski/32/59595_2.png) [@McKittrick\_Kaminski](https://discuss.elastic.co/u/McKittrick_Kaminski)\
**Post date:** [January 8, 2020, 5:37pm UTC](https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126/3 "2020-01-08T17:37:11Z")

</div>

So when I run the container, the follow log gets dumped:

> Error: Cannot find module '/usr/share/kibana/plugins/cadence'  
> at Function.Module.\_resolveFilename (internal/modules/cjs/loader.js:581:15)  
> at Function.Module.\_load (internal/modules/cjs/loader.js:507:25)  
> at Module.require (internal/modules/cjs/loader.js:637:17)  
> at require (internal/modules/cjs/helpers.js:22:18)  
> at createPack (/usr/share/kibana/src/legacy/plugin\_discovery/plugin\_pack/create\_pack.js:33:18)  
> at MapSubscriber.packageJson$.pipe [as project] (/usr/share/kibana/src/legacy/plugin\_discovery/plugin\_pack/create\_pack.js:66:11)  
> at MapSubscriber.\_next (/usr/share/kibana/node\_modules/rxjs/internal/operators/map.js:46:35)  
> at MapSubscriber.Subscriber.next (/usr/share/kibana/node\_modules/rxjs/internal/Subscriber.js:64:18)  
> at RefCountSubscriber.Subscriber.\_next (/usr/share/kibana/node\_modules/rxjs/internal/Subscriber.js:87:26)  
> at RefCountSubscriber.Subscriber.next (/usr/share/kibana/node\_modules/rxjs/internal/Subscriber.js:64:18)  
> at Subject.next (/usr/share/kibana/node\_modules/rxjs/internal/Subject.js:57:25)  
> at ConnectableSubscriber.Subscriber.\_next (/usr/share/kibana/node\_modules/rxjs/internal/Subscriber.js:87:26)  
> at ConnectableSubscriber.Subscriber.next (/usr/share/kibana/node\_modules/rxjs/internal/Subscriber.js:64:18)  
> at DistinctSubscriber.\_finalizeNext (/usr/share/kibana/node\_modules/rxjs/internal/operators/distinct.js:70:30)  
> at DistinctSubscriber.\_useKeySelector (/usr/share/kibana/node\_modules/rxjs/internal/operators/distinct.js:64:14)  
> at DistinctSubscriber.\_next (/usr/share/kibana/node\_modules/rxjs/internal/operators/distinct.js:48:18) code: 'MODULE\_NOT\_FOUND'

Followed by a couple lines saying its stopping other (builtin) plugins, then by:

```auto
 FATAL Error: Cannot find module '/usr/share/kibana/plugins/cadence'

```

For running the `node scripts/kibana --config path/to/config`, Everything starts fine. Browsing to [my.kibana.url.com/status](http://my.kibana.url.com/status) shows my plugin is GREEN

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 10, 2020, 10:13pm UTC](https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126/4 "2020-01-10T22:13:44Z")

</div>

I'm sorry but I'm really not sure what's going wrong. It's hard to say without access to the code.

> [@McKittrick\_Kaminski](#):
>
> Followed by a couple lines saying its stopping other (builtin) plugins, then by:
> 
> ```auto
> FATAL Error: Cannot find module '/usr/share/kibana/plugins/cadence'
> 
> ```

Just a wild guess, but there is an `index.js` file in this path, correct? One thing to check is that Typescript conversion is happening properly, if that's applicable.

---

<div class="post-metadata">

**Author:** ![McKittrick\_Kaminski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mckittrick_kaminski/32/59595_2.png) [@McKittrick\_Kaminski](https://discuss.elastic.co/u/McKittrick_Kaminski)\
**Post date:** [January 14, 2020, 2:43pm UTC](https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126/5 "2020-01-14T14:43:35Z")

</div>

Actually, yeah. Thanks for pointing that out. I am using typescript everywhere, including the index.ts. When I unpack the .zip, there is no index.js next to the node\_modules.

All other files in the server code is correctly compiled down from typescript to js.

I just checked, and if I change index. **ts** to index. **js** , index.js will now be in the package after I build it.

After installing, it looks like Kibana will run, but I do not see my plugin at the moment. I'll continue investigating later today.

---

<div class="post-metadata">

**Author:** ![McKittrick\_Kaminski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mckittrick_kaminski/32/59595_2.png) [@McKittrick\_Kaminski](https://discuss.elastic.co/u/McKittrick_Kaminski)\
**Post date:** [January 15, 2020, 8:50pm UTC](https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126/6 "2020-01-15T20:50:09Z")

</div>

So changing index.ts to index.js has the plugin working now. This looks like a bug, and I'll make an issue on the kibana repo.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 15, 2020, 9:21pm UTC](https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126/7 "2020-01-15T21:21:16Z")

</div>

I'm glad to hear we figured it out! Thanks for filing the bug for tracking

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 12, 2020, 9:21pm UTC](https://discuss.elastic.co/t/my-plugin-will-build-and-install-but-kibana-wont-run/214126/8 "2020-02-12T21:21:19Z")

</div>

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