[Apiman-user] building apiman on Redhat

Christopher Stolte cstolte at ebsco.com
Fri Jun 17 11:37:58 EDT 2016


Oh jeez. Major egg on my face here...I was just about ready to update this thread, as I have figured out what was going on.


It turns out I had inadvertently modified manager/ui/war/pom.xml in a subtle way that -completely- broke it. This was the cause of all my problems.. I'm very sorry to have wasted your time, and I sincerely thank you for your effort in trying to help me out.  (On the bright side I understand node, npm, and maven better than when I started!)


Just to be clear then - a global install of node/npm is not required, and everything is building correctly for me on CentOS after having reverted my disastrous change.


Thank you again - please feel free to throw virtual office supplies at me from across cyberspace...


-Chris

________________________________
From: Rachel Yordan <ryordan at redhat.com>
Sent: Friday, June 17, 2016 11:16:03 AM
To: Christopher Stolte
Cc: apiman-user at lists.jboss.org
Subject: Re: [Apiman-user] building apiman on Redhat

Chris,

Apologies for the delayed response, I'm currently working on another project. I also got your PMs on IRC, I'll message you back on there now. But in the meantime, are you running CentOS? This is more of a Jenkins and frontend-maven-plugin issue as opposed to an apiman-specific issue, but I can try my best to help.

I think this could possibly be an issue with the fact that your project has a space in the name, as I've had issues in the past related to spaces in the project name. Either way, it doesn't hurt to try building it without spaces! Also, don't forget to undo the changes you've made to node/npm as you don't want it to affect that.

1. It doesn't need to use a relative path because the local Node binary that is being used is responsible for calling `npm install` (locally). Having said that, if you don't have a Node path set, it's going to use the globally installed Node and you try this manually without the frontend-maven-plugin. If you are 100% sure you're not doing that, then there could be a bug in the plugin that handles that: https://github.com/eirslett/frontend-maven-plugin

2, 3. Try building manually as the Jenkins user, so that it's easier to debug. Btw, what error are you getting on the build as the Jenkins user?

- Download the jenkins-cli.jar file (http://<jenkins server>/jnlpJars/jenkins-cli.jar) and place this jar in the directory from which you are going to run the Jenkins build command.
- Switch to the Jenkins user with `sudo su -s /bin/bash jenkins` on the build server.
- cd into the `/var/lib/jenkins/jobs/Upgrade APIMAN/workspace/manager/ui/war` directory, or wherever Jenkins is storing the workspace files.
- Use the Jenkins CLI to build it manually.  You can view the CLI commands available at http://<jenkins server >/cli/ ( e.g http://localhost:8080/cli/ ), but it will the build command will be something like this: java -jar jenkins-cli.jar -s http://<jenkins server>/ build build-name [-c] [-f] [-p] [-r N] [-s] [-v] [-w]

Some of the flags are very useful in this case:
-f  : Follow the build progress. Like -s only interrupts are not passed through to the build.
-p  : Specify the build parameters in the key=value format.
-v  : Prints out the console output of the build. Use with -s

I would try adding build parameters to see if it's really an issue with the NODE_EXE var. Absolute worst case scenario, temporarily set the NODE_EXE var for that specific project either via an execute shell script on the Jenkins job configuration settings (can't remember if that's a separate plugin or not), or you can switch to the Jenkins user and set it that way. You shouldn't have to do this though, and if you do, I'd open up a PR in the frontend-maven-plugin repo.

Hope this helps!

Rachel



On Wed, Jun 15, 2016 at 2:47 PM, Christopher Stolte <cstolte at ebsco.com<mailto:cstolte at ebsco.com>> wrote:

Hi Rachel,


Thanks for your response.  There are a few things here which are confusing me:


1. the build log says "Running 'npm install --color=false' in /var/lib/jenkins/jobs/Upgrade APIMAN/workspace/manager/ui/war"

is that correct? (it seems like it's trying to run a globally installed npm...) If it's trying to use a locally installed npm, why isn't is using a relative path to it?


2. If I change manager/ui/war/node/npm so that NODE_EXE=./node/node (instead of "node")  it succeeds.


3. The failing job is being run by Jenkins, and the Jenkins user has no node on it's path. But if I run the build as a different user who does, it works.


It seems that the plugin which installs nodejs locally, or some subsequent part of the build process, isn't referring to them correctly (and thus is dependent on a globally installed node in order to work).  Any insight? For what it's worth I can build the exact same source, from the same repo, with the same command, on my mac, which has node and npm installed globally.


Thanks,

Chris

________________________________
From: Rachel Yordan <ryordan at redhat.com<mailto:ryordan at redhat.com>>
Sent: Wednesday, June 15, 2016 1:21:53 PM
To: Christopher Stolte
Cc: apiman-user at lists.jboss.org<mailto:apiman-user at lists.jboss.org>
Subject: Re: [Apiman-user] building apiman on Redhat

Hey Chris,

When you run `$ npm install` or even `$ node -v` you are using the globally installed binary as opposed to the local one, even if you are within the directory, as you can see here:

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--color=false"

The deprecation warning at the end of the build log should not be enough to cause a build failure. To get a more detailed error regarding the build failure I'd try using the local binary from within the `war` directory you were in with `$ node/npm install --color=false`. You can also test that it's using the correct binary with `$ node/npm -v` or `$ node/node -v`. What is causing the build to fail could be several things, but I always recommend starting with a clean slate before each test build -- try running the following before triggering your build again:

$ rm -rf node_modules/
$ npm cache clean

Feel free to ping me on IRC if that doesn't help you get a better idea of what's going on. Hope it helps! :)

Rachel Yordán
IRC: ryordan
GH: @kahboom<https://github.com/kahboom>

On Wed, Jun 15, 2016 at 10:59 AM, Christopher Stolte <cstolte at ebsco.com<mailto:cstolte at ebsco.com>> wrote:

Hello,


I am trying to build apiman-1.2.6.Final on Redhat.  Server details:


$ uname -or

3.10.0-229.el7.x86_64 GNU/Linux


$ java -version

openjdk version "1.8.0_91"


The build fails at this point:


[INFO] --- frontend-maven-plugin:0.0.27:install-node-and-npm (install node and npm) @ apiman-manager-ui-war ---

[INFO] Found proxies: []

[INFO] Installing node version v5.6.0

[INFO] Creating temporary directory /home/cloud-user/apiman-build/manager/ui/war/node_tmp

[INFO] Downloading Node.js from https://nodejs.org/dist/v5.6.0/node-v5.6.0-linux-x64.tar.gz to /home/cloud-user/apiman-build/manager/ui/war/node_tmp/node.tar.gz

[INFO] No proxies configured

[INFO] No proxy was configured, downloading directly

[INFO] Extracting Node.js files in node_tmp

[INFO] Unpacking /home/cloud-user/apiman-build/manager/ui/war/node_tmp/node.tar.gz into /home/cloud-user/apiman-build/manager/ui/war/node_tmp

[INFO] Moving node binary to /home/cloud-user/apiman-build/manager/ui/war/node/node

[INFO] Deleting temporary directory /home/cloud-user/apiman-build/manager/ui/war/node_tmp

[INFO] Installed node locally.

[INFO] Installing npm version 3.6.0

[INFO] Downloading NPM from http://registry.npmjs.org/npm/-/npm-3.6.0.tgz to /home/cloud-user/apiman-build/manager/ui/war/npm.tar.gz

[INFO] No proxies configured

[INFO] No proxy was configured, downloading directly

[INFO] Extracting NPM files in node/

[INFO] Unpacking /home/cloud-user/apiman-build/manager/ui/war/npm.tar.gz into /home/cloud-user/apiman-build/manager/ui/war/node/node_modules

[INFO] Installed NPM locally.

[INFO]

[INFO] --- frontend-maven-plugin:0.0.27:npm (npm install) @ apiman-manager-ui-war ---

[INFO] Found proxies: []

[INFO] Running 'npm install --color=false' in /home/cloud-user/apiman-build/manager/ui/war

[ERROR] npm WARN deprecated graceful-fs at 1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.


Node/npm appear to be globally installed:


$ npm -v

2.15.1

$ node -v

v4.4.3


I then tried to execute that npm command from the stated directory, and got this:


$ cd manager/ui/war

$ npm install --color=false

npm WARN peerDependencies The peer dependency marked@^0.3.3 included from marked-terminal will no

npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency

npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

npm WARN prefer global marked at 0.3.5 should be installed with -g

npm WARN deprecated graceful-fs at 1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

npm WARN peerDependencies The peer dependency grunt@>=0.4.0 included from grunt-contrib-cssmin will no

npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency

npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

npm WARN peerDependencies The peer dependency grunt@~0.4.1 included from grunt-jekyll will no

npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency

npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

npm WARN peerDependencies The peer dependency grunt@~0.4.5 included from grunt-contrib-less will no

npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency

npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

npm WARN peerDependencies The peer dependency grunt@~0.4.0 included from grunt-contrib-uglify will no

npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency

npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

npm WARN peerDependencies The peer dependency grunt@~0.4.0 included from grunt-contrib-connect will no

npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency

npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

npm WARN deprecated lodash at 2.4.1: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.

npm WARN peerDependencies The peer dependency grunt@~0.4.0 included from grunt-contrib-watch will no

npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency

npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

npm ERR! Linux 3.10.0-229.el7.x86_64

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--color=false"

npm ERR! node v4.4.3

npm ERR! npm  v2.15.1

npm ERR! code EBADPLATFORM

npm ERR! notsup Unsupported

npm ERR! notsup Not compatible with your operating system or architecture: fsevents at 1.0.8

npm ERR! notsup Valid OS:    darwin

npm ERR! notsup Valid Arch:  any

npm ERR! notsup Actual OS:   linux

npm ERR! notsup Actual Arch: x64

npm ERR! Please include the following file with any support request:

npm ERR!     /home/cloud-user/apiman-build/manager/ui/war/npm-debug.log


Does anyone have an idea as to what is going on here? I see some threads about the maven plugin that installs node/npm locally (https://issues.jboss.org/browse/APIMAN-771), but it isn't quite what's going on here. I'm especially confused about versions, since the plugin installed versions [5.6.0/3.6.0] locally but the above error message is referencing the globally installed versions [4.4.3/2.15.1].


Any help much appreciated!

Chris



_______________________________________________
Apiman-user mailing list
Apiman-user at lists.jboss.org<mailto:Apiman-user at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/apiman-user



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/apiman-user/attachments/20160617/66180790/attachment-0001.html 


More information about the Apiman-user mailing list