# Plugin Build Errors

**URL:** <https://community.graylog.org/t/plugin-build-errors/3128>\
**Category:** Development\
**Created:** [November 10, 2017, 3:45pm UTC](https://community.graylog.org/t/plugin-build-errors/3128 "2017-11-10T15:45:52Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradleykite](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bradleykite](https://community.graylog.org/u/bradleykite)\
**Post date:** [November 10, 2017, 3:45pm UTC](https://community.graylog.org/t/plugin-build-errors/3128/1 "2017-11-10T15:45:52Z")

</div>

Hi there,

I’ve been trying to build 2.3 from source but I’m running into some npm or node issues.

The main graylog2-server builds just fine, but all plugins fail with

```auto
[ERROR] sh: webpack: command not found

```

If I manually copy graylog2-server/graylog2-web-interface/node\_modules/\* (which includes webpack and the other dependencies such as react) into graylog-plugin-map-widget/node\_modules/ (or what ever plugin I’m trying to build) then it builds OK

So it seems like somehow the plugins are not inheriting the dependencies of the main web interface properly?

When I do a build of 2.2 then all plugins compile successfully. I’ve also tried 2.4 and master and they also fail, while 2.2 succeeds.

---

<div class="post-metadata">

**Author:** ![edmundo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/edmundo/32/2161_2.png) [@edmundo](https://community.graylog.org/u/edmundo)\
**Post date:** [November 10, 2017, 4:24pm UTC](https://community.graylog.org/t/plugin-build-errors/3128/2 "2017-11-10T16:24:04Z")

</div>

Hi @bradleykite,

Could you please provide the steps you took to compile both graylog2-server and the plugins?

Regards,  
Edmundo

---

<div class="post-metadata">

**Author:** ![bradleykite](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bradleykite](https://community.graylog.org/u/bradleykite)\
**Post date:** [November 10, 2017, 4:29pm UTC](https://community.graylog.org/t/plugin-build-errors/3128/3 "2017-11-10T16:29:02Z")

</div>

Hi,

Yes - see below.

# graylog2-server compiles OK

cd graylog2-server  
mvn install

```auto
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Graylog Parent POM ................................ SUCCESS [9.003s]
[INFO] Graylog Project Parent POM ........................ SUCCESS [19.965s]
[INFO] AutoValue JavaBean extension ...................... SUCCESS [41.606s]
[INFO] Graylog ........................................... SUCCESS [7:57.426s]
[INFO] integration-tests ................................. SUCCESS [13.692s]
[INFO] Graylog Plugin Parent POM ......................... SUCCESS [0.003s]
[INFO] Graylog Plugin with Web support Parent POM ........ SUCCESS [0.894s]
[INFO] graylog-plugin-archetype .......................... SUCCESS [24.772s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9:47.630s
[INFO] Finished at: Fri Nov 10 15:42:53 GMT 2017
[INFO] Final Memory: 45M/497M
[INFO] ------------------------------------------------------------------------

```

cd ../graylog-plugin-map-widget  
mvn install

```auto
[WARNING] npm WARN react-leaflet@0.10.2 requires a peer of react@^0.14.0 || ^15.0.0-rc.1 but none was installed.
[WARNING] npm WARN react-leaflet@0.10.2 requires a peer of react-dom@^0.14.0 || ^15.0.0-rc.1 but none was installed.
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.0.17 (node_modules/graylog-web-plugin/node_modules/fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
[INFO] 
[INFO] --- frontend-maven-plugin:1.4:npm (npm run build) @ graylog-plugin-map-widget ---
[INFO] Running 'npm run build' in /home/bradley/git/new-build/graylog-project-repos/graylog-plugin-map-widget
[INFO] 
[INFO] > MapWidget@2.3.0-SNAPSHOT build /home/bradley/git/new-build/graylog-project-repos/graylog-plugin-map-widget
[INFO] > webpack --bail
[INFO] 
[ERROR] sh: webpack: command not found
[ERROR] 
[ERROR] npm ERR! Linux 4.13.9-200.fc26.x86_64
[ERROR] npm ERR! argv "/home/bradley/git/new-build/graylog-project-repos/graylog-plugin-map-widget/node/node" "/home/bradley/git/new-build/graylog-project-repos/graylog-plugin-map-widget/node/node_modules/npm/bin/npm-cli.js" "run" "build"
[ERROR] npm ERR! node v6.9.2
[ERROR] npm ERR! npm v4.0.3
[ERROR] npm ERR! file sh
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno ENOENT
[ERROR] npm ERR! syscall spawn
[ERROR] npm ERR! MapWidget@2.3.0-SNAPSHOT build: `webpack --bail`
[ERROR] npm ERR! spawn ENOENT
[ERROR] npm ERR! 
[ERROR] npm ERR! Failed at the MapWidget@2.3.0-SNAPSHOT build script 'webpack --bail'.
[ERROR] npm ERR! Make sure you have the latest version of node.js and npm installed.
[ERROR] npm ERR! If you do, this is most likely a problem with the MapWidget package,
[ERROR] npm ERR! not with npm itself.
[ERROR] npm ERR! Tell the author that this fails on your system:
[ERROR] npm ERR! webpack --bail
[ERROR] npm ERR! You can get information on how to open an issue for this project with:
[ERROR] npm ERR! npm bugs MapWidget
[ERROR] npm ERR! Or if that isn't available, you can get their info via:
[ERROR] npm ERR! npm owner ls MapWidget
[ERROR] npm ERR! There is likely additional logging output above.
[ERROR] 
[ERROR] npm ERR! Please include the following file with any support request:
[ERROR] npm ERR! /home/bradley/git/new-build/graylog-project-repos/graylog-plugin-map-widget/npm-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:00.002s
[INFO] Finished at: Fri Nov 10 15:44:56 GMT 2017
[INFO] Final Memory: 24M/143M
[INFO] ------------------------------------------------------------------------

```

---

<div class="post-metadata">

**Author:** ![edmundo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/edmundo/32/2161_2.png) [@edmundo](https://community.graylog.org/u/edmundo)\
**Post date:** [November 10, 2017, 5:08pm UTC](https://community.graylog.org/t/plugin-build-errors/3128/4 "2017-11-10T17:08:42Z")

</div>

You are right that `mvn install` behaves differently in the server and plugins. It looks like the plugins’ `mvn install` does not take care of installing `node`, `npm`, and other JS dependencies. You can generate those resources by running `mvn generate-resources` once after your server is compiled. Also keep in mind that both projects should live in the same directory and have the same version for this task to succeed.

Anyway, if you take a look at the readme file in [graylog-plugin-map-widget](https://github.com/Graylog2/graylog-plugin-map-widget):

> Run `mvn package` to build a JAR file.

What do you want to accomplish? In that way I can tell you a bit more on which way I would solve the issue.

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [November 10, 2017, 5:16pm UTC](https://community.graylog.org/t/plugin-build-errors/3128/5 "2017-11-10T17:16:32Z")

</div>

Which system user are you using to compile Graylog?

---

<div class="post-metadata">

**Author:** ![bradleykite](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bradleykite](https://community.graylog.org/u/bradleykite)\
**Post date:** [November 13, 2017, 9:41am UTC](https://community.graylog.org/t/plugin-build-errors/3128/6 "2017-11-13T09:41:14Z")

</div>

edmundo, I’ve tried running “mvn generate-resources” in the graylog2-server project (where it succeeds) - and in the graylog-plugin-map-widget project, where it also fails with “[ERROR] sh: webpack: command not found”.

jochen,

I’m running Fedora 26. On the same system, a clean checkout of 2.2 (and all plugins) work just fine.

---

<div class="post-metadata">

**Author:** ![edmundo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/edmundo/32/2161_2.png) [@edmundo](https://community.graylog.org/u/edmundo)\
**Post date:** [November 13, 2017, 9:59am UTC](https://community.graylog.org/t/plugin-build-errors/3128/7 "2017-11-13T09:59:03Z")

</div>

@bradleykite: would you be so kind as to repeat the `mvn generate-resources` in the map-widget project after removing the `node` folder in that same directory? And please include the whole log of the command if it fails. In that way we can see if any step was skipped for some reason.

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [November 13, 2017, 10:04am UTC](https://community.graylog.org/t/plugin-build-errors/3128/8 "2017-11-13T10:04:28Z")

</div>

> [@bradleykite](#):
>
> I’m running Fedora 26. On the same system, a clean checkout of 2.2 (and all plugins) work just fine.

And which system user are you using to compile Graylog?

---

<div class="post-metadata">

**Author:** ![bradleykite](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bradleykite](https://community.graylog.org/u/bradleykite)\
**Post date:** [November 13, 2017, 10:22am UTC](https://community.graylog.org/t/plugin-build-errors/3128/9 "2017-11-13T10:22:21Z")

</div>

jochen - sorry I mis-read your previous question - I’m running as a normal user (not root) - “bradley” in this case.

edmundo, I have removed the node and node\_modules directory and re-run “mvn generate-resources” - the full log is available here:

[https://pastebin.com/GQXzkx6d](https://pastebin.com/GQXzkx6d)

## Regards

Brad.

---

<div class="post-metadata">

**Author:** ![bradleykite](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bradleykite](https://community.graylog.org/u/bradleykite)\
**Post date:** [November 21, 2017, 10:28am UTC](https://community.graylog.org/t/plugin-build-errors/3128/10 "2017-11-21T10:28:09Z")

</div>

Hi there,

I’m still really stuck with this - I’m not overly familiar with maven and/or npm/nodejs etc so dont really know where else to go with this.

Any help will be much appreciated!

## Regards

Brad.

---

<div class="post-metadata">

**Author:** ![bradleykite](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bradleykite](https://community.graylog.org/u/bradleykite)\
**Post date:** [December 4, 2017, 10:03am UTC](https://community.graylog.org/t/plugin-build-errors/3128/11 "2017-12-04T10:03:03Z")

</div>

Hi

I am still not able to make any progress when building plugins for 2.3.

If there is anything I can do or if anyone has any pointers then please let me know, I’d be more than willing to try them.

Plugins for 2.2 build just fine using the same build process so I think I must be missing a step that is required for 2.3?

Thanks in advance for any help that anyone can offer.

–  
Brad.

---

<div class="post-metadata">

**Author:** ![edmundo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/edmundo/32/2161_2.png) [@edmundo](https://community.graylog.org/u/edmundo)\
**Post date:** [December 4, 2017, 1:44pm UTC](https://community.graylog.org/t/plugin-build-errors/3128/12 "2017-12-04T13:44:25Z")

</div>

Hi @bradleykite,

I tried to reproduce this issue again, this time in an empty Vagrant box to ensure there was no local state making the build working for me. I used Ubuntu 16.04 as base, but I don’t think that would make a big difference.

In the end all I did in the box was install git, maven, openjdk8 (for simplicity), and python 2.7. I could build successfully `graylog2-server` and `graylog-plugin-map-widget`, both version 2.2 and 2.3. I didn’t even need to run the generate-resources task to get the build done.

As I’m not able to reproduce this issue I can only give you some guesses or even long shots:

1. Do you do something special with npm in your bash profile? I would try running the build using a new user, just to be sure there’s nothing interfering with npm or the path
2. Do you by any chance have npm v5 installed on that machine? That version changes the way they install local dependencies, which is what we use to build Graylog frontend plugins, so I would try to uninstall it if it is installed
3. Are you using the most recent changes in the 2.3 branch? If that is the case, try pulling to the latest commit before building

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [December 18, 2017, 1:44pm UTC](https://community.graylog.org/t/plugin-build-errors/3128/13 "2017-12-18T13:44:26Z")

</div>

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